aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-04-13 23:27:40 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-04-17 12:48:54 +0300
commit0e47e74a77447575cbabd71315481c6dd9632601 (patch)
tree368de0c60806fdb1d1109aabdc7dc8abae0b9c6c /run_unittests.py
parent0e45134dee09b12005c028aee066b04ff86228e5 (diff)
downloadmeson-0e47e74a77447575cbabd71315481c6dd9632601.zip
meson-0e47e74a77447575cbabd71315481c6dd9632601.tar.gz
meson-0e47e74a77447575cbabd71315481c6dd9632601.tar.bz2
Do not obliterate old rpath because it might be used due to read only data sharing. Closes #1619.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index e8ecbb2..3e98c21 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1460,6 +1460,28 @@ class LinuxlikeTests(BasePlatformTests):
self.assertIn('-Werror', plain_comp)
self.assertNotIn('-Werror', c03_comp)
+ def test_run_installed(self):
+ testdir = os.path.join(self.unit_test_dir, '7 run installed')
+ self.init(testdir)
+ self.build()
+ self.install()
+ installed_exe = os.path.join(self.installdir, 'usr/bin/prog')
+ installed_libdir = os.path.join(self.installdir, 'usr/foo')
+ installed_lib = os.path.join(installed_libdir, 'libfoo.so')
+ self.assertTrue(os.path.isfile(installed_exe))
+ self.assertTrue(os.path.isdir(installed_libdir))
+ self.assertTrue(os.path.isfile(installed_lib))
+ # Must fail when run without LD_LIBRARY_PATH to ensure that
+ # rpath has been properly stripped rather than pointing to the builddir.
+ self.assertNotEqual(subprocess.call(installed_exe, stderr=subprocess.DEVNULL), 0)
+ # When LD_LIBRARY_PATH is set it should start working.
+ # For some reason setting LD_LIBRARY_PATH in os.environ fails
+ # when all tests are run (but works when only this test is run),
+ # but doing this explicitly works.
+ env = os.environ.copy()
+ env['LD_LIBRARY_PATH'] = installed_libdir
+ self.assertEqual(subprocess.call(installed_exe, env=env), 0)
+
class RewriterTests(unittest.TestCase):
def setUp(self):