Skip to content

Unit Test PR: command line argument tests - #694

Closed
danoli3 wants to merge 3 commits into
openframeworks:masterfrom
danoli3:unit-tests
Closed

danoli3 wants to merge 3 commits into
openframeworks:masterfrom
danoli3:unit-tests

Conversation

@danoli3

@danoli3 danoli3 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Updated cmdLine from 0.120.0 to 0.121.0 and PG GUI from 0.114.0 to 0.115.0

scripts/test_cmdline_args.sh <projectGenerator> <OF root> [platform] - 34 cases run from the macOS, Linux and Windows CI (scripts/*/test_cmdline.sh), so a value taken as the project path (#693) fails CI instead of generating a project somewhere else. After every case it checks that nothing new appeared at the OF root, in apps/ or apps/myApps/.

  • project path: attached / = / separate values, short and long, relative and absolute -o, every value option separated (-a -D -P -s), path only, missing path, bare value option at the end, two paths, option after the path, the OF folder as the project, unknown platform, unknown option, --platform typo, bad -o, --dryrun writes nothing, -r folder
  • system frameworks / libs (System frameworks / libraries for macOS, iOS, tvOS kept in config.make, GUI fields and help tab #690): commas, comma+space, spaces only, .framework suffix, duplicates, libX.tbd / -lX / libX / X, libs given to -f, kept on update, empty -f / --system-libs= remove them, += lines in config.make, Xcode file refs
  • defines / app version / build / emscripten wasm (platforms with a config.make): values written, bad values warn and keep the project's

Found while writing them, fixed here:

  • an unknown platform crashed (-p bogus -> exit 139, getTargetProject returned no project); now Unknown platform, exit 64
  • on Windows (MSVC) no -p crashed the same way: the host platform checked __WIN32__, which MSVC doesn't define, so it was empty; now _WIN32 too, so it's vs again
  • unknown options were ignored (--bogus -> exit 0); now Unknown option, exit 64
  • -p osx with no project path made a project called osx; a bare value option at the end now takes the value (missing project path, exit 64). Only -f / --frameworks / --system-libs keep meaning empty there
  • --platform osx (typo of --platforms) was the long name of -i: printed the host platform and exited 0 without touching the project. Renamed to --getplatform, as --help already said
  • osx Test 2 passed two paths (../../examples/ ./projectGenerator) and the osx tests didn't check exit codes, so after Fix cmdLine placing projects into oF root with certain params  #693 it failed without failing CI

Run locally on macOS for osx / linux64 / vs, with the binary inside and outside an OF tree: 34 / 34 / 30 cases (vs has no config.make template, so no defines / version cases), 0 failures. Against the binary from before #693: 54 failures; against current master: the 4 fixed here.

@danoli3

danoli3 commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Merged as part of #695 (3afaff3): #695 was stacked on this branch and its squash merge brought these commits into master, so rebased onto master this PR is empty. On master: scripts/test_cmdline_args.sh run from the macOS / Linux / Windows CI, unknown options / platforms are errors instead of being ignored / crashing, a bare value option at the end, --getplatform, the Windows host platform fix, and Updated cmdLine from 0.120.0 to 0.121.0.

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.

1 participant