aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-10-07 20:41:36 +0300
committerGitHub <noreply@github.com>2016-10-07 20:41:36 +0300
commit3a12b7ef52083d6f5bd18b4dfcf56b8d3480a508 (patch)
tree9a6c64447a5f33484ec54dfcdb8543736915af05
parent71eddecdc7e82b16c5e454137d641f2a5f7c9c94 (diff)
parent81423270f58369de1b033bfcff52e889219e88ac (diff)
downloadmeson-3a12b7ef52083d6f5bd18b4dfcf56b8d3480a508.zip
meson-3a12b7ef52083d6f5bd18b4dfcf56b8d3480a508.tar.gz
meson-3a12b7ef52083d6f5bd18b4dfcf56b8d3480a508.tar.bz2
Merge pull request #863 from centricular/fix-swift-tests-sdkroot
Fix Swift tests by defining SDKROOT
-rw-r--r--.travis.yml2
-rwxr-xr-xrun_tests.py6
-rw-r--r--test cases/swift/2 multifile/main.swift4
3 files changed, 9 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml
index 2564742..9b4e0a1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -23,4 +23,4 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit .; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "cd /root && ./run_tests.py"; fi
- - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./run_tests.py --backend=ninja ; fi
+ - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) ./run_tests.py --backend=ninja ; fi
diff --git a/run_tests.py b/run_tests.py
index b57dd39..1e094ad 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -68,6 +68,7 @@ failing_tests = 0
skipped_tests = 0
failing_logs = []
print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
+do_debug = not {'MESON_PRINT_TEST_OUTPUT', 'TRAVIS', 'APPVEYOR'}.isdisjoint(os.environ)
meson_command = os.path.join(os.getcwd(), 'meson')
if not os.path.exists(meson_command):
@@ -117,7 +118,7 @@ def setup_commands(backend):
ninja_command = environment.detect_ninja()
if ninja_command is None:
raise RuntimeError('Could not find Ninja v1.6 or newer')
- if print_debug:
+ if do_debug:
compile_commands = [ninja_command, '-v']
else:
compile_commands = [ninja_command]
@@ -378,7 +379,8 @@ def run_tests(extra_args):
print('Failed test%s: %s' % (without_install, t))
print('Reason:', result.msg)
failing_tests += 1
- failing_logs.append(result.mlog)
+ failing_logs.append(result.stdo)
+ failing_logs.append(result.stde)
else:
print('Succeeded test%s: %s' % (without_install, t))
passing_tests += 1
diff --git a/test cases/swift/2 multifile/main.swift b/test cases/swift/2 multifile/main.swift
index 8f39ba6..9867e85 100644
--- a/test cases/swift/2 multifile/main.swift
+++ b/test cases/swift/2 multifile/main.swift
@@ -1 +1,5 @@
+#if swift(>=3.0)
printSomething(text:"String from main")
+#else
+printSomething("String from main")
+#endif