()
| 44 | } |
| 45 | |
| 46 | func createTestCommand() cli.Command { |
| 47 | return cli.Command{ |
| 48 | Name: "test", |
| 49 | Usage: "Execute cli app tests", |
| 50 | UsageText: `Execute cli app tests |
| 51 | |
| 52 | By default it will use the commander.yaml from your current directory. |
| 53 | Tests are always executed in alphabetical order. |
| 54 | |
| 55 | Examples: |
| 56 | |
| 57 | Directory test: |
| 58 | commander test --dir /your/dir/ |
| 59 | |
| 60 | Stdin test: |
| 61 | cat commander.yaml | commander test - |
| 62 | |
| 63 | HTTP test: |
| 64 | commander test https://your-url/commander_test.yaml |
| 65 | |
| 66 | Filtering tests: |
| 67 | commander test commander.yaml --filter="my test" |
| 68 | |
| 69 | Multiple filters: |
| 70 | commander test commander.yaml --filter=filter1 --filter=filter2 |
| 71 | |
| 72 | Regex filters: |
| 73 | commander test commander.yaml --filter="^filter1$" |
| 74 | `, |
| 75 | ArgsUsage: "[file] [--filter]", |
| 76 | Flags: []cli.Flag{ |
| 77 | cli.BoolFlag{ |
| 78 | Name: "no-color", |
| 79 | EnvVar: "COMMANDER_NO_COLOR", |
| 80 | Usage: "Activate or deactivate colored output", |
| 81 | }, |
| 82 | cli.BoolFlag{ |
| 83 | Name: "verbose", |
| 84 | Usage: "More output for debugging", |
| 85 | EnvVar: "COMMANDER_VERBOSE", |
| 86 | }, |
| 87 | cli.BoolFlag{ |
| 88 | Name: "dir", |
| 89 | Usage: "Execute all test files in a directory sorted by file name, this is not recursive - e.g. /path/to/test_files/", |
| 90 | }, |
| 91 | cli.StringFlag{ |
| 92 | Name: "workdir", |
| 93 | Usage: "Set the working directory of commander's execution", |
| 94 | }, |
| 95 | cli.StringFlag{ |
| 96 | Name: "config", |
| 97 | Usage: "Default config file to be applied to all test files. Lowest level config values take precednce", |
| 98 | }, |
| 99 | cli.StringSliceFlag{ |
| 100 | Name: "filter", |
| 101 | Usage: `Filter tests by a given regex pattern. Tests are filtered by its title.`, |
| 102 | }, |
| 103 | }, |
no test coverage detected