Merge lp:~brianaker/gearmand/yatl-list into lp:gearmand

Proposed by Brian Aker
Status: Merged
Merged at revision: 851
Proposed branch: lp:~brianaker/gearmand/yatl-list
Merge into: lp:gearmand
Diff against target: 128 lines (+52/-1)
3 files modified
libtest/collection.h (+5/-0)
libtest/framework.cc (+1/-1)
libtest/main.cc (+46/-0)
To merge this branch: bzr merge lp:~brianaker/gearmand/yatl-list
Reviewer Review Type Date Requested Status
Tangent Trunk Pending
Review via email: mp+178422@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libtest/collection.h'
--- libtest/collection.h 2013-07-02 12:18:03 +0000
+++ libtest/collection.h 2013-08-03 10:12:27 +0000
@@ -67,6 +67,11 @@
67 return _name.c_str();67 return _name.c_str();
68 }68 }
6969
70 TestCases& tests()
71 {
72 return _testcases;
73 }
74
70 void succeess();75 void succeess();
7176
72 void skip();77 void skip();
7378
=== modified file 'libtest/framework.cc'
--- libtest/framework.cc 2013-07-02 12:18:03 +0000
+++ libtest/framework.cc 2013-08-03 10:12:27 +0000
@@ -192,7 +192,7 @@
192192
193void Framework::exec()193void Framework::exec()
194{194{
195 for (std::vector<Collection*>::iterator iter= _collection.begin();195 for (Suites::iterator iter= _collection.begin();
196 iter != _collection.end() and (_signal.is_shutdown() == false);196 iter != _collection.end() and (_signal.is_shutdown() == false);
197 ++iter)197 ++iter)
198 {198 {
199199
=== modified file 'libtest/main.cc'
--- libtest/main.cc 2013-07-18 09:54:49 +0000
+++ libtest/main.cc 2013-08-03 10:12:27 +0000
@@ -70,6 +70,8 @@
70 unsigned long int opt_repeat= 1; // Run all tests once70 unsigned long int opt_repeat= 1; // Run all tests once
71 bool opt_verbose= false;71 bool opt_verbose= false;
72 bool opt_quiet= false;72 bool opt_quiet= false;
73 bool opt_list_collection= false;
74 bool opt_list_tests= false;
73 std::string collection_to_run;75 std::string collection_to_run;
74 std::string wildcard;76 std::string wildcard;
75 std::string binary_name;77 std::string binary_name;
@@ -104,9 +106,12 @@
104 // Options parsing106 // Options parsing
105 {107 {
106 enum long_option_t {108 enum long_option_t {
109 OPT_LIBYATL_HELP,
107 OPT_LIBYATL_VERBOSE,110 OPT_LIBYATL_VERBOSE,
108 OPT_LIBYATL_VERSION,111 OPT_LIBYATL_VERSION,
109 OPT_LIBYATL_MATCH_COLLECTION,112 OPT_LIBYATL_MATCH_COLLECTION,
113 OPT_LIBYATL_LIST_COLLECTIONS,
114 OPT_LIBYATL_LIST_TESTS,
110 OPT_LIBYATL_MASSIVE,115 OPT_LIBYATL_MASSIVE,
111 OPT_LIBYATL_QUIET,116 OPT_LIBYATL_QUIET,
112 OPT_LIBYATL_MATCH_WILDCARD,117 OPT_LIBYATL_MATCH_WILDCARD,
@@ -117,11 +122,14 @@
117122
118 static struct option long_options[]=123 static struct option long_options[]=
119 {124 {
125 { "help", no_argument, NULL, OPT_LIBYATL_HELP },
120 { "verbose", no_argument, NULL, OPT_LIBYATL_VERBOSE },126 { "verbose", no_argument, NULL, OPT_LIBYATL_VERBOSE },
121 { "version", no_argument, NULL, OPT_LIBYATL_VERSION },127 { "version", no_argument, NULL, OPT_LIBYATL_VERSION },
122 { "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },128 { "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },
123 { "repeat", required_argument, NULL, OPT_LIBYATL_REPEAT },129 { "repeat", required_argument, NULL, OPT_LIBYATL_REPEAT },
124 { "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },130 { "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },
131 { "list-collections", no_argument, NULL, OPT_LIBYATL_LIST_COLLECTIONS },
132 { "list-tests", no_argument, NULL, OPT_LIBYATL_LIST_TESTS },
125 { "wildcard", required_argument, NULL, OPT_LIBYATL_MATCH_WILDCARD },133 { "wildcard", required_argument, NULL, OPT_LIBYATL_MATCH_WILDCARD },
126 { "massive", no_argument, NULL, OPT_LIBYATL_MASSIVE },134 { "massive", no_argument, NULL, OPT_LIBYATL_MASSIVE },
127 { "ssl", no_argument, NULL, OPT_LIBYATL_SSL },135 { "ssl", no_argument, NULL, OPT_LIBYATL_SSL },
@@ -139,6 +147,13 @@
139147
140 switch (option_rv)148 switch (option_rv)
141 {149 {
150 case OPT_LIBYATL_HELP:
151 for (struct option *opt= long_options; opt->name; ++opt)
152 {
153 Out << "--" << opt->name;
154 }
155 exit(EXIT_SUCCESS);
156
142 case OPT_LIBYATL_VERBOSE:157 case OPT_LIBYATL_VERBOSE:
143 opt_verbose= true;158 opt_verbose= true;
144 break;159 break;
@@ -160,6 +175,13 @@
160 }175 }
161 break;176 break;
162177
178 case OPT_LIBYATL_LIST_TESTS:
179 opt_list_tests= true;
180
181 case OPT_LIBYATL_LIST_COLLECTIONS:
182 opt_list_collection= true;
183 break;
184
163 case OPT_LIBYATL_MATCH_COLLECTION:185 case OPT_LIBYATL_MATCH_COLLECTION:
164 collection_to_run= optarg;186 collection_to_run= optarg;
165 break;187 break;
@@ -316,6 +338,30 @@
316338
317 std::auto_ptr<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));339 std::auto_ptr<libtest::Framework> frame(new libtest::Framework(signal, binary_name, collection_to_run, wildcard));
318340
341 if (opt_list_collection)
342 {
343 for (Suites::iterator iter= frame->suites().begin();
344 iter != frame->suites().end();
345 ++iter)
346 {
347 if (opt_list_tests)
348 {
349 for (TestCases::iterator test_iter= (*iter)->tests().begin();
350 test_iter != (*iter)->tests().end();
351 ++test_iter)
352 {
353 Out << (*iter)->name() << "." << (*test_iter)->name();
354 }
355 }
356 else
357 {
358 Out << (*iter)->name();
359 }
360 }
361
362 continue;
363 }
364
319 // Run create(), bail on error.365 // Run create(), bail on error.
320 {366 {
321 switch (frame->create())367 switch (frame->create())

Subscribers

People subscribed via source and target branches

to all changes: