Skip to content

Commit

Permalink
Swift: use -typecheck in QL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Tranquilli committed Oct 31, 2024
1 parent 7f3745c commit 34b8b43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion swift/tools/qltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion swift/tools/test/qltest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 34b8b43

Please sign in to comment.