From 848118fb9fd365bf1601d3cb77f6ab3cb8ef74d7 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Sun, 22 Nov 2015 09:26:22 +0800 Subject: [PATCH] remove DATA* tests from default test runs --- test/gtest_main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/gtest_main.cpp b/test/gtest_main.cpp index e99f465b..d309dcee 100644 --- a/test/gtest_main.cpp +++ b/test/gtest_main.cpp @@ -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]; @@ -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; @@ -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];