File tree Expand file tree Collapse file tree 3 files changed +15
-18
lines changed
Expand file tree Collapse file tree 3 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 11Cargo.toml
22Cargo.lock
3+ lib.rs
34target /
Original file line number Diff line number Diff line change 1+ | lib.rs:0:0:0:0 | lib.rs | DbFile | getName: | lib.rs |
12| test.rs:0:0:0:0 | test.rs | DbFile | getName: | test.rs |
Original file line number Diff line number Diff line change @@ -7,26 +7,21 @@ export RUST_BACKTRACE=full
77QLTEST_LOG=" $CODEQL_EXTRACTOR_RUST_LOG_DIR " /qltest.log
88
99EXTRACTOR=" $CODEQL_EXTRACTOR_RUST_ROOT /tools/$CODEQL_PLATFORM /extractor"
10+ echo > lib.rs
1011for src in * .rs; do
11- echo -e " [workspace]\n\n[package]\nname = \" test\" \nversion=\" 0.0.1\" \n[lib]\npath=\" $src \" \n" > Cargo.toml
12- env=()
13- opts=(" $src " )
14- opts+=($( sed -n ' 1 s=//codeql-extractor-options:==p' $src ) )
15- expected_status=$( sed -n ' s=//codeql-extractor-expected-status:[[:space:]]*==p' $src )
16- expected_status=${expected_status:- 0}
17- env+=($( sed -n ' 1 s=//codeql-extractor-env:==p' $src ) )
18- echo >> $QLTEST_LOG
19- echo " env ${env[@]} $EXTRACTOR ${opts[@]} " >> " $QLTEST_LOG "
20- env " ${env[@]} " " $EXTRACTOR " " ${opts[@]} " >> $QLTEST_LOG 2>&1
21- actual_status=$?
22- if [[ $actual_status != $expected_status ]]; then
23- FAILED=1
24- fi
12+ echo " mod ${src% .rs} ;" >> lib.rs
2513done
26-
27- rm -rf Cargo.*
28-
29- if [ -n " $FAILED " ]; then
14+ cat > Cargo.toml << EOF
15+ [workspace]
16+ [package]
17+ name = "test"
18+ version="0.0.1"
19+ edition="2021"
20+ [lib]
21+ path="lib.rs"
22+ EOF
23+ " $EXTRACTOR " * .rs >> " $QLTEST_LOG "
24+ if [[ " $? " != 0 ]]; then
3025 cat " $QLTEST_LOG " # Show compiler errors on extraction failure
3126 exit 1
3227fi
You can’t perform that action at this time.
0 commit comments