aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun_tests.py10
-rwxr-xr-xrun_unittests.py9
2 files changed, 12 insertions, 7 deletions
diff --git a/run_tests.py b/run_tests.py
index a01118a..e8b0c8f 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -19,13 +19,17 @@ import shutil
from mesonbuild import mesonlib
if __name__ == '__main__':
+ returncode = 0
if mesonlib.is_linux():
myenv = os.environ.copy()
myenv['CC'] = 'gcc'
myenv['CXX'] = 'g++'
- subprocess.call([sys.executable, 'run_unittests.py'], env=myenv)
+ print('Running unittests with GCC.\n')
+ returncode += subprocess.call([sys.executable, 'run_unittests.py'], env=myenv)
if shutil.which('clang'):
myenv['CC'] = 'clang'
myenv['CXX'] = 'clang++'
- subprocess.call([sys.executable, 'run_unittests.py'], env=myenv)
- subprocess.call([sys.executable, 'run_project_tests.py'])
+ print("'\nRunnint unittests with clang.\n")
+ returncode += subprocess.call([sys.executable, 'run_unittests.py'], env=myenv)
+ returncode += subprocess.call([sys.executable, 'run_project_tests.py'])
+ sys.exit(returncode)
diff --git a/run_unittests.py b/run_unittests.py
index 10c4242..dc07fc5 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -36,6 +36,7 @@ class LinuxlikeTests(unittest.TestCase):
self.ninja_command = ['ninja', '-C', self.builddir]
self.common_test_dir = os.path.join(src_root, 'test cases/common')
os.mkdir(self.builddir)
+ self.output = b''
def tearDown(self):
shutil.rmtree(self.builddir)
@@ -43,16 +44,16 @@ class LinuxlikeTests(unittest.TestCase):
def test_basic_soname(self):
testdir = os.path.join(self.common_test_dir, '4 shared')
- subprocess.check_call(self.meson_command + [testdir, self.builddir])
- subprocess.check_call(self.ninja_command)
+ self.output += subprocess.check_output(self.meson_command + [testdir, self.builddir])
+ self.output += subprocess.check_output(self.ninja_command)
lib1 = os.path.join(self.builddir, 'libmylib.so')
soname = get_soname(lib1)
self.assertEqual(soname, b'libmylib.so')
def test_custom_soname(self):
testdir = os.path.join(self.common_test_dir, '27 library versions')
- subprocess.check_call(self.meson_command + [testdir, self.builddir])
- subprocess.check_call(self.ninja_command)
+ self.output += subprocess.check_output(self.meson_command + [testdir, self.builddir])
+ self.output += subprocess.check_output(self.ninja_command)
lib1 = os.path.join(self.builddir, 'prefixsomelib.suffix')
soname = get_soname(lib1)
self.assertEqual(soname, b'prefixsomelib.suffix')