7#include <kernel/runtime.hpp>
8#include <kernel/backend.hpp>
9#include <kernel/util/time_stamp.hpp>
16int main(
int argc,
char** argv)
21 std::cout <<
"CTEST_FULL_OUTPUT\n";
23 int result(EXIT_SUCCESS);
29 bool all_filter(
false);
30 std::list<String> labels;
31 for(
int i(1) ; i < argc ; ++i)
33 if (0 == strcmp(argv[i],
"and"))
40 if (strlen(argv[i]) > 1 && argv[i][0] ==
'-' && argv[i][1] ==
'-')
43 labels.push_back(argv[i]);
50 if (all_filter ==
false)
52 if((find(labels.begin(), labels.end(), (*i)->get_preferred_backend_name()) == labels.end()) &&
53 (find(labels.begin(), labels.end(), (*i)->get_datatype_name()) == labels.end()) &&
54 (find(labels.begin(), labels.end(), (*i)->get_index_name()) == labels.end()) )
65 for (
auto li(labels.begin()) ; li != labels.end() ; ++li)
67 if(*li != (*i)->get_preferred_backend_name() &&
68 *li != (*i)->get_datatype_name() &&
69 *li != (*i)->get_index_name())
83 size_t tests_passed(0u);
84 size_t tests_failed(0u);
85 unsigned long iterator_index(1);
91 std::cout <<
"(" << iterator_index <<
"/" << list_size <<
") " << (*i)->id()
92 <<
" [Preferred Backend: " << (*i)->get_preferred_backend_name() <<
"]"
93 <<
" [Precision: "<< (*i)->get_datatype_name() <<
"]"
94 <<
" [Indexing: "<< (*i)->get_index_name() <<
"]"
100 std::cout <<
"PASSED in " << t2.
elapsed_string(t1) <<
" seconds\n";
105 std::cout <<
"FAILED: " << (*i)->id() <<
"\n" <<
stringify(e.
what()) <<
"\n";
106 result = EXIT_FAILURE;
135 if(result == EXIT_SUCCESS)
137 std::cout <<
"All " << list_size <<
" tests PASSED!\n";
141 std::cout << tests_passed <<
" of " << list_size <<
" tests PASSED, "
142 << tests_failed <<
" tests FAILED!\n";
146 std::cout <<
"Total Runtime: " << t_end.
elapsed_string(t_start) <<
" seconds\n";
static void set_preferred_backend(PreferredBackend preferred_backend)
set new preferred backend
Runtime scope guard class.
exception thrown by the check method in UnitTest
virtual const char * what() const noexcept override
description
static TestList * instance()
Returns the instance.
std::list< UnitTest * >::iterator Iterator
TestList forward iterator.
Iterator erase(Iterator i)
removes iterator target from the TestList
String elapsed_string(const TimeStamp &before, TimeFormat format=TimeFormat::s_m) const
Return the time elapsed between two time stamps as a string.
String stringify(const T_ &item)
Converts an item into a String.