Open clarkedavida opened 2 years ago
One could also include in testing.h
a bool evaluateTestResult()
method that replaces code like
if(lerror) {
rootLogger.error("At least one test failed!");
return -1;
} else {
rootLogger.info("All tests " , CoutColors::green , "passed!" , CoutColors::reset);
}
that one finds all over the place. I guess then the pass()
method might not be necessary. Then one could end a program with something like
return evaluateTestResult(lerror);
Also right now not every test is run with multiGPU. For some tests this is not necessary, but e.g. the RHMC is not tested with multiGPU in the script at the moment.
Another thought: It would be nice if we were a bit more consistent with our naming scheme in CMakeLists
. For example, maybe we can ask that all test executables start with test
or something. I keep forgetting how executables are named and have to keep looking into the CMakeList
to figure it out...
Or is there some other more convenient way to address this?
In response to the last point about looking in the CMakeLists, this was fixed by adding a script that allows make autocomplete.
OK here is what I will try to do at some point:
Since testing.h a header file, I guess it would make a little more sense to me if it were in
base
or something.Furthermore, it would be nice if the
compare_relative
and associated methods returned abool
that one could pass to the main program and know whether a test failed. This would be helpful again for the automation of testing, where we want to just run the test script and know right away whether everything passed.Finally it would be nice to add a
pass()
method to therootLogger
so that we can avoid to typeCoutColors::green
all the time.