You've already forked adareducer
mirror of
https://github.com/AdaCore/adareducer.git
synced 2026-02-12 13:10:07 -08:00
In the production environment, we want the testsuite to exercize the adareducer that is being packaged (installed in the environment), not the adareducer that is part of the testsuite source tree. This new option prevents the testsuite from automatically adding the adareducer part of the testsuite source tree to the environment. TN: V317-010
53 lines
1.3 KiB
Python
Executable File
53 lines
1.3 KiB
Python
Executable File
#! /usr/bin/env python
|
|
|
|
"""
|
|
Usage::
|
|
|
|
testsuite.py [OPTIONS]
|
|
|
|
Run the adareducer testsuite. This requires e3-testsuite.
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
|
|
import e3.testsuite
|
|
|
|
from drivers.shell_script import ShellScriptDriver
|
|
|
|
|
|
class AdaReducerTestsuite(e3.testsuite.Testsuite):
|
|
tests_subdir = "tests"
|
|
test_driver_map = {"shell_script": ShellScriptDriver}
|
|
default_driver = "shell_script"
|
|
|
|
def add_options(self, parser):
|
|
parser.add_argument(
|
|
"--no-auto-path",
|
|
dest="auto_path",
|
|
action="store_false",
|
|
help="Do not automatically make adareducer available, i.e. assume"
|
|
" it is already available in the environment."
|
|
)
|
|
|
|
def set_up(self) -> None:
|
|
super().set_up()
|
|
|
|
if self.env.options.auto_path:
|
|
# Set PYTHONPATH to find adareducer
|
|
root_dir = os.path.abspath(
|
|
os.path.join(os.path.dirname(__file__), "..")
|
|
)
|
|
os.environ["PYTHONPATH"] = "{}:{}".format(
|
|
root_dir,
|
|
os.environ.get("PYTHONPATH", ""),
|
|
)
|
|
|
|
os.environ["ADAREDUCER"] = f"{root_dir}/adareducer"
|
|
|
|
else:
|
|
os.environ["ADAREDUCER"] = "adareducer"
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(AdaReducerTestsuite(os.path.dirname(__file__)).testsuite_main())
|