run_unittests.py: Test that empty cdata subst are actually done

Improved test for https://github.com/mesonbuild/meson/issues/3826
This commit is contained in:
Nirbheek Chauhan 2018-07-05 02:55:11 +05:30 committed by Nirbheek Chauhan
parent 8e84b13850
commit 77d66fec4b
1 changed files with 4 additions and 0 deletions

View File

@ -2296,6 +2296,10 @@ recommended as it is not supported on some platforms''')
# No warnings about empty configuration data objects passed to files with substitutions
self.assertNotRegex(out, "WARNING:.*empty configuration_data.*nosubst-nocopy1.txt.in")
self.assertNotRegex(out, "WARNING:.*empty configuration_data.*nosubst-nocopy2.txt.in")
with open(os.path.join(self.builddir, 'nosubst-nocopy1.txt'), 'rb') as f:
self.assertEqual(f.read().strip(), b'/* #undef FOO_BAR */')
with open(os.path.join(self.builddir, 'nosubst-nocopy2.txt'), 'rb') as f:
self.assertEqual(f.read().strip(), b'')
class FailureTests(BasePlatformTests):