-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix ASSUMPTIONS not working #3368
Fix ASSUMPTIONS not working #3368
Conversation
if (gTestRunnerState.test->runner == &gAssumptionsRunner) | ||
return TRUE; | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I see what I messed up—this code looks like it was expecting to return TRUE
if the test should run on this runner, and FALSE
if not; but somewhere along the way it changed to returning the process to run on instead.
The reason why you'd want to run the assumptions on every runner is that the tests which are covered by the assumptions run on an arbitrary set of runners. So I wonder if this should say return gTestRunnerI;
so that the test runs on all the runners (at zero cost, because we've skipped estimateCost
on line 98, which is also important for keeping all the processCosts
in sync).
I think atm if we have no tests except:
- an
ASSUMPTIONS
block which fails - two tests that rely on that block
Then if we make check -j2
the second test will run even though it shouldn't because ASSUMPTIONS
and the first test will run on runner 0, and just the second test will run on runner 1 (skipFilename
never gets set, because the ASSUMPTIONS
doesn't run on that runner).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By atm you mean with or without this PR's changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these changes. (It would be similar without, but swapping runners 0 and 1 because return TRUE;
is really return 1;
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Now how to fix it : D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd have to double-check (or I can do it later when I'm home from work), but I think just replacing return 0;
with return gTestRunnerI;
ought to do it 🤞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about fixing this extra ASSUME failed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the repeated assumption as a minor issue.
Fixes #3043
Example output when
ASSUME
fails inASSUMPTION
block: