DARMA-tasking-internal / darma-frontend

Header library providing the frontend programming model for the DARMA asynchronous many-task model
Other
7 stars 0 forks source link

Testing should not be allowed without valid GTEST_DIR #6

Open jjwilke opened 7 years ago

jjwilke commented 7 years ago

Testing can be activated with -DDARMA_FE_ENABLE_TESTS even if no valid googletest installation is found. Errors should occur at the configure stage rather than confusing errors during the compile stage. Right now compilation just crashes with:

fatal error: 'gtest/gtest.h' file not found

lifflander commented 7 years ago

Nicole: is this a quick fix you can implement with a simple cmake conditional?

nlslatt commented 7 years ago

The configure step prints a warning if GTEST_DIR is not specified but tests are enabled. This was done intentionally for cases where google test is installed in a default location. Do you want me to make the warning more explicit? Or are you convinced that a warning is insufficient?

nlslatt commented 7 years ago

If we want to change this specifically for the frontend, the easiest way to do it is by modifying the logic at the top if frontend/src/tests/frontend_validation/CMakeLists.txt. Either (a) edit the warning message to be stronger, or (b) change the message line to message(FATAL_ERROR, "...") and update the message content to indicate an error condition rather than a warning condition. We may want to do something similar for the backend validation as it also uses gtest.

lifflander commented 7 years ago

Is it possible to check if gtest is available if GTEST_DIR is not specified if any of the validation is turned on? If we can do that, then I think generating an error makes sense.

jjwilke commented 7 years ago

Hey, sorry, I had assigned this to myself. I was just going to add a check for the gtest header and gtest library in the frontend even if GTEST_DIR isn't specified.

lifflander commented 7 years ago

Sorry about that. I saw it in the stream of new issues and assumed it was to be assigned to Nicole.