diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | doc/crucible-ls-example-tests.1.txt | 21 | ||||
-rw-r--r-- | doc/crucible-ls-tests.1.txt | 4 | ||||
-rw-r--r-- | doc/crucible-run.1.txt | 3 | ||||
-rw-r--r-- | misc/crucible-completion.bash | 2 | ||||
-rw-r--r-- | src/cmd/ls_example_tests.c | 86 |
6 files changed, 2 insertions, 116 deletions
diff --git a/Makefile.am b/Makefile.am index 7898a91..2033caa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -53,7 +53,6 @@ bin_crucible_SOURCES = \ src/cmd/bootstrap.c \ src/cmd/dump-image.c \ src/cmd/help.c \ - src/cmd/ls_example_tests.c \ src/cmd/ls_tests.c \ src/cmd/main.c \ src/cmd/run.c \ @@ -137,7 +136,6 @@ man1_MANS = \ doc/crucible-dump-image.1 \ doc/crucible-help.1 \ doc/crucible-tutorial.7 \ - doc/crucible-ls-example-tests.1 \ doc/crucible-ls-tests.1 \ doc/crucible-run.1 \ doc/crucible-version.1 diff --git a/doc/crucible-ls-example-tests.1.txt b/doc/crucible-ls-example-tests.1.txt deleted file mode 100644 index 5a12b0e..0000000 --- a/doc/crucible-ls-example-tests.1.txt +++ /dev/null @@ -1,21 +0,0 @@ -crucible-ls-example-tests(1) -============================ -:doctype: manpage - -NAME ----- -crucible-ls-example-tests - list names of example tests - -SYNOPSIS --------- -[verse] -*crucible ls-example-tests* - -DESCRIPTION ------------ -List all example tests. Example tests are those whose names match the glob -pattern "example.*". - -SEE ALSO --------- -*crucible-ls-tests(1)* diff --git a/doc/crucible-ls-tests.1.txt b/doc/crucible-ls-tests.1.txt index e30f586..8a8c0af 100644 --- a/doc/crucible-ls-tests.1.txt +++ b/doc/crucible-ls-tests.1.txt @@ -15,7 +15,3 @@ DESCRIPTION ----------- List all tests. This includes tests that are not ran by default, such as example tests ("example.*") and self tests ("self.*"). - -SEE ALSO --------- -*crucible-ls-example-tests(1)* diff --git a/doc/crucible-run.1.txt b/doc/crucible-run.1.txt index 77cedf0..94cef8c 100644 --- a/doc/crucible-run.1.txt +++ b/doc/crucible-run.1.txt @@ -106,5 +106,4 @@ $ crucible run 'func.miptree.cubemap.*' \ SEE ALSO -------- -*crucible-ls-tests(1)*, -*crucible-ls-example-tests(1)* +*crucible-ls-tests(1)* diff --git a/misc/crucible-completion.bash b/misc/crucible-completion.bash index 583e79e..8942b14 100644 --- a/misc/crucible-completion.bash +++ b/misc/crucible-completion.bash @@ -1,4 +1,4 @@ -__crucible_commands="bootstrap dump-image test help ls-tests ls-example-tests run version" +__crucible_commands="bootstrap dump-image test help ls-tests run version" __crucible_bootstrap() { diff --git a/src/cmd/ls_example_tests.c b/src/cmd/ls_example_tests.c deleted file mode 100644 index 416b05d..0000000 --- a/src/cmd/ls_example_tests.c +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2015 Intel Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice (including the next -// paragraph) shall be included in all copies or substantial portions of the -// Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. - -#include "cmd.h" -#include "framework/test/test.h" -#include "framework/test/test_def.h" - -static const char *shortopts = "h"; - -static const struct option longopts[] = { - {"help", no_argument, NULL, 'h'}, - {0}, -}; - -static void -parse_args(const cru_command_t *cmd, int argc, char **argv) -{ - // Suppress getopt from printing error messages. - opterr = 0; - - // Reset getopt. - optind = 0; - - while (true) { - int optchar = getopt_long(argc, argv, shortopts, longopts, NULL); - - switch (optchar) { - case -1: - goto done_getopt; - case 'h': - cru_command_page_help(cmd); - exit(0); - break; - case ':': - cru_usage_error(cmd, "%s requires an argument", argv[optind-1]); - break; - case '?': - default: - cru_usage_error(cmd, "unknown option: %s", argv[optind-1]); - break; - } - } - -done_getopt: - if (optind < argc) - cru_usage_error(cmd, "trailing arguments"); -} - -static int -start(const cru_command_t *cmd, int argc, char **argv) -{ - const test_def_t *def; - - parse_args(cmd, argc, argv); - - cru_foreach_test_def(def) { - if (test_def_match(def, "example.*")) { - printf("%s\n", def->name); - } - } - - return 0; -} - -cru_define_command { - .name = "ls-example-tests", - .start = start, -}; |