Open jjwilke opened 7 years ago
Nicole: is this a quick fix you can implement with a simple cmake conditional?
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?
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.
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.
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.
Sorry about that. I saw it in the stream of new issues and assumed it was to be assigned to Nicole.
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