@@ -1811,6 +1811,7 @@ class VideoNuLATest : public Test {
18111811// ////////////////////////////////////////////////////////////////////////
18121812
18131813struct Options {
1814+ bool verbose = false ;
18141815 std::vector<std::string> test_name_strs;
18151816 std::vector<std::regex> test_name_regexes;
18161817 bool list = false ;
@@ -1828,6 +1829,7 @@ static Options GetOptions(int argc, char *argv[]) {
18281829
18291830 std::vector<std::string> test_name_patterns;
18301831
1832+ p.AddOption (' v' , " verbose" ).SetIfPresent (&options.verbose ).Help (" be more verbose" );
18311833 p.AddOption (' t' , " test" ).Meta (" TEST" ).AddArgToList (&options.test_name_strs ).Help (" run test(s) matching TEST, a case-insensitive string" );
18321834 p.AddOption (' T' , " test-pattern" ).Meta (" TEST" ).AddArgToList (&test_name_patterns).Help (" run test(s) matching TEST, a case-insensitive glob pattern" );
18331835 p.AddOption (' l' , " list" ).SetIfPresent (&options.list ).Help (" list all test names" );
@@ -1857,12 +1859,19 @@ static Options GetOptions(int argc, char *argv[]) {
18571859 }
18581860 }
18591861
1862+ if (options.verbose ) {
1863+ printf (" Regex: %s\n " , test_name_regex_str.c_str ());
1864+ }
1865+
1866+ std::regex re;
18601867 try {
1861- options. test_name_regexes . push_back (std::regex (test_name_regex_str, std::regex_constants::icase | std::regex_constants::extended));
1868+ re = std::regex (std::regex (test_name_regex_str, std::regex_constants::icase | std::regex_constants::extended));
18621869 } catch (const std::regex_error &e) {
18631870 fprintf (stderr, " FATAL: error in regex: %s\n FATAL: %s\n " , test_name_regex_str.c_str (), e.what ());
18641871 exit (1 );
18651872 }
1873+
1874+ options.test_name_regexes .push_back (std::move (re));
18661875 }
18671876
18681877 return options;
0 commit comments