From 34b8b43843fb58480fa58834abe2e94649467d9d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 31 Oct 2024 06:41:46 +0100 Subject: [PATCH] Swift: use `-typecheck` in QL tests --- swift/tools/qltest.sh | 2 +- swift/tools/test/qltest/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/tools/qltest.sh b/swift/tools/qltest.sh index ba5fb779d287..00657d593b84 100755 --- a/swift/tools/qltest.sh +++ b/swift/tools/qltest.sh @@ -9,7 +9,7 @@ RESOURCE_DIR="$CODEQL_EXTRACTOR_SWIFT_ROOT/resource-dir/$CODEQL_PLATFORM" export CODEQL_EXTRACTOR_SWIFT_LOG_LEVELS=${CODEQL_EXTRACTOR_SWIFT_LOG_LEVELS:-out:text:no_logs,out:console:info} for src in *.swift; do env=() - opts=(-resource-dir "$RESOURCE_DIR" -c -primary-file "$src") + opts=(-resource-dir "$RESOURCE_DIR" -typecheck -primary-file "$src") opts+=($(sed -n '1 s=//codeql-extractor-options:==p' $src)) expected_status=$(sed -n 's=//codeql-extractor-expected-status:[[:space:]]*==p' $src) expected_status=${expected_status:-0} diff --git a/swift/tools/test/qltest/utils.py b/swift/tools/test/qltest/utils.py index fc2d6582a82e..9ed49c04153e 100644 --- a/swift/tools/test/qltest/utils.py +++ b/swift/tools/test/qltest/utils.py @@ -60,7 +60,7 @@ def assert_extractor_executed_with(*flags): for actual, expected in itertools.zip_longest(execution, flags): if actual: actual = actual.strip() - expected_prefix = f"-resource-dir {swift_root}/resource-dir/{platform} -c -primary-file " + expected_prefix = f"-resource-dir {swift_root}/resource-dir/{platform} -typecheck -primary-file " assert actual.startswith(expected_prefix), f"correct options not found in\n{actual}" actual = actual[len(expected_prefix):] assert actual, f"\nnot encountered: {expected}"