summaryrefslogtreecommitdiff
path: root/unittests/allplatformstests.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-03-07 15:48:51 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-04-03 12:27:07 -0700
commit3996272ca7eabcc9bf6efdabb9abd33727d678f9 (patch)
treeef5ae8a250c5c6aeefe587fa8564f47acbbde372 /unittests/allplatformstests.py
parent2b2d075b95cf11480113fefc272b625204e9dc11 (diff)
downloadmeson-3996272ca7eabcc9bf6efdabb9abd33727d678f9.tar.gz
tests: our fortran order deps are wrong if a new module is introduced
Because we don't set the appropriate dependencies
Diffstat (limited to 'unittests/allplatformstests.py')
-rw-r--r--unittests/allplatformstests.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 34bdf8649..1feffcec2 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -5224,3 +5224,43 @@ class AllPlatformTests(BasePlatformTests):
output = entry['output']
self.build(output, extra_args=['-j1'])
+
+ @expectedFailure
+ @skip_if_not_language('fortran')
+ def test_fortran_new_module_in_dep(self) -> None:
+ if self.backend is not Backend.ninja:
+ raise SkipTest('Test is only relavent on the ninja backend')
+ testdir = self.copy_srcdir(os.path.join(self.fortran_test_dir, '8 module names'))
+ self.init(testdir, extra_args=['-Dunittest=true'])
+ self.build()
+
+ with open(os.path.join(testdir, 'mod1.f90'), 'a', encoding='utf-8') as f:
+ f.write(textwrap.dedent("""\
+ module MyMod3
+ implicit none
+
+ integer, parameter :: myModVal3 =1
+
+ end module MyMod3
+ """))
+
+ with open(os.path.join(testdir, 'test.f90'), 'w', encoding='utf-8') as f:
+ f.write(textwrap.dedent("""\
+ program main
+ use MyMod2
+ use MyMod3
+ implicit none
+
+ call showvalues()
+ print*, "MyModValu3 = ", myModVal3
+
+ end program
+ """))
+
+ # Find the correct output to compile, regardless of what compiler is being used
+ comp = self.get_compdb()
+ entry = first(comp, lambda e: e['file'].endswith('lib.f90'))
+ assert entry is not None, 'for mypy'
+ output = entry['output']
+
+ self.build(output, extra_args=['-j1'])