diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-17 19:44:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-03-19 23:21:56 +0200 |
commit | cf5f1a83d55d05412e29058844e4fda5e420553b (patch) | |
tree | e91004bd2d8b468140c8d4df012d0c214acfa0a9 /run_unittests.py | |
parent | c385f7973777e0e7b7e4694d69d6584e2ceae69f (diff) | |
download | meson-cf5f1a83d55d05412e29058844e4fda5e420553b.zip meson-cf5f1a83d55d05412e29058844e4fda5e420553b.tar.gz meson-cf5f1a83d55d05412e29058844e4fda5e420553b.tar.bz2 |
Fix existing tests.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py index 44d5c9d..d528717 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -510,7 +510,8 @@ class BasePlatformTests(unittest.TestCase): windows_proof_rmtree(path) except FileNotFoundError: pass - os.environ = self.orig_env + os.environ.clear() + os.environ.update(self.orig_env) super().tearDown() def _run(self, command, workdir=None): @@ -2717,6 +2718,10 @@ endian = 'little' def test_pkgconfig_usage(self): testdir1 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependency') testdir2 = os.path.join(self.unit_test_dir, '24 pkgconfig usage/dependee') + if subprocess.call(['pkg-config', '--cflags', 'glib-2.0'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) != 0: + raise unittest.SkipTest('Glib 2.0 dependency not available.') with tempfile.TemporaryDirectory() as tempdirname: self.init(testdir1, ['--prefix=' + tempdirname, '--libdir=lib'], default_args=False) self.install(use_destdir=False) @@ -2737,8 +2742,10 @@ endian = 'little' self.build() myenv = os.environ.copy() myenv['LD_LIBRARY_PATH'] = lib_dir + if is_cygwin(): + bin_dir = os.path.join(tempdirname, 'bin') + myenv['PATH'] = bin_dir + os.pathsep + myenv['PATH'] self.assertTrue(os.path.isdir(lib_dir)) - self.assertTrue(os.path.isfile(os.path.join(lib_dir, 'libpkgdep.so'))) test_exe = os.path.join(self.builddir, 'pkguser') self.assertTrue(os.path.isfile(test_exe)) subprocess.check_call(test_exe, env=myenv) |