Fix SHELL variable not being properly set in tests#130
Fix SHELL variable not being properly set in tests#130patrick96 wants to merge 2 commits intokward:masterfrom
Conversation
In commit 3e9578d the shell used in `shunit2_misc_test.sh` was changed from `${SHUNIT_SHELL:-sh}` to `${SHELL:-sh}` because `SHUNIT_SHELL` was not set anywhere. However `exec ${shell_bin}` does not reset the `SHELL` variable, it inherits it from the running shell. This means before that change all misc tests were running with `sh` and after the change the running shell was used instead of the shell that is supposed to be tested. This can be fixed by manually setting the `SHELL` variable. This will now fail the travis build because the most misc tests don't actually pass on `zsh` and `sh` fails `testIssue84` (at least on my machine).
|
This looks good so far. Do you have any thoughts on fixing the now failing tests once this change is made? |
|
I unfortunately don't have the capacity to look at all of them. But I did have a look at a few:
for For some reason this produces a failed test under bash but not sh, couldn't tell you why though. On zsh a bunch of misc tests fail: I have only looked at a few though, but they seem to have the same underlying issue.
when running with Now zsh definitely supports I have added a commit that extracts out the underlying tests into their own files, this makes it easier to debug because the test scripts are not generated on the fly with sed. I wish I could help more, but I really don't have the time right now. |
|
I'm considering this to no longer be a problem as all tests in shunit2_misc_test.sh pass for zsh. If you feel this is in error, please reopen. |
In commit 3e9578d the shell used in
shunit2_misc_test.shwas changed from${SHUNIT_SHELL:-sh}to${SHELL:-sh}becauseSHUNIT_SHELLwas not set anywhere.However
exec ${shell_bin}does not reset theSHELLvariable, itinherits it from the running shell.
This means before that change all misc tests were running with
shandafter the change the running shell was used instead of the shell that is
supposed to be tested.
This can be fixed by manually setting the
SHELLvariable.This will now fail the travis build because the most misc tests don't
actually pass on
zshandshfailstestIssue84(at least on mymachine).