@@ -8,21 +8,27 @@ full=$(cat $TMPDIR/rust-test-2.log | wc -l)
8
8
rustc_query_count=$( cat $TMPDIR /rust-test-1.log | grep rustc_query_ | wc -l)
9
9
rustc_query_count_full=$( cat $TMPDIR /rust-test-2.log | grep rustc_query_ | wc -l)
10
10
11
+ begin_count=$( cat $TMPDIR /rust-test-2.log | grep __rust_begin_short_backtrace | wc -l)
12
+ end_count=$( cat $TMPDIR /rust-test-2.log | grep __rust_end_short_backtrace | wc -l)
13
+
11
14
cat $TMPDIR /rust-test-1.log
12
15
echo " ====================="
13
16
cat $TMPDIR /rust-test-2.log
17
+ echo " ====================="
14
18
15
19
echo " short backtrace: $short "
16
20
echo " full backtrace: $full "
21
+ echo " begin_count: $begin_count "
22
+ echo " end_count : $end_count "
17
23
echo " rustc_query_count: $rustc_query_count "
18
24
echo " rustc_query_count_full: $rustc_query_count_full "
19
25
20
- # # check `rustc_query_count` to avoid to missing `__rust_end_short_backtrace`
21
- # # 1 <= $rustc_query_count < $rustc_query_count_full
22
- # # $rustc_query_count_full > 10
23
- if [ $full -gt $short ] &&
24
- [ $rustc_query_count -gt 1 ] &&
25
- [ $rustc_query_count -lt $rustc_query_count_full ] &&
26
+ # # backtraces to vary a bit depending on platform and configuration options,
27
+ # # here we make sure that the short backtrace of rustc_query is shorter than the full,
28
+ # # and marks are in pairs.
29
+ if [ $short -lt $full ] &&
30
+ [ $begin_count -eq $end_count ] &&
31
+ [ $(( $ rustc_query_count + 10 )) -lt $rustc_query_count_full ] &&
26
32
[ $rustc_query_count_full -gt 10 ]; then
27
33
exit 0
28
34
else
0 commit comments