Skip to content

Commit

Permalink
run_single_test: Ensure symlinks exist and are cleaned up
Browse files Browse the repository at this point in the history
The common test case "268 install functions and follow symlinks"
requires that certain symlinks exist in order to function.

If one clones a fresh repo and executes run_single_test.py with
the aforementioned test as the target it will fail as the required
symlinks are not part of the repo.

Normally these symlinks are created and cleaned up when the
overall testsuite is run but this is not the case for
run_single_test.py

This commit calls the necessary creation and cleanup functions
in the case of run_single_test.py.
  • Loading branch information
amcn authored and dcbaker committed Sep 23, 2024
1 parent bc30d59 commit 191b801
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run_single_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from run_tests import handle_meson_skip_test
from run_project_tests import TestDef, load_test_json, run_test, BuildStep
from run_project_tests import setup_commands, detect_system_compiler, detect_tools
from run_project_tests import setup_symlinks, clear_transitive_files

if T.TYPE_CHECKING:
from run_project_tests import CompilerArgumentType
Expand Down Expand Up @@ -44,6 +45,7 @@ def main() -> None:
parser.add_argument('--quick', action='store_true', help='Skip some compiler and tool checking')
args = T.cast('ArgumentType', parser.parse_args())

setup_symlinks()
setup_commands(args.backend)
if not args.quick:
detect_system_compiler(args)
Expand Down Expand Up @@ -95,6 +97,7 @@ def should_fail(path: pathlib.Path) -> str:
mlog.log(cmd_res)
mlog.log(result.stde)

clear_transitive_files()
exit(1 if failed else 0)

if __name__ == "__main__":
Expand Down

0 comments on commit 191b801

Please sign in to comment.