mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-27 00:28:49 +03:00
added argument "--ignoreparam" (ex: --ignoreparam pzToto[0,2,6])
This commit is contained in:
parent
923cd554fc
commit
62378a6f7e
2 changed files with 19 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "TimeHelpers.h"
|
||||
#include "MemoryOutStream.h"
|
||||
#include "SuitePredicate.h"
|
||||
#include "ParameterizedManager.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
|
|
@ -81,7 +82,21 @@ namespace UnitTest {
|
|||
return true;
|
||||
}
|
||||
|
||||
int RunTestsCmd(int argc, char**argv, char const* suiteArgument, char const* testArgument)
|
||||
bool readIgnoreParamArgument(int argc, char**argv, char const* argument)
|
||||
{
|
||||
int from, count;
|
||||
if (!findArgumentListIndex(argc, argv, argument, from, count))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (int i = from; i < from + count; i++)
|
||||
{
|
||||
ParameterizedManager::getInstance().ignoreIndexes(argv[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int RunTestsCmd(int argc, char**argv, char const* suiteArgument, char const* testArgument, char const* ignoreParamArgument)
|
||||
{
|
||||
SuitePredicate predicate;
|
||||
|
||||
|
|
@ -89,6 +104,8 @@ namespace UnitTest {
|
|||
specific |= readSuiteArgument(predicate, argc, argv, suiteArgument);
|
||||
specific |= readTestArgument(predicate, argc, argv, testArgument);
|
||||
|
||||
readIgnoreParamArgument(argc, argv, ignoreParamArgument);
|
||||
|
||||
if (!specific)
|
||||
{
|
||||
predicate.addAll();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace UnitTest {
|
|||
class Timer;
|
||||
|
||||
UNITTEST_LINKAGE int RunAllTests();
|
||||
UNITTEST_LINKAGE int RunTestsCmd(int argc, char**argv, char const* suiteArgument = "--suite", char const* testArgument = "--test");
|
||||
UNITTEST_LINKAGE int RunTestsCmd(int argc, char**argv, char const* suiteArgument = "--suite", char const* testArgument = "--test", char const* ignoreParamArgument = "--ignoreparam");
|
||||
|
||||
struct True
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue