tests: Check that run_target can find a files() argument

Tests https://github.com/mesonbuild/meson/issues/957
pull/1011/head
Nirbheek Chauhan 8 years ago
parent 87f07cdf3d
commit 66ec8c4258
  1. 8
      run_unittests.py
  2. 7
      test cases/common/58 run target/check_exists.py
  3. 4
      test cases/common/58 run target/meson.build

@ -73,6 +73,9 @@ class LinuxlikeTests(unittest.TestCase):
def build(self):
self.output += subprocess.check_output(self.ninja_command)
def run_target(self, target):
self.output += subprocess.check_output(self.ninja_command + [target])
def setconf(self, arg):
self.output += subprocess.check_output(self.mconf_command + [arg, self.builddir])
@ -173,5 +176,10 @@ class LinuxlikeTests(unittest.TestCase):
self.assertEqual(intro[0]['install_filename'], '/usr/local/libtest/libstat.a')
self.assertEqual(intro[1]['install_filename'], '/usr/local/bin/prog')
def test_run_target_files_path(self):
testdir = os.path.join(self.common_test_dir, '58 run target')
self.init(testdir)
self.run_target('check_exists')
if __name__ == '__main__':
unittest.main()

@ -0,0 +1,7 @@
#!/usr/bin/env python
import os
import sys
if not os.path.isfile(sys.argv[1]):
raise Exception("Couldn't find {!r}".format(sys.argv[1]))

@ -35,8 +35,8 @@ python3 = find_program('python3')
run_target('py3hi',
command : [python3, '-c', 'print("I am Python3.")'])
run_target('ct_in_arg',
command : ['echo', hex, files('helloprinter.c')])
run_target('check_exists',
command : [find_program('check_exists.py'), files('helloprinter.c')])
# What if the output of a custom_target is the command to
# execute. Obviously this will not work as hex is not an

Loading…
Cancel
Save