Skip to content

Commit

Permalink
Add tests for JSON and console output
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Mar 11, 2022
1 parent 14daf47 commit 38b96b9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/libtest-json/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
OUTPUT_FILE_DEFAULT := $(TMPDIR)/libtest-json-output-default.json
OUTPUT_FILE_STDOUT_SUCCESS := $(TMPDIR)/libtest-json-output-stdout-success.json

all:
all: f.rs validate_json.py output-default.json output-stdout-success.json
$(RUSTC) --test f.rs
RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json > $(OUTPUT_FILE_DEFAULT) || true
RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json --show-output > $(OUTPUT_FILE_STDOUT_SUCCESS) || true
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-make-fulldeps/libtest-json/f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn c() {
}

#[test]
#[ignore]
#[ignore = "msg"]
fn d() {
assert!(false);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok" }
{ "type": "test", "event": "started", "name": "d" }
{ "type": "test", "name": "d", "event": "ignored" }
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:15:5\n" }
{ "type": "test", "event": "started", "name": "d" }
{ "type": "test", "name": "d", "event": "ignored" }
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }
5 changes: 2 additions & 3 deletions src/test/ui/test-attrs/test-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// ignore-emscripten no threads support
// run-pass


#[test]
fn test_ok() {
let _a = true;
Expand All @@ -18,9 +17,9 @@ fn test_panic() {
}

#[test]
#[ignore]
#[ignore = "msg"]
fn test_no_run() {
loop{
loop {
println!("Hello, world");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/test-attrs/test-type.run.stdout
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

running 3 tests
test test_no_run ... ignored
test test_no_run ... ignored, msg
test test_ok ... ok
test test_panic - should panic ... ok

Expand Down

0 comments on commit 38b96b9

Please sign in to comment.