Add a test for deterministic exe-wrapper data file

https://github.com/mesonbuild/meson/issues/1062
pull/1263/head
Nirbheek Chauhan 8 years ago
parent b55235dfbd
commit 3445beb00b
  1. 16
      run_unittests.py

@ -84,6 +84,7 @@ class LinuxlikeTests(unittest.TestCase):
'--prefix', self.prefix,
'--libdir', self.libdir]
self._run(self.meson_command + args)
self.privatedir = os.path.join(self.builddir, 'meson-private')
def build(self):
self._run(self.ninja_command)
@ -101,6 +102,9 @@ class LinuxlikeTests(unittest.TestCase):
def setconf(self, arg):
self._run(self.mconf_command + [arg, self.builddir])
def wipe(self):
shutil.rmtree(self.builddir)
def get_compdb(self):
with open(os.path.join(self.builddir, 'compile_commands.json')) as ifile:
return json.load(ifile)
@ -183,7 +187,7 @@ class LinuxlikeTests(unittest.TestCase):
self.init(testdir)
env = FakeEnvironment()
kwargs = {'required': True, 'silent': True}
os.environ['PKG_CONFIG_LIBDIR'] = os.path.join(self.builddir, 'meson-private')
os.environ['PKG_CONFIG_LIBDIR'] = self.privatedir
simple_dep = PkgConfigDependency('libfoo', env, kwargs)
self.assertTrue(simple_dep.found())
self.assertEqual(simple_dep.get_version(), '1.0')
@ -374,6 +378,16 @@ class LinuxlikeTests(unittest.TestCase):
self.uninstall()
self.assertFalse(os.path.exists(exename))
def test_custom_target_exe_data_deterministic(self):
testdir = os.path.join(self.common_test_dir, '117 custom target capture')
self.init(testdir)
meson_exe_dat1 = glob(os.path.join(self.privatedir, 'meson_exe*.dat'))
self.wipe()
self.init(testdir)
meson_exe_dat2 = glob(os.path.join(self.privatedir, 'meson_exe*.dat'))
self.assertListEqual(meson_exe_dat1, meson_exe_dat2)
class RewriterTests(unittest.TestCase):
def setUp(self):

Loading…
Cancel
Save