aboutsummaryrefslogtreecommitdiff
path: root/test cases/windows/9 find program
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-07 17:22:18 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-18 02:38:54 +0530
commit18bce476913de4deec18fcd028cb59d378c43812 (patch)
treee0c561119bc89ea4b98ffc6641a5028aa20556fc /test cases/windows/9 find program
parentd5b494492481a4379174786237cbc4d7eb037373 (diff)
downloadmeson-18bce476913de4deec18fcd028cb59d378c43812.zip
meson-18bce476913de4deec18fcd028cb59d378c43812.tar.gz
meson-18bce476913de4deec18fcd028cb59d378c43812.tar.bz2
find_program: Correctly use scripts found in PATH
We also need to check whether the program found in PATH can be executed directly by Windows or if we need to figure out what the interpreter is and add it to the list. Also add `msc` to the list of extensions that can be executed natively Includes a project test and a unit test for this and all expected behaviours on Windows.
Diffstat (limited to 'test cases/windows/9 find program')
-rw-r--r--test cases/windows/9 find program/meson.build8
-rw-r--r--test cases/windows/9 find program/test-script-ext.py3
2 files changed, 11 insertions, 0 deletions
diff --git a/test cases/windows/9 find program/meson.build b/test cases/windows/9 find program/meson.build
index ef34586..565fb62 100644
--- a/test cases/windows/9 find program/meson.build
+++ b/test cases/windows/9 find program/meson.build
@@ -1,4 +1,12 @@
project('find program', 'c')
+# Test that we can find native windows executables
+find_program('cmd')
+find_program('cmd.exe')
+
+# Test that a script file with an extension can be found
+ext = find_program('test-script-ext.py')
+test('ext', ext)
+# Test that a script file without an extension can be found
prog = find_program('test-script')
test('script', prog)
diff --git a/test cases/windows/9 find program/test-script-ext.py b/test cases/windows/9 find program/test-script-ext.py
new file mode 100644
index 0000000..ae9adfb
--- /dev/null
+++ b/test cases/windows/9 find program/test-script-ext.py
@@ -0,0 +1,3 @@
+#!/usr/bin/env python3
+
+print('ext/noext')