Skip to content

Commit 0186284

Browse files
committed
add testcase for shorten ice
1 parent 1e80402 commit 0186284

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

tests/run-make/short-ice/Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include ../../run-make-fulldeps/tools.mk
2+
3+
# ignore-windows
4+
5+
export RUSTC := $(RUSTC_ORIGINAL)
6+
export TMPDIR := $(TMPDIR)
7+
8+
all:
9+
bash check.sh

tests/run-make/short-ice/check.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
RUST_BACKTRACE=1 $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-1.log 2>&1
4+
RUST_BACKTRACE=full $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-2.log 2>&1
5+
6+
short=$(cat $TMPDIR/rust-test-1.log | wc -l)
7+
full=$(cat $TMPDIR/rust-test-2.log | wc -l)
8+
echo "short backtrace: $short"
9+
echo "full backtrace: $full"
10+
11+
if [ $full -gt $short ]; then
12+
exit 0
13+
else
14+
exit 1
15+
fi

tests/run-make/short-ice/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extern crate error_lib;
2+
3+
fn main() {
4+
println!("Hello, world!");
5+
}

0 commit comments

Comments
 (0)