diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-26 15:59:03 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-26 16:58:54 -0700 |
commit | 87fe3d7a9e5ae9503ee89a3d69f8b84a88ad24de (patch) | |
tree | dcbd84449ecf20bb5698b4e28db194996196579c /subx/002test.cc | |
parent | 4db6b370346d1a2fef2d35c1a64580e93e2bdf0d (diff) | |
download | mu-87fe3d7a9e5ae9503ee89a3d69f8b84a88ad24de.tar.gz |
4426 - error on unrecognized sub-commands
Diffstat (limited to 'subx/002test.cc')
-rw-r--r-- | subx/002test.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/subx/002test.cc b/subx/002test.cc index af6c34a3..f25e331f 100644 --- a/subx/002test.cc +++ b/subx/002test.cc @@ -13,7 +13,7 @@ typedef void (*test_fn)(void); :(before "Globals") // move a global ahead into types that we can't generate an extern declaration for const test_fn Tests[] = { - #include "test_list" // auto-generated; see 'build' script + #include "test_list" // auto-generated; see 'build*' scripts }; :(before "End Globals") @@ -70,6 +70,13 @@ if (Run_tests) { return 0; } +:(after "End Main") +//: Raise other unrecognized sub-commands as errors. +//: We couldn't do this until now because we want `./subx test` to always +//: succeed, no matter how many layers are included in the build. +cerr << "nothing to do\n"; +return 1; + :(code) void run_test(size_t i) { if (i >= sizeof(Tests)/sizeof(Tests[0])) { |