Skip to content

Commit

Permalink
add testcase for shorten ice
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Mar 9, 2023
1 parent 1e80402 commit 0186284
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/run-make/short-ice/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include ../../run-make-fulldeps/tools.mk

# ignore-windows

export RUSTC := $(RUSTC_ORIGINAL)
export TMPDIR := $(TMPDIR)

all:
bash check.sh
15 changes: 15 additions & 0 deletions tests/run-make/short-ice/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

RUST_BACKTRACE=1 $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-1.log 2>&1
RUST_BACKTRACE=full $RUSTC src/lib.rs -Z treat-err-as-bug=1 1>$TMPDIR/rust-test-2.log 2>&1

short=$(cat $TMPDIR/rust-test-1.log | wc -l)
full=$(cat $TMPDIR/rust-test-2.log | wc -l)
echo "short backtrace: $short"
echo "full backtrace: $full"

if [ $full -gt $short ]; then
exit 0
else
exit 1
fi
5 changes: 5 additions & 0 deletions tests/run-make/short-ice/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extern crate error_lib;

fn main() {
println!("Hello, world!");
}

0 comments on commit 0186284

Please sign in to comment.