diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index bf83ab1b8..8cc6f2f8a 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -683,7 +683,7 @@ class Backend: def write_test_file(self, datafile): self.write_test_serialisation(self.build.get_tests(), datafile) - def write_test_serialisation(self, tests, datafile): + def create_test_serialisation(self, tests): arr = [] for t in tests: exe = t.get_exe() @@ -730,7 +730,10 @@ class Backend: exe_wrapper, t.is_parallel, cmd_args, t.env, t.should_fail, t.timeout, t.workdir, extra_paths) arr.append(ts) - pickle.dump(arr, datafile) + return arr + + def write_test_serialisation(self, tests, datafile): + pickle.dump(self.create_test_serialisation(tests), datafile) def generate_depmf_install(self, d): if self.build.dep_manifest_name is None: diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 2f8b3f394..5ab1d1fee 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -645,14 +645,14 @@ def run(options): def generate_introspection_file(coredata, builddata, testdata, benchmarkdata, installdata): intro_info = [ - #list_benchmarks(benchmarkdata), + list_benchmarks(benchmarkdata), list_buildoptions(coredata, builddata), list_buildsystem_files(builddata), list_deps(coredata), list_installed(installdata), list_projinfo(builddata), list_targets(coredata, builddata, installdata), - #list_tests(testdata) + list_tests(testdata) ] outdict = {} diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index 10eecd8e7..d5709f1bd 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -217,8 +217,11 @@ class MesonApp: else: coredata.update_cmd_line_file(self.build_dir, self.options) - # Generate an IDE introspection file with the exact same syntax as the introspection API defined in mintro - mintro.generate_introspection_file(b.environment.get_coredata(), b, b.get_tests(), b.get_benchmarks(), intr.backend.create_install_data()) + # Generate an IDE introspection file with the same syntax as the already existing API + intro_tests = intr.backend.create_test_serialisation(b.get_tests()) + intro_benchmarks = intr.backend.create_test_serialisation(b.get_benchmarks()) + intro_install = intr.backend.create_install_data() + mintro.generate_introspection_file(b.environment.get_coredata(), b, intro_tests, intro_benchmarks, intro_install) except: if 'cdf' in locals(): old_cdf = cdf + '.prev'