aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/vs2010backend.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-01-27 23:26:48 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-01-28 01:05:21 +0530
commit2e3091244727f9b2450fcb074992a82bd5a534f1 (patch)
treefd7c8dd383a6d42a9a937fcd7adccd25566f4675 /mesonbuild/backend/vs2010backend.py
parentfc4e3326012aceeb3a1ef4a616e42e9cdfeadb9f (diff)
downloadmeson-2e3091244727f9b2450fcb074992a82bd5a534f1.zip
meson-2e3091244727f9b2450fcb074992a82bd5a534f1.tar.gz
meson-2e3091244727f9b2450fcb074992a82bd5a534f1.tar.bz2
vs: Fix running of tests to use mesontest.py
Back in November when this broke, we didn't notice because our tests are run in-process, so we don't check that `msbuild RUN_TESTS.vcxproj` and `ninja test` actually work. Now we do.
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r--mesonbuild/backend/vs2010backend.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 385bb63..d129ab4 100644
--- a/mesonbuild/backend/vs2010backend.py
+++ b/mesonbuild/backend/vs2010backend.py
@@ -1066,12 +1066,19 @@ if %%errorlevel%% neq 0 goto :VCEnd'''
ET.SubElement(midl, 'ProxyFileName').text = '%(Filename)_p.c'
postbuild = ET.SubElement(action, 'PostBuildEvent')
ET.SubElement(postbuild, 'Message')
+ # FIXME: No benchmarks?
+ meson_py = self.environment.get_build_command()
+ (base, ext) = os.path.splitext(meson_py)
+ mesontest_py = base + 'test' + ext
test_command = [sys.executable,
- self.environment.get_build_command(),
- '--internal',
- 'test']
+ mesontest_py,
+ '--no-rebuild']
+ if not self.environment.coredata.get_builtin_option('stdsplit'):
+ test_command += ['--no-stdsplit']
+ if self.environment.coredata.get_builtin_option('errorlogs'):
+ test_command += ['--print-errorlogs']
cmd_templ = '''setlocal
-"%s" "%s"
+"%s"
if %%errorlevel%% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone
@@ -1079,9 +1086,9 @@ endlocal & call :cmErrorLevel %%errorlevel%% & goto :cmDone
exit /b %%1
:cmDone
if %%errorlevel%% neq 0 goto :VCEnd'''
- test_data = self.serialise_tests()[0]
+ self.serialise_tests()
ET.SubElement(postbuild, 'Command').text =\
- cmd_templ % ('" "'.join(test_command), test_data)
+ cmd_templ % ('" "'.join(test_command))
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.targets')
tree = ET.ElementTree(root)
tree.write(ofname, encoding='utf-8', xml_declaration=True)