-
Notifications
You must be signed in to change notification settings - Fork 26
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
Added .err tests to close issue #479 #481
Conversation
9ffd570
to
8c0b804
Compare
@kaeluka I modified the test script to use a tmp file to flag whether a test was successful or not. This tmp file is deleted before each .err test is run and at the end of all tests to remove clutter. If you think there is a better way, please make it so. |
return | ||
fi | ||
|
||
rm -f /tmp/encore_test_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.
The run
function should just return the exit code of the test. Or, alternatively do something like
if (($? != 0); then
echo "exited with error code"
fi
Then this file shouldn't be necessary.
I am not sure I get it. When we are running .err tests using the run function we want to make sure that exit code is != 0, but when we run them outside of .err, we don't want that. |
When running an .err test, we could check that |
This was the I tried, but I could not get it to work. Possibly because of some subshelling. Come to think of it, maybe run should end with exit rather than return? I think grepping for a line in the output is worse than the file marker. If you have a more concrete suggestion how to propagate the exit codes that would be very helpful! |
What'd work (modulo me not knowing bash well enough) is to store $? into a variable after running the test in The text in the output is also not very nice, returning a proper return value like this is best, IMO. |
That's exactly what I did on my first try and could not get to work! :( |
@kaeluka I'll take another crack at this tomorrow or whenever I can find some time. If I cannot get it done by tomorrow, I propose we accept this anyways because the file solution isn't that bad. (modulo any other things that need fixing ofc) |
@kaeluka My $0.02: If you haven't gotten around to this yet, please merge anyway to get this out of the way. You can come back to this later for gold plating. |
I'll look at this in a bit. |
Now we're in a grey area when it comes to merging. I committed on top of your branch @TobiasWrigstad, so technically I can't merge it. |
btw, for you, me and possibly others who want to hear some horrible bash trivia: I learned that HOWEVER, |
What crap! Well done. I'll look at this today. |
8a7c507
to
8f5cd87
Compare
I've merged and tested and squashed. Who can review and merge this now? |
I don't know if it's this PR that introduced |
This closes issue #479 by adding support for tests that pass the compiler but fail at run-time. Tests with a .err file have their stderr redirected to stdout and thus we support also matching against stderr output, which is the case with #204. If tests that have an .err don't fail at run-time, the test is considered failed.