aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-10-31 20:23:23 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-01-10 18:36:57 -0500
commit140097faf0eddcc7819a3353eb7c21b82a7df1e0 (patch)
treeb70acd7f70f5431a06db73f3db23f86ff896c3b3 /unittests
parentbe6e09bfdb5c911eecbc976ed71d427f052a1b81 (diff)
downloadmeson-140097faf0eddcc7819a3353eb7c21b82a7df1e0.zip
meson-140097faf0eddcc7819a3353eb7c21b82a7df1e0.tar.gz
meson-140097faf0eddcc7819a3353eb7c21b82a7df1e0.tar.bz2
port from embedded data to importlib.resources
Diffstat (limited to 'unittests')
-rw-r--r--unittests/datatests.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/unittests/datatests.py b/unittests/datatests.py
index e440243..b623f1f 100644
--- a/unittests/datatests.py
+++ b/unittests/datatests.py
@@ -13,12 +13,9 @@
# limitations under the License.
import re
-import textwrap
import unittest
-import hashlib
from itertools import chain
from pathlib import Path
-import typing as T
import mesonbuild.mlog
import mesonbuild.depfile
@@ -237,36 +234,3 @@ class DataTests(unittest.TestCase):
interp = Interpreter(FakeBuild(env), mock=True)
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__).parents[1]
-
- 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())]
-
- current_files = set(mesondata.keys())
- scanned_files = {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')