aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-04-08 09:17:19 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-04-09 23:11:36 +0530
commitf80d471345e0ece943819ae79e4d85e645e2d1a7 (patch)
tree96e62ca69379fc275e03566bc937c6923b006b62 /run_project_tests.py
parenta331bf1162030c9aedc3b9ad33350fe28b7c35db (diff)
downloadmeson-f80d471345e0ece943819ae79e4d85e645e2d1a7.zip
meson-f80d471345e0ece943819ae79e4d85e645e2d1a7.tar.gz
meson-f80d471345e0ece943819ae79e4d85e645e2d1a7.tar.bz2
unit tests: Fix running specific targets with MSBuild
/t:targetname syntax doesn't work, but running the vcxproj does work Also use the Backend enum everywhere.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 51ab560..1a16880 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -34,7 +34,7 @@ import multiprocessing
import concurrent.futures as conc
import re
-from run_tests import get_backend_commands, get_backend_args_for_dir
+from run_tests import get_backend_commands, get_backend_args_for_dir, Backend
class BuildStep(Enum):
@@ -174,10 +174,13 @@ def setup_commands(optbackend):
# Set backend arguments for Meson
if backend.startswith('vs'):
backend_flags = ['--backend=' + backend]
+ backend = Backend.vs
elif backend == 'xcode':
backend_flags = ['--backend=xcode']
+ backend = Backend.xcode
elif backend == 'ninja':
backend_flags = ['--backend=ninja']
+ backend = Backend.ninja
else:
raise RuntimeError('Unknown backend: {!r}'.format(backend))
compile_commands, clean_commands, test_commands, install_commands, \
@@ -419,15 +422,15 @@ def detect_tests_to_run():
all_tests.append(('platform-windows', gather_tests('test cases/windows'), False if mesonlib.is_windows() or mesonlib.is_cygwin() 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() and not mesonlib.is_cygwin() else True))
- all_tests.append(('java', gather_tests('test cases/java'), False if backend == 'ninja' and not mesonlib.is_osx() and have_java() else True))
- all_tests.append(('C#', gather_tests('test cases/csharp'), False if backend == 'ninja' and shutil.which('mcs') else True))
- all_tests.append(('vala', gather_tests('test cases/vala'), False if backend == 'ninja' and shutil.which('valac') else True))
- all_tests.append(('rust', gather_tests('test cases/rust'), False if backend == 'ninja' and shutil.which('rustc') else True))
- all_tests.append(('d', gather_tests('test cases/d'), False if backend == 'ninja' and have_d_compiler() else True))
- all_tests.append(('objective c', gather_tests('test cases/objc'), False if backend in ('ninja', 'xcode') and not mesonlib.is_windows() else True))
- all_tests.append(('fortran', gather_tests('test cases/fortran'), False if backend == 'ninja' and shutil.which('gfortran') else True))
- all_tests.append(('swift', gather_tests('test cases/swift'), False if backend in ('ninja', 'xcode') and shutil.which('swiftc') else True))
- all_tests.append(('python3', gather_tests('test cases/python3'), False if backend == 'ninja' and shutil.which('python3') else True))
+ all_tests.append(('java', gather_tests('test cases/java'), False if backend is Backend.ninja and not mesonlib.is_osx() and have_java() else True))
+ all_tests.append(('C#', gather_tests('test cases/csharp'), False if backend is Backend.ninja and shutil.which('mcs') else True))
+ all_tests.append(('vala', gather_tests('test cases/vala'), False if backend is Backend.ninja and shutil.which('valac') else True))
+ all_tests.append(('rust', gather_tests('test cases/rust'), False if backend is Backend.ninja and shutil.which('rustc') else True))
+ all_tests.append(('d', gather_tests('test cases/d'), False if backend is Backend.ninja and have_d_compiler() else True))
+ all_tests.append(('objective c', gather_tests('test cases/objc'), False if backend in (Backend.ninja, Backend.xcode) and not mesonlib.is_windows() else True))
+ all_tests.append(('fortran', gather_tests('test cases/fortran'), False if backend is Backend.ninja and shutil.which('gfortran') else True))
+ all_tests.append(('swift', gather_tests('test cases/swift'), False if backend in (Backend.ninja, Backend.xcode) and shutil.which('swiftc') else True))
+ all_tests.append(('python3', gather_tests('test cases/python3'), False if backend is Backend.ninja and shutil.which('python3') else True))
return all_tests
def run_tests(all_tests, log_name_base, extra_args):