Skip to content
Snippets Groups Projects

Clean up the tests

Merged Sergey Kosukhin requested to merge cleanup-tests into master

This fixes a number of issues related to the unit tests:

  1. 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.
  2. Refactors the ctest_util_file.cpp test:
    • the program is updated to receive the current_path from the command line instead of the generated path_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.
  3. Reintroduces the correct way of setting the build dependencies of the tests, which was removed in !11 (merged).
  4. Sets the C++11 standard for the tests , which is imposed by GTest.
  5. Renames test/googletest/c_test to test/c, which is shorter and consistent with test/fortran.
  6. Moves the fetching of GTest to test/c, which is consistent with how FortUTF is treated.
  7. Enables make test when the project is configured with -DBUILD_TESTING=OFF (was broken in !14 (merged)).
  8. Drops building of libFortUTF.<so|a>, which is not needed due to how the testing framework is used.
  9. Improves the include flag generation for the dependencies of libfortran-support (taken from !23 (closed)).
  10. Prevents GTest from polluting the top build directory.
Edited by Sergey Kosukhin

Merge request reports

Pipeline #49110 passed

Pipeline passed for 182493be on cleanup-tests

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading