Skip to content

Commit f6bd538

Browse files
committed
Extract dependencies for QL tests
1 parent 1964daf commit f6bd538

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

rust/tools/autobuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -eu
55
export RUST_BACKTRACE=1
66
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
77

8-
exec /usr/bin/env python "${SCRIPT_DIR}/autobuild.py"
8+
exec /usr/bin/env python3 "${SCRIPT_DIR}/autobuild.py"

rust/tools/qltest.sh

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,28 @@ export RUST_BACKTRACE=full
77
QLTEST_LOG="$CODEQL_EXTRACTOR_RUST_LOG_DIR/qltest.log"
88
QLTEST_COLORED_LOG="$CODEQL_EXTRACTOR_RUST_SCRATCH_DIR/qltest.log"
99
dirname "$QLTEST_LOG" "$QLTEST_COLORED_LOG" | xargs mkdir -p
10-
# put full-color output on the side, but remove the color codes from the log file
11-
# also, print (colored) output only in case of failure
12-
if ! "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" \
13-
--qltest \
14-
--logging-verbosity=progress+ \
15-
2>&1 \
16-
| tee "$QLTEST_COLORED_LOG" \
17-
| sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' \
18-
> "$QLTEST_LOG"; then
19-
cat "$QLTEST_COLORED_LOG"
20-
exit 1
10+
11+
if [ -f "Cargo.lock" ]; then
12+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
13+
if ! /usr/bin/env python3 "${SCRIPT_DIR}/autobuild.py" \
14+
2>&1 \
15+
| tee "$QLTEST_COLORED_LOG" \
16+
| sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' \
17+
> "$QLTEST_LOG"; then
18+
cat "$QLTEST_COLORED_LOG"
19+
exit 1
20+
fi
21+
else
22+
# put full-color output on the side, but remove the color codes from the log file
23+
# also, print (colored) output only in case of failure
24+
if ! "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" \
25+
--qltest \
26+
--logging-verbosity=progress+ \
27+
2>&1 \
28+
| tee "$QLTEST_COLORED_LOG" \
29+
| sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' \
30+
> "$QLTEST_LOG"; then
31+
cat "$QLTEST_COLORED_LOG"
32+
exit 1
33+
fi
2134
fi

0 commit comments

Comments
 (0)