Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to testing suite #42

Open
clarkedavida opened this issue Jan 3, 2022 · 5 comments
Open

Improvements to testing suite #42

clarkedavida opened this issue Jan 3, 2022 · 5 comments
Assignees
Labels
design Discussion on how to implement something

Comments

@clarkedavida
Copy link
Collaborator

clarkedavida commented Jan 3, 2022

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 clarkedavida added the design Discussion on how to implement something label Jan 3, 2022
@clarkedavida clarkedavida self-assigned this Jan 3, 2022
@clarkedavida clarkedavida changed the title testing.h Improvements to testing suite Jan 3, 2022
@clarkedavida
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@clarkedavida
Copy link
Collaborator Author

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

  • use the methods in testing.h more in the existing tests
  • say something in the documentation about testing.h
  • implement that evaluateTestResult() thingy
  • add the pass() thing to rootlogger?
  • have the compare... methods return bools?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Discussion on how to implement something
Projects
None yet
Development

No branches or pull requests

2 participants