Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in changes from upstream #1

Open
wants to merge 93 commits into
base: master
Choose a base branch
from

Conversation

terrillmoore
Copy link
Member

No description provided.

@terrillmoore terrillmoore added the enhancement New feature or request label Jul 4, 2019
@terrillmoore terrillmoore self-assigned this Jul 4, 2019
wmacevoy and others added 19 commits September 8, 2019 12:49
This fixes the ARDUINO_UNIT_PSTR macro to not reference the wrong
string. In particular, this makes failing macros not output "passed"
instead of "failed".

The same problem was seemingly the subject of commit 60840b8 (not all
skipped.). That commit fixed the problem for test status by not using
the ARDUINO_UNIT_PSTR macro, and seems to contain a half fix for
ARDUINO_UNIT_PSTR using __COUNTER__, but the way it was used,
__COUNTER__ was never actually expanded, so that did not help (also, it
tried to apply __COUNTER__ in the wrong place).

The actual problem *seems* to be that the `0:` label used to reference
the string constant is not actually unique. It should not need to be,
since the `0b` reference should just reference the nearest label 0,
going backwards, but I suspect that gcc ends up reordering asm blocks
and thus messes up the reference. Using a unique (but still numerical so
local) label seems to fix this. See e.g. this thread about reordering of
asm blocks:

https://gcc.gnu.org/legacy-ml/gcc-help/2017-10/msg00061.html

So, this commit reverts the __COUNTER__ bit from that commit, just using
the plain `ptr` name again (which does not need to be unique, since it
is local the the __extension__ block). It also reverts the changes
around the test status, so these now use ARDUINO_UNIT_STRING again as
originally.

Then, it applies a two-layer macro wrapper for ARDUINO_UNIT_PSTR, that
ensures that __COUNTER__ is actually expanded before being used (which
is needed when using a macro as part of a stringification or
concatenation) and ensures that __COUNTER__ is only expanded once, with
one value, rather than with different values in all three places.

Finally, this commit uses this expanded counter value to generate
unique labels, which seems to prevent this problem from occuring.
Fix incorrect merging of PROGMEM strings
When a test is completed (including failed and skipped), it was already
removed from the "root" list but it is now added to the "done" list.
This allows reusing insert() later to move tests from the done list back
into the active list, without affecting the count.
This simply calls Test::run() until all tests are done.
Allow running tests multiple times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants