[flang][driver] Refine tests for module search directories
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 9 Mar 2021 14:20:43 +0000 (14:20 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 9 Mar 2021 15:26:48 +0000 (15:26 +0000)
commitb04fbc191325a0fc07eb6882f5ab85123b6dc165
tree2a260cb72c773b7fd461fc81874c6e064fb10b95
parent8d632ca4365519b38004d083301abf385ce87358
[flang][driver] Refine tests for module search directories

This patch refactors include-module.f90:
  * rename the test file as use-module.f90 to better highlight which
  driver feature is being tested
  * move tests for diagnostics to use-module-error.f90 (it tests that
  `-J/-module-dir` can only be used once)
  * make sure that `f18` is tested when `FLANG_BUILD_NEW_DRIVER` is
  set to `Off`
  * add tests for when all module files are successfully discovered and
  loaded

With this patch, there should be a clear separation into 3 scenarios in
use-module.f90:
  * Everything is OK
  * One module file wasn't found (missing include path for
  basictestingmoduletwo.mod)
  * Two module files are found, but the test requires
  `basictestingmoduleone.mod` from both `Inputs` and `Inputs/module-dir`.
  Only the latter is found.

Reviewed By: tskeith

Differential Revision: https://reviews.llvm.org/D97197
flang/test/Flang-Driver/Inputs/module-dir/basictestmoduleone.mod
flang/test/Flang-Driver/Inputs/module-dir/basictestmoduletwo.mod
flang/test/Flang-Driver/include-module.f90 [deleted file]
flang/test/Flang-Driver/use-module-error.f90 [new file with mode: 0644]
flang/test/Flang-Driver/use-module.f90 [new file with mode: 0644]