aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-07-23 13:01:29 +0300
committerGitHub <noreply@github.com>2020-07-23 13:01:29 +0300
commit18aff92d7a9f110cc3c790c61c2ced85b8d81a26 (patch)
treeceae5df73681a1d844f49d283522d438fc3612f8 /run_unittests.py
parent587e159d6c96afd5ff32871e8ff99699b95f2802 (diff)
parent393d6e133d9abd584a2fc414971628e84ea48b7c (diff)
downloadmeson-18aff92d7a9f110cc3c790c61c2ced85b8d81a26.zip
meson-18aff92d7a9f110cc3c790c61c2ced85b8d81a26.tar.gz
meson-18aff92d7a9f110cc3c790c61c2ced85b8d81a26.tar.bz2
Merge pull request #7461 from mensinda/noMoreSetuptools
Remove the setuptools dependency with mesondata.py
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index ff6bb9c..fac0f50 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1485,6 +1485,38 @@ class DataTests(unittest.TestCase):
astint = AstInterpreter('.', '', '')
self.assertEqual(set(interp.funcs.keys()), set(astint.funcs.keys()))
+ def test_mesondata_is_up_to_date(self):
+ from mesonbuild.mesondata import mesondata
+ err_msg = textwrap.dedent('''
+
+ ###########################################################
+ ### mesonbuild.mesondata is not up-to-date ###
+ ### Please regenerate it by running tools/gen_data.py ###
+ ###########################################################
+
+ ''')
+
+ root_dir = Path(__file__).resolve().parent
+ mesonbuild_dir = root_dir / 'mesonbuild'
+
+ data_dirs = mesonbuild_dir.glob('**/data')
+ data_files = [] # type: T.List[T.Tuple(str, str)]
+
+ for i in data_dirs:
+ for p in i.iterdir():
+ data_files += [(p.relative_to(mesonbuild_dir).as_posix(), hashlib.sha256(p.read_bytes()).hexdigest())]
+
+ from pprint import pprint
+ current_files = set(mesondata.keys())
+ scanned_files = set([x[0] for x in data_files])
+
+ self.assertSetEqual(current_files, scanned_files, err_msg + 'Data files were added or removed\n')
+ errors = []
+ for i in data_files:
+ if mesondata[i[0]].sha256sum != i[1]:
+ errors += [i[0]]
+
+ self.assertListEqual(errors, [], err_msg + 'Files were changed')
class BasePlatformTests(unittest.TestCase):
prefix = '/usr'