Skip to content

Cannot run tests with prod libadalang library build #667

@LordAro

Description

@LordAro

With the new langkit/lkm-based test runner with libadalang there's no longer a way of passing --build-mode=[anything] from libadalang's run_tests.py through to testsuite.py

As far as my debugging goes, this seems to be because --build-mode is a "known" argument, so calling do_run in libmanage.py doesn't get the right arguments (as args is never used)

The following hack seems to work, but is obviously a hack and I assume there's a better way of doing this
No it doesn't, breaks the langkit build

diff --git i/langkit/libmanage.py w/langkit/libmanage.py
index 517cfb000..403c27e9a 100644
--- i/langkit/libmanage.py
+++ w/langkit/libmanage.py
@@ -1431,6 +1431,7 @@ class ManageScript(abc.ABC):
         # present, do not include it in the subprocess command line.
         if argv and argv[0] == "--":
             argv = argv[1:]
+        argv.append(f"--build-mode={args.build_modes[0].value}")
         self.check_call("Subcommand", argv)

     def do_create_wheel(self, args: argparse.Namespace) -> None:

(Recurrence of AdaCore/libadalang#955)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions