- Added alias for filter -n of -f

- Added ability to surround filter strings in either type of quotes
- Added ability to filter on multiple test strings as a comma delimited list
- Added ability to filter on test_file:test_name
- Added ability to use alternate syntax for filter of -f="blah"
This commit is contained in:
Mark VanderVoord
2016-07-08 17:35:37 -04:00
parent f05385250c
commit 1cecab30e8
2 changed files with 157 additions and 10 deletions

View File

@ -756,6 +756,24 @@ RUNNER_TESTS = [
}
},
{ :name => 'ArgsNameFilterTestAndShould',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n should_,test_",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses',
'test_NotBeConfusedByLongComplicatedStrings',
'test_NotDisappearJustBecauseTheTestBeforeAndAfterHaveCrazyStrings',
'test_StillNotBeConfusedByLongComplicatedStrings',
'should_RunTestsStartingWithShouldByDefault' ],
:to_fail => [ 'test_ThisTestAlwaysFails' ],
:to_ignore => [ 'test_ThisTestAlwaysIgnored' ],
}
},
{ :name => 'ArgsExcludeFilterJustTest',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
@ -807,6 +825,76 @@ RUNNER_TESTS = [
}
},
{ :name => 'ArgsIncludeSingleTestInSpecificFile',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n testRunnerGenerator:ThisTestAlwaysPasses",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses' ],
:to_fail => [ ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeTestFileWithExtension',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n testRunnerGenerator.c:ThisTestAlwaysPasses",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses' ],
:to_fail => [ ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeDoubleQuotes',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n \"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses' ],
:to_fail => [ 'test_ThisTestAlwaysFails' ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeSingleQuotes',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n 'testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails'",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses' ],
:to_fail => [ 'test_ThisTestAlwaysFails' ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeAValidTestForADifferentFile',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-n AnotherFile:ThisTestDoesNotExist",
:expected => {
:to_pass => [ ],
:to_fail => [ ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeNoTests',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
@ -857,6 +945,20 @@ RUNNER_TESTS = [
}
},
{ :name => 'ArgsIncludeWithAlternateFlag',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],
:options => {
:cmdline_args => true,
},
:cmdline_args => "-f=\"testRunnerGenerator:ThisTestAlwaysPasses,test_ThisTestAlwaysFails\"",
:expected => {
:to_pass => [ 'test_ThisTestAlwaysPasses' ],
:to_fail => [ 'test_ThisTestAlwaysFails' ],
:to_ignore => [ ],
}
},
{ :name => 'ArgsIncludeWithParameterized',
:testfile => 'testdata/testRunnerGenerator.c',
:testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'],