Clean up the tests
This fixes a number of issues related to the unit tests:
- Gets the C headers right:
- header file extensions in C should be
.h
and not.hpp
; - if a function is to be used in another translation unit, it should be declared in a header file that is also included by the translation unit that defines it so that the compiler can check whether the declaration matches the definition.
- header file extensions in C should be
- Refactors the
ctest_util_file.cpp
test:- the program is updated to receive the
current_path
from the command line instead of the generatedpath_config.h
(defaults to the current working directory); - the input file for the test is now generated with CMake (no need to have it in the repo);
- input files for the test now have names that make it easier to match them to the test when browsing the build directory.
- the program is updated to receive the
- Reintroduces the correct way of setting the build dependencies of the tests, which was removed in !11 (merged).
- Sets the C++11 standard for the tests
, which is imposed by.GTest
- Renames
test/googletest/c_test
totest/c
, which is shorter and consistent withtest/fortran
. - Moves the fetching of
GTest
totest/c
, which is consistent with howFortUTF
is treated. - Enables
make test
when the project is configured with-DBUILD_TESTING=OFF
(was broken in !14 (merged)). - Drops building of
libFortUTF.<so|a>
, which is not needed due to how the testing framework is used. - Improves the include flag generation for the dependencies of
libfortran-support
(taken from !23 (closed)). - Prevents GTest from polluting the top build directory.
Edited by Sergey Kosukhin
Merge request reports
Activity
Please register or sign in to reply