This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Decouple Fortran tests from C/C++ tests.
ClosedPublic

Authored by naromero77 on May 28 2021, 11:12 PM.

Details

Summary

Fortran tests now go in top-level Fortran subdirectory and can be run with or without C/C++ tests.

Fortran tests are still excluded by default.

Diff Detail

Repository
rT test-suite

Event Timeline

naromero77 created this revision.May 28 2021, 11:12 PM
naromero77 requested review of this revision.May 28 2021, 11:12 PM

I suggest to put each test into its own directly, i.e. the hello test into Fortran/UnitTests/hello. This would allow selecting each test separately using TEST_SUITE_SUBDIRS (instead of having to select all Fortran UnitTests/Benchmarks at the same time) and each test can itself decide whether it is using llvm_singlesource() or llvm_multisource().

  • Move hello test to its own subdirectory on UnitTests
  • include Fortran helper moduler in top-level CMakeLists.txt to permit selection of individual UnitTests.
  • Additional CMakeLists.txt needed at this intermediate level.
  • Update comment in Fortran subdirectory CMakeLists.
Meinersbur accepted this revision.Jun 1 2021, 5:09 PM

Ideally, how a test is executed is entirely specified in one file (the CMakeLists.txt), instead split between two files. In the standard case, a lit.local.cfg should not be required.

I don't expect a redesign of the build system, so LGTM.

Fortran/UnitTests/hello/lit.local.cfg
2

With config.traditional_output, stderr, stdout and the error code are implicitly redirected to a .out file . If false, the stderr/stdout files are specified explicitly. I think it is meant as a compatibility switch to make rewriting the build to CMake easier.

3

config.single_source is used for the "compiletime" and "stats" plugin to find the compile'r auxiliary output files. This is already unreliable (e.g. they ignore the CMake PREFIX argument, because the lit cfg has not idea what the PREFIX argument in the CMakeLists.txt is). This does need an overhaul.

This revision is now accepted and ready to land.Jun 1 2021, 5:09 PM
This revision was automatically updated to reflect the committed changes.
SingleSource/UnitTests/CMakeLists.txt