@@ -8,21 +8,27 @@ full=$(cat $TMPDIR/rust-test-2.log | wc -l)
88rustc_query_count=$( cat $TMPDIR /rust-test-1.log | grep rustc_query_ | wc -l)
99rustc_query_count_full=$( cat $TMPDIR /rust-test-2.log | grep rustc_query_ | wc -l)
1010
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+
1114cat $TMPDIR /rust-test-1.log
1215echo " ====================="
1316cat $TMPDIR /rust-test-2.log
17+ echo " ====================="
1418
1519echo " short backtrace: $short "
1620echo " full backtrace: $full "
21+ echo " begin_count: $begin_count "
22+ echo " end_count : $end_count "
1723echo " rustc_query_count: $rustc_query_count "
1824echo " rustc_query_count_full: $rustc_query_count_full "
1925
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 ] &&
2632 [ $rustc_query_count_full -gt 10 ]; then
2733 exit 0
2834else
0 commit comments