@@ -83,9 +83,9 @@ bool TestNamespace::run(Reporter* reporter) {
8383 for (auto & test : tests) {
8484 auto runs = test.get_tests ();
8585 reporter->before_test_group (test);
86- std::vector<TestResult > results;
86+ std::vector<Result > results;
8787 if (!test.skip ()) {
88- std::vector<TestResult > results;
88+ std::vector<Result > results;
8989 for (auto const & test_run : test.get_tests ()) {
9090 auto & tracker = _testing_impl::assertion_counter ();
9191 tracker.assertions = {};
@@ -102,7 +102,7 @@ bool TestNamespace::run(Reporter* reporter) {
102102 reporter->before_test (TestCase{&test, +[]{}, std::string (test.name )});
103103
104104 // TODO stringify skipped tests properly
105- auto result = TestResult {&test, std::string (test.name ) + " (...)" , TestOutcome::SKIP};
105+ auto result = Result {&test, std::string (test.name ) + " (...)" , TestOutcome::SKIP};
106106 reporter->after_test (result);
107107 results.push_back (result);
108108 }
@@ -115,8 +115,8 @@ bool TestNamespace::run(Reporter* reporter) {
115115 return status;
116116}
117117
118- TestResult TestCase::run () const {
119- auto ret = TestResult {.test = test, .name = name};
118+ Result TestCase::run () const {
119+ auto ret = Result {.test = test, .name = name};
120120 try {
121121 Capture _out (stdout, ret.stdout );
122122 Capture _err (stderr, ret.stderr );
@@ -184,33 +184,6 @@ bool TestNamespace::iterator::operator==(iterator const& other) const {
184184 return elements == other.elements ;
185185}
186186
187- // TODO get rid of duplicated code
188- void ResultNamespace::insert (TestResult const & test, std::size_t i) {
189- if (i == test.test ->full_name .size () - 1 ) {
190- tests.push_back (test);
191- return ;
192- }
193-
194- auto it = std::ranges::find_if (children, [&](const ResultNamespace& ns) {
195- return ns.name == test.test ->full_name [i];
196- });
197-
198- if (it == children.end ()) {
199- children.emplace_back (test.test ->full_name [i]);
200- it = std::prev (children.end ());
201- }
202-
203- it->insert (test, i + 1 );
204- }
205-
206- std::size_t ResultNamespace::count () const {
207- std::size_t total = tests.size ();
208- for (auto const & ns : children) {
209- total += ns.count ();
210- }
211- return total;
212- }
213-
214187void TestNamespace::insert (Test const & test, std::size_t i) {
215188 if (i == test.full_name .size () - 1 ) {
216189 tests.push_back (test);
0 commit comments