Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advise against removing the remaining Python scripts from tests/run-make #129387

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/run-make/debugger-visualizer-dep-info/foo.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/run-make/debugger-visualizer-dep-info/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![debugger_visualizer(gdb_script_file = "foo.py")]
#![debugger_visualizer(gdb_script_file = "my_gdb_script.py")]

fn main() {
const _UNUSED: u32 = {
Expand Down
6 changes: 6 additions & 0 deletions tests/run-make/debugger-visualizer-dep-info/my_gdb_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is a Python script, but we don't actually run it.
# So if you're trying to remove Python scripts from the test suite,
# be aware that there's no value in trying to get rid of this one.
#
# It just needs to exist so that the compiler can embed it via
# `#![debugger_visualizer(gdb_script_file = "...")]`.
2 changes: 1 addition & 1 deletion tests/run-make/debugger-visualizer-dep-info/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ use run_make_support::{invalid_utf8_contains, rustc};

fn main() {
rustc().emit("dep-info").input("main.rs").run();
invalid_utf8_contains("main.d", "foo.py");
invalid_utf8_contains("main.d", "my_gdb_script.py");
invalid_utf8_contains("main.d", "my_visualizers/bar.natvis");
}
10 changes: 10 additions & 0 deletions tests/run-make/libtest-junit/validate_junit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env python

# Trivial Python script that reads lines from stdin, and checks that each line
# is a well-formed XML document.
#
# This takes advantage of the fact that Python has a built-in XML parser,
# whereas doing the same check in Rust would require us to pull in an XML
# crate just for this relatively-minor test.
#
# If you're trying to remove Python scripts from the test suite, think twice
# before removing this one. You could do so, but it's probably not worth it.

import sys
import xml.etree.ElementTree as ET

Expand Down
Loading