aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-10-01 11:02:50 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-05-18 13:53:58 -0700
commitcb6662b57299c3644719593115b2ffb828679c36 (patch)
tree27d15098799552bb16c501eafa7d4e5c807111fe /test cases
parente822889754a3f9ba1a1c9d9179dd24d102db3969 (diff)
downloadmeson-cb6662b57299c3644719593115b2ffb828679c36.zip
meson-cb6662b57299c3644719593115b2ffb828679c36.tar.gz
meson-cb6662b57299c3644719593115b2ffb828679c36.tar.bz2
backends: ensure that test executables can be run when passed as arguments
If an executable is passed as an argument to a script in the build directory that it resides in then it will not execute (on *nix) due to a lack of ./. Ie, `foo` must be called as `./foo`. If it is called from a different directory it will work. Ie `../foo` or `bar/foo`. Fixes #5984
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/71 cross test passed/meson.build12
-rw-r--r--test cases/unit/71 cross test passed/script.py7
-rw-r--r--test cases/unit/71 cross test passed/src/main.c6
3 files changed, 25 insertions, 0 deletions
diff --git a/test cases/unit/71 cross test passed/meson.build b/test cases/unit/71 cross test passed/meson.build
new file mode 100644
index 0000000..cb3bb6d
--- /dev/null
+++ b/test cases/unit/71 cross test passed/meson.build
@@ -0,0 +1,12 @@
+project(
+ 'cross test passed',
+ 'c',
+ version : '>= 0.51'
+)
+
+e = executable('exec', 'src/main.c')
+
+py = import('python').find_installation()
+
+test('root', e)
+test('main', py, args : [meson.current_source_dir() / 'script.py', e])
diff --git a/test cases/unit/71 cross test passed/script.py b/test cases/unit/71 cross test passed/script.py
new file mode 100644
index 0000000..257cd30
--- /dev/null
+++ b/test cases/unit/71 cross test passed/script.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python3
+
+import subprocess
+import sys
+
+if __name__ == "__main__":
+ sys.exit(subprocess.run(sys.argv[1:]).returncode)
diff --git a/test cases/unit/71 cross test passed/src/main.c b/test cases/unit/71 cross test passed/src/main.c
new file mode 100644
index 0000000..490b4a6
--- /dev/null
+++ b/test cases/unit/71 cross test passed/src/main.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(int argc, char const *argv[])
+{
+ return 0;
+}