aboutsummaryrefslogtreecommitdiff
path: root/test cases/linuxlike
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-04-21 03:04:25 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-04-21 03:04:25 +0300
commite43c9d96d1f90792a65457f94f8dbf58c2e475b3 (patch)
tree80de9673ece75e8bc28c35984c0905bad5047d7c /test cases/linuxlike
parentdc2044c56d51c36a88f5a23b7275c4eabd0e88aa (diff)
downloadmeson-e43c9d96d1f90792a65457f94f8dbf58c2e475b3.zip
meson-e43c9d96d1f90792a65457f94f8dbf58c2e475b3.tar.gz
meson-e43c9d96d1f90792a65457f94f8dbf58c2e475b3.tar.bz2
Make it work on Cygwin.
Diffstat (limited to 'test cases/linuxlike')
-rw-r--r--test cases/linuxlike/14 static dynamic linkage/meson.build8
-rwxr-xr-xtest cases/linuxlike/14 static dynamic linkage/verify_static.py25
2 files changed, 24 insertions, 9 deletions
diff --git a/test cases/linuxlike/14 static dynamic linkage/meson.build b/test cases/linuxlike/14 static dynamic linkage/meson.build
index fc3c38a..a529f33 100644
--- a/test cases/linuxlike/14 static dynamic linkage/meson.build
+++ b/test cases/linuxlike/14 static dynamic linkage/meson.build
@@ -15,6 +15,8 @@ test('test default', exe_default)
test('test static', exe_static)
test('test dynamic', exe_dynamic)
-test('verify static linking', find_program('verify_static.py'), args:exe_static.full_path())
-test('verify dynamic linking', find_program('verify_static.py'), args:exe_dynamic.full_path(),
- should_fail: true)
+test('verify static linking', find_program('verify_static.py'),
+ args: ['--platform=' + host_machine.system(), exe_static.full_path()])
+test('verify dynamic linking', find_program('verify_static.py'),
+ args: ['--platform=' + host_machine.system(), exe_dynamic.full_path()],
+ should_fail: true)
diff --git a/test cases/linuxlike/14 static dynamic linkage/verify_static.py b/test cases/linuxlike/14 static dynamic linkage/verify_static.py
index 92cc308..66bf08b 100755
--- a/test cases/linuxlike/14 static dynamic linkage/verify_static.py
+++ b/test cases/linuxlike/14 static dynamic linkage/verify_static.py
@@ -3,14 +3,27 @@
import subprocess
import sys
+def handle_common(path):
+ """Handle the common case."""
+ output = subprocess.check_output(['nm', path]).decode('utf-8')
+ if 'T zlibVersion' in output:
+ return 0
+ return 1
+
+def handle_cygwin(path):
+ """Handle the Cygwin case."""
+ output = subprocess.check_output(['nm', path]).decode('utf-8')
+ if 'I __imp_zlibVersion' in output:
+ return 1
+ return 0
+
def main():
"""Main function"""
- output = subprocess.check_output(['nm', sys.argv[1]]).decode('utf-8')
-
- if 'T zlibVersion' in output:
- sys.exit(0)
+ if len(sys.argv) > 2 and sys.argv[1] == '--platform=cygwin':
+ return handle_cygwin(sys.argv[2])
+ else:
+ return handle_common(sys.argv[2])
- sys.exit(1)
if __name__ == '__main__':
- main()
+ sys.exit(main())