Skip to content

Commit cad7423

Browse files
committed
[WIP] test-cargo-miri changes
1 parent 17f9193 commit cad7423

File tree

8 files changed

+24
-11
lines changed

8 files changed

+24
-11
lines changed

test-cargo-miri/Cargo.lock

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cargo-miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2024"
1010

1111
[dependencies]
1212
byteorder = "1.0"
13-
cdylib = { path = "cdylib" }
13+
#cdylib = { path = "cdylib" }
1414
exported_symbol = { path = "exported-symbol" }
1515
proc_macro_crate = { path = "proc-macro-crate" }
1616
issue_1567 = { path = "issue-1567" }

test-cargo-miri/run-test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def normalize_stdout(str):
4040
str = re.sub("\\b\\d+\\.\\d+s\\b", "$TIME", str) # the time keeps changing, obviously
4141
return str
4242

43+
def normalize_stderr(str):
44+
# the order of reported crate types is non-deterministic and the target differs between platforms
45+
str = re.sub("warning: dropping unsupported crate type.*", "UNSUPPORTED CRATE TYPE", str)
46+
return str
47+
4348
def check_output(actual, path, name):
4449
if ARGS.bless:
4550
# Write the output only if bless is set
@@ -71,7 +76,7 @@ def test(name, cmd, stdout_ref, stderr_ref, stdin=b'', env=None):
7176
)
7277
(stdout, stderr) = p.communicate(input=stdin)
7378
stdout = normalize_stdout(stdout.decode("UTF-8"))
74-
stderr = stderr.decode("UTF-8")
79+
stderr = normalize_stderr(stderr.decode("UTF-8"))
7580

7681
stdout_matches = check_output(stdout, stdout_ref, "stdout")
7782
stderr_matches = check_output(stderr, stderr_ref, "stderr")

test-cargo-miri/run.args.stderr.ref

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
UNSUPPORTED CRATE TYPE
2+
3+
UNSUPPORTED CRATE TYPE
4+
15
main
26
hello world
37
"hello world"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
UNSUPPORTED CRATE TYPE
2+
3+
UNSUPPORTED CRATE TYPE
4+
15
main
26
--target-dir=target/custom-run
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
UNSUPPORTED CRATE TYPE
2+
3+
UNSUPPORTED CRATE TYPE
4+
15
main
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
subcrate,issue_1567,exported_symbol_dep,test_local_crate_detection,cargo_miri_test,cdylib,exported_symbol,issue_1691,issue_1705,issue_rust_86261,proc_macro_crate
1+
subcrate,issue_1567,exported_symbol_dep,test_local_crate_detection,cargo_miri_test,exported_symbol,issue_1691,issue_1705,issue_rust_86261,proc_macro_crate

test-cargo-miri/test.empty.ref

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
UNSUPPORTED CRATE TYPE
2+
3+
UNSUPPORTED CRATE TYPE
4+

0 commit comments

Comments
 (0)