ShellIT: always append exit to generated command files (#32)#137
Open
cansin wants to merge 1 commit into
Open
Conversation
Integration tests are defined by .in files. Until now each .in file had to
end with an explicit exit, or the generated command file (and thus the test
run) would not terminate. ShellIT now always appends an exit to the
generated command file, so test authors no longer need to add one.
The appended exit is echoed by USE and is therefore added to the expected
output, except when:
- the test loads an invalid model and USE exits by itself before the
command file is read. Such tests are now marked with a "#expected exit"
comment (t053, t073, t085, t088, t098, t104).
- the .in file already terminates with its own exit/quit/q, which runs
first so the appended exit is never executed.
Because the appended exit terminates USE before its quiet-mode end-of-input
"check", the valid-model tests that relied on that implicit check now run
"check" explicitly (t126-t132).
Adds unit tests for createCommandFile covering the appended exit, the
"#expected exit" marker, and exit/quit de-duplication.
https://claude.ai/code/session_01A85dAvTAvi2oWkGZH6REEq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #32.
Integration tests are defined by
.infiles inuse-gui/src/it/resources/testfiles/shell. Until now every.infile had to endwith an explicit
exit, or the generated command file (and therefore the testrun) would not terminate.
ShellITnow always appends anexitto thegenerated command file, so test authors no longer need to add one.
Details
createCommandFileappendsexitto every generated command file. USE echoesthe command, so the appended
exitis added to the expected output, except:before the command file is read. These are marked with a
#expected exitcomment and do not expect the (never executed) appended exit
(
t053, t073, t085, t088, t098, t104).exit/quit/q— the test's own terminator runsfirst, so the appended
exitis never executed (and not double-counted).Because the appended
exitterminates USE before its quiet-mode (-q)end-of-input
check, the valid-model tests that relied on that implicit checknow run
checkexplicitly (t126–t132).Testing
ShellITforcreateCommandFile: the appended exit is inboth the command file and the expected output;
#expected exitsuppresses theexpectation;
exit/quitare not duplicated.ShellITsuite passes: 129 shell tests + 5 unit tests = 134.