mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 13:36:39 +00:00
validate:launcher: Cache the result of meson introspect
Running it takes quite some time and we can easily cache it.
This commit is contained in:
parent
a88156a416
commit
05ce6d3b92
1 changed files with 14 additions and 3 deletions
|
@ -106,10 +106,21 @@ class MesonTestsManager(TestsManager):
|
|||
mesontests = []
|
||||
for i, bdir in enumerate(self.options.meson_build_dirs):
|
||||
bdir = os.path.abspath(bdir)
|
||||
output = subprocess.check_output(
|
||||
[meson, 'introspect', '--tests', bdir])
|
||||
ninja_build = os.path.join(bdir, "build.ninja")
|
||||
dumpfile = os.path.join(self.options.privatedir,
|
||||
ninja_build.replace(os.path.sep, '_') + '_' + str(os.stat(ninja_build).st_mtime) + '.json')
|
||||
try:
|
||||
with open(dumpfile, 'r') as f:
|
||||
tests_json = json.load(f)
|
||||
except FileNotFoundError:
|
||||
output = subprocess.check_output(
|
||||
[meson, 'introspect', '--tests', bdir])
|
||||
json_str = output.decode()
|
||||
with open(dumpfile, 'w') as f:
|
||||
f.write(json_str)
|
||||
tests_json = json.loads(json_str)
|
||||
|
||||
for test_dict in json.loads(output.decode()):
|
||||
for test_dict in tests_json:
|
||||
mesontests.append(test_dict)
|
||||
|
||||
return mesontests
|
||||
|
|
Loading…
Reference in a new issue