Skip to content

Commit

Permalink
remove DATA* tests from default test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
hughperkins committed Nov 22, 2015
1 parent 8b5319c commit 848118f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/gtest_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ using namespace std;
string cmdline;

GTEST_API_ int main(int argc, char **argv) {
// add filter on slow by default
// add filter away slow and data by default
bool deleteargv = false;
// add filter= option, easier to type than --gtest_filter= ...
for( int i = 1; i < argc; i++ ) {
// if( argc >= 2 && ( split( string( argv[1] ), "=" )[0] == "filter"
// || split( string( argv[1] ), "=" )[0] == "gfilter" ) ) {
if( split( string( argv[i] ), "=" )[0] == "tests" ) {
// replace with "--gtest_filter=..."
string newarg = string("--gtest_filter=") + split( string( argv[i] ), "=" )[1];
Expand All @@ -31,7 +29,7 @@ GTEST_API_ int main(int argc, char **argv) {
argv[i] = newargchar;
}
}
// default to -SLOW*
// default to -DATA*:SLOW*
if( argc == 1 ) {
char **newargv = new char *[argc + 1];
int newargc = argc + 1;
Expand All @@ -40,14 +38,13 @@ GTEST_API_ int main(int argc, char **argv) {
newargv[i] = newarg;
strcpy_safe( newargv[i], argv[i], 255 );
}
string slowfilter = "--gtest_filter=-SLOW*";
string slowfilter = "--gtest_filter=-DATA*:SLOW*";
newargv[argc] = new char[ slowfilter.length() + 1 ];
strcpy_safe( newargv[argc], slowfilter.c_str(), 255 );
argv = newargv;
argc = newargc;
deleteargv = true;
}
// cout << "argc " << argc << endl;
cout << "args:";
for( int i = 0; i < argc; i++ ) {
cout << " " << argv[i];
Expand Down

0 comments on commit 848118f

Please sign in to comment.