|
|
|
@ -57,6 +57,7 @@ class LinuxlikeTests(unittest.TestCase): |
|
|
|
|
src_root = os.path.dirname(__file__) |
|
|
|
|
src_root = os.path.join(os.getcwd(), src_root) |
|
|
|
|
self.builddir = tempfile.mkdtemp() |
|
|
|
|
self.logdir = os.path.join(self.builddir, 'meson-logs') |
|
|
|
|
self.prefix = '/usr' |
|
|
|
|
self.libdir = os.path.join(self.prefix, 'lib') |
|
|
|
|
self.installdir = os.path.join(self.builddir, 'install') |
|
|
|
@ -392,12 +393,22 @@ class LinuxlikeTests(unittest.TestCase): |
|
|
|
|
self.assertListEqual(meson_exe_dat1, meson_exe_dat2) |
|
|
|
|
|
|
|
|
|
def test_testsetups(self): |
|
|
|
|
if not shutil.which('valgrind'): |
|
|
|
|
raise unittest.SkipTest('Valgrind not installed.') |
|
|
|
|
testdir = os.path.join(self.unit_test_dir, '2 testsetups') |
|
|
|
|
self.init(testdir) |
|
|
|
|
self.build() |
|
|
|
|
self.run_tests() |
|
|
|
|
with open(os.path.join(self.logdir, 'testlog.txt')) as f: |
|
|
|
|
basic_log = f.read() |
|
|
|
|
self.assertRaises(subprocess.CalledProcessError, |
|
|
|
|
self._run, self.mtest_command + ['--setup=valgrind']) |
|
|
|
|
self._run, self.mtest_command + ['--setup=valgrind']) |
|
|
|
|
with open(os.path.join(self.logdir, 'testlog-valgrind.txt')) as f: |
|
|
|
|
vg_log = f.read() |
|
|
|
|
self.assertFalse('TEST_ENV is set' in basic_log) |
|
|
|
|
self.assertFalse('Memcheck' in basic_log) |
|
|
|
|
self.assertTrue('TEST_ENV is set' in vg_log) |
|
|
|
|
self.assertTrue('Memcheck' in vg_log) |
|
|
|
|
|
|
|
|
|
class RewriterTests(unittest.TestCase): |
|
|
|
|
|
|
|
|
|