aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorMihailJP <mihailjp@gmail.com>2024-11-10 19:21:36 +0900
committerEli Schwartz <eschwartz93@gmail.com>2024-11-19 10:55:34 -0500
commit93f59313e10090bfe6058fabbb235aa549f933c0 (patch)
tree178145f5c97ebf4f99e2d0444583863fe19b167b /test cases/common
parent3c38e4720f7df0a9d0138363a9a995b31e848401 (diff)
downloadmeson-93f59313e10090bfe6058fabbb235aa549f933c0.zip
meson-93f59313e10090bfe6058fabbb235aa549f933c0.tar.gz
meson-93f59313e10090bfe6058fabbb235aa549f933c0.tar.bz2
check if test 33 running under MinGW
Diffstat (limited to 'test cases/common')
-rwxr-xr-xtest cases/common/33 run program/check-mingw.py10
-rw-r--r--test cases/common/33 run program/meson.build7
2 files changed, 15 insertions, 2 deletions
diff --git a/test cases/common/33 run program/check-mingw.py b/test cases/common/33 run program/check-mingw.py
new file mode 100755
index 0000000..f10c28b
--- /dev/null
+++ b/test cases/common/33 run program/check-mingw.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+
+import os, sys, re
+
+if 'MSYSTEM' in os.environ and os.environ['MSYSTEM'] != '':
+ print(os.environ['MSYSTEM'])
+else:
+ match = re.search(r'[\\/](mingw32|mingw64|clang32|clang64|clangarm64|ucrt64)[\\/]', sys.executable, flags=re.IGNORECASE)
+ if match:
+ print(match.group(1).upper())
diff --git a/test cases/common/33 run program/meson.build b/test cases/common/33 run program/meson.build
index 2257d93..1cd5305 100644
--- a/test cases/common/33 run program/meson.build
+++ b/test cases/common/33 run program/meson.build
@@ -1,6 +1,9 @@
project('run command', version : run_command('get-version.py', check : true).stdout().strip(), meson_version: '>=0.1.0')
-if build_machine.system() == 'windows'
+check_mingw = run_command('check-mingw.py', check : true).stdout().strip()
+is_mingw = not (check_mingw == '' or check_mingw == 'MSYS')
+
+if build_machine.system() == 'windows' and not is_mingw
c = run_command('cmd', '/c', 'echo', 'hello', check: false)
else
c = run_command('echo', 'hello', check: false)
@@ -45,7 +48,7 @@ endif
# We should be able to have files() in argument
f = files('meson.build')
-if build_machine.system() == 'windows'
+if build_machine.system() == 'windows' and not is_mingw
c = run_command('cmd', '/c', 'echo', f, check: false)
else
c = run_command('echo', f, check: false)