Skip to content

Commit 38b96b9

Browse files
Add tests for JSON and console output
1 parent 14daf47 commit 38b96b9

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/test/run-make-fulldeps/libtest-json/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
OUTPUT_FILE_DEFAULT := $(TMPDIR)/libtest-json-output-default.json
66
OUTPUT_FILE_STDOUT_SUCCESS := $(TMPDIR)/libtest-json-output-stdout-success.json
77

8-
all:
8+
all: f.rs validate_json.py output-default.json output-stdout-success.json
99
$(RUSTC) --test f.rs
1010
RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json > $(OUTPUT_FILE_DEFAULT) || true
1111
RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json --show-output > $(OUTPUT_FILE_STDOUT_SUCCESS) || true

src/test/run-make-fulldeps/libtest-json/f.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn c() {
1616
}
1717

1818
#[test]
19-
#[ignore]
19+
#[ignore = "msg"]
2020
fn d() {
2121
assert!(false);
2222
}

src/test/run-make-fulldeps/libtest-json/output-default.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
{ "type": "test", "event": "started", "name": "c" }
77
{ "type": "test", "name": "c", "event": "ok" }
88
{ "type": "test", "event": "started", "name": "d" }
9-
{ "type": "test", "name": "d", "event": "ignored" }
9+
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
1010
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }

src/test/run-make-fulldeps/libtest-json/output-stdout-success.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
{ "type": "test", "event": "started", "name": "c" }
77
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:15:5\n" }
88
{ "type": "test", "event": "started", "name": "d" }
9-
{ "type": "test", "name": "d", "event": "ignored" }
9+
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
1010
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": $TIME }

src/test/ui/test-attrs/test-type.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// ignore-emscripten no threads support
66
// run-pass
77

8-
98
#[test]
109
fn test_ok() {
1110
let _a = true;
@@ -18,9 +17,9 @@ fn test_panic() {
1817
}
1918

2019
#[test]
21-
#[ignore]
20+
#[ignore = "msg"]
2221
fn test_no_run() {
23-
loop{
22+
loop {
2423
println!("Hello, world");
2524
}
2625
}

src/test/ui/test-attrs/test-type.run.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
running 3 tests
3-
test test_no_run ... ignored
3+
test test_no_run ... ignored, msg
44
test test_ok ... ok
55
test test_panic - should panic ... ok
66

0 commit comments

Comments
 (0)