aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-09 15:00:46 -0500
committerGitHub <noreply@github.com>2016-11-09 15:00:46 -0500
commitdc10945ad7cd210426091a9e7809c90a9ff0b175 (patch)
treeae9c7139555c1dda1a41946496ae13ab6303adba /run_project_tests.py
parent5603f90287695fc6e092f2701ec222e4fddc3899 (diff)
parentdaa893e0119f972eae1b55db6e5f4a61799fdd93 (diff)
downloadmeson-dc10945ad7cd210426091a9e7809c90a9ff0b175.zip
meson-dc10945ad7cd210426091a9e7809c90a9ff0b175.tar.gz
meson-dc10945ad7cd210426091a9e7809c90a9ff0b175.tar.bz2
Merge pull request #995 from centricular/more-appveyor-builds
appveyor.yml: Test more than just MSVC2010 + Ninja on x86
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py55
1 files changed, 46 insertions, 9 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index b70fecc..15d656b 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -326,6 +326,28 @@ def have_d_compiler():
return True
return False
+def have_java():
+ if shutil.which('javac') and shutil.which('java'):
+ return True
+ return False
+
+def using_backend(backends):
+ if isinstance(backends, str):
+ backends = (backends,)
+ for backend in backends:
+ if backend == 'ninja':
+ if not backend_flags:
+ return True
+ elif backend == 'xcode':
+ if backend_flags == '--backend=xcode':
+ return True
+ elif backend == 'vs':
+ if backend_flags.startswith('--backend=vs'):
+ return True
+ else:
+ raise AssertionError('Unknown backend type: ' + backend)
+ return False
+
def detect_tests_to_run():
all_tests = []
all_tests.append(('common', gather_tests('test cases/common'), False))
@@ -338,15 +360,15 @@ def detect_tests_to_run():
all_tests.append(('platform-windows', gather_tests('test cases/windows'), False if mesonlib.is_windows() else True))
all_tests.append(('platform-linux', gather_tests('test cases/linuxlike'), False if not (mesonlib.is_osx() or mesonlib.is_windows()) else True))
all_tests.append(('framework', gather_tests('test cases/frameworks'), False if not mesonlib.is_osx() and not mesonlib.is_windows() else True))
- all_tests.append(('java', gather_tests('test cases/java'), False if not mesonlib.is_osx() and shutil.which('javac') and shutil.which('java') else True))
- all_tests.append(('C#', gather_tests('test cases/csharp'), False if shutil.which('mcs') else True))
- all_tests.append(('vala', gather_tests('test cases/vala'), False if shutil.which('valac') else True))
- all_tests.append(('rust', gather_tests('test cases/rust'), False if shutil.which('rustc') else True))
- all_tests.append(('d', gather_tests('test cases/d'), False if have_d_compiler() else True))
- all_tests.append(('objective c', gather_tests('test cases/objc'), False if not mesonlib.is_windows() else True))
- all_tests.append(('fortran', gather_tests('test cases/fortran'), False if shutil.which('gfortran') else True))
- all_tests.append(('swift', gather_tests('test cases/swift'), False if shutil.which('swiftc') else True))
- all_tests.append(('python3', gather_tests('test cases/python3'), False if shutil.which('python3') else True))
+ all_tests.append(('java', gather_tests('test cases/java'), False if using_backend('ninja') and not mesonlib.is_osx() and have_java() else True))
+ all_tests.append(('C#', gather_tests('test cases/csharp'), False if using_backend('ninja') and shutil.which('mcs') else True))
+ all_tests.append(('vala', gather_tests('test cases/vala'), False if using_backend('ninja') and shutil.which('valac') else True))
+ all_tests.append(('rust', gather_tests('test cases/rust'), False if using_backend('ninja') and shutil.which('rustc') else True))
+ all_tests.append(('d', gather_tests('test cases/d'), False if using_backend('ninja') and have_d_compiler() else True))
+ all_tests.append(('objective c', gather_tests('test cases/objc'), False if using_backend(('ninja', 'xcode')) and not mesonlib.is_windows() else True))
+ all_tests.append(('fortran', gather_tests('test cases/fortran'), False if using_backend('ninja') and shutil.which('gfortran') else True))
+ all_tests.append(('swift', gather_tests('test cases/swift'), False if using_backend(('ninja', 'xcode')) and shutil.which('swiftc') else True))
+ all_tests.append(('python3', gather_tests('test cases/python3'), False if using_backend('ninja') and shutil.which('python3') else True))
return all_tests
def run_tests(extra_args):
@@ -490,6 +512,21 @@ if __name__ == '__main__':
options = parser.parse_args()
setup_commands(options.backend)
+ # Appveyor sets the `platform` environment variable which completely messes
+ # up building with the vs2010 and vs2015 backends.
+ #
+ # Specifically, MSBuild reads the `platform` environment variable to set
+ # the configured value for the platform (Win32/x64/arm), which breaks x86
+ # builds.
+ #
+ # Appveyor setting this also breaks our 'native build arch' detection for
+ # Windows in environment.py:detect_windows_arch() by overwriting the value
+ # of `platform` set by vcvarsall.bat.
+ #
+ # While building for x86, `platform` should be unset.
+ if 'APPVEYOR' in os.environ and os.environ['arch'] == 'x86':
+ os.environ.pop('platform')
+
script_dir = os.path.split(__file__)[0]
if script_dir != '':
os.chdir(script_dir)