Skip to content

ShellIT: always append exit to generated command files (#32)#137

Open
cansin wants to merge 1 commit into
useocl:mainfrom
cansin:issue-32-shellit-force-exit
Open

ShellIT: always append exit to generated command files (#32)#137
cansin wants to merge 1 commit into
useocl:mainfrom
cansin:issue-32-shellit-force-exit

Conversation

@cansin

@cansin cansin commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Fixes #32.

Integration tests are defined by .in files in
use-gui/src/it/resources/testfiles/shell. Until now every .in file had to end
with an explicit exit, or the generated command file (and therefore 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.

Details

createCommandFile appends exit to every generated command file. USE echoes
the command, so the appended exit is added to the expected output, except:

  • Invalid-model tests — the model fails to load and USE exits by itself
    before the command file is read. These are marked with a #expected exit
    comment and do not expect the (never executed) appended exit
    (t053, t073, t085, t088, t098, t104).
  • Tests already ending in exit/quit/q — the test's own terminator runs
    first, so the appended exit is never executed (and not double-counted).

Because the appended exit terminates USE before its quiet-mode (-q)
end-of-input check, the valid-model tests that relied on that implicit check
now run check explicitly (t126t132).

Testing

  • New unit tests in ShellIT for createCommandFile: the appended exit is in
    both the command file and the expected output; #expected exit suppresses the
    expectation; exit/quit are not duplicated.
  • The full ShellIT suite passes: 129 shell tests + 5 unit tests = 134.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration Tests: Force exit of USE

2 participants