LatticeQCD / SIMULATeQCD

SIMULATeQCD is a multi-GPU Lattice QCD framework that makes it easy for physicists to implement lattice QCD formulas while still providing competitive performance.
https://latticeqcd.github.io/SIMULATeQCD/
MIT License
30 stars 12 forks source link

Improvements to testing suite #42

Open clarkedavida opened 2 years ago

clarkedavida commented 2 years ago

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 a bool 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 the rootLogger so that we can avoid to type CoutColors::green all the time.

clarkedavida commented 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);
clarkedavida commented 2 years ago

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.

clarkedavida commented 2 years ago

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?

clarkedavida commented 2 years ago

In response to the last point about looking in the CMakeLists, this was fixed by adding a script that allows make autocomplete.

clarkedavida commented 1 year ago

OK here is what I will try to do at some point: