Store all invocation output. Not shown to users yet.

pull/795/head
Jussi Pakkanen 8 years ago
parent c7936f6819
commit b11a5b93cb
  1. 10
      run_tests.py
  2. 9
      run_unittests.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)

@ -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')

Loading…
Cancel
Save