Skip to content

Commit 674ae49

Browse files
authored
Remove unused args from parsing & Config (rust-lang#1769)
1 parent f1cc3c7 commit 674ae49

File tree

2 files changed

+2
-91
lines changed

2 files changed

+2
-91
lines changed

tools/compiletest/src/common.rs

-13
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ pub enum PanicStrategy {
7979
/// Configuration for compiletest
8080
#[derive(Debug, Clone)]
8181
pub struct Config {
82-
/// The path to the directory where the Kani executable is located
83-
pub kani_dir_path: PathBuf,
84-
8582
/// The directory containing the tests to run
8683
pub src_base: PathBuf,
8784

@@ -107,16 +104,6 @@ pub struct Config {
107104
/// Write out a parseable log of tests that were run
108105
pub logfile: Option<PathBuf>,
109106

110-
/// Flags to pass to the compiler when building for the host
111-
pub host_rustcflags: Option<String>,
112-
113-
/// Flags to pass to the compiler when building for the target
114-
pub target_rustcflags: Option<String>,
115-
116-
/// What panic strategy the target is built with. Unwind supports Abort, but
117-
/// not vice versa.
118-
pub target_panic: PanicStrategy,
119-
120107
/// Target system to be tested
121108
pub target: String,
122109

tools/compiletest/src/main.rs

+2-78
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
extern crate test;
1212

13-
use crate::common::{output_base_dir, output_relative_path, PanicStrategy};
13+
use crate::common::{output_base_dir, output_relative_path};
1414
use crate::common::{Config, Mode, TestPaths};
1515
use crate::util::{logv, top_level};
1616
use getopts::Options;
@@ -57,19 +57,7 @@ fn add_kani_to_path() {
5757

5858
pub fn parse_config(args: Vec<String>) -> Config {
5959
let mut opts = Options::new();
60-
opts.optopt("", "compile-lib-path", "path to host shared libraries", "PATH")
61-
.optopt("", "run-lib-path", "path to target shared libraries", "PATH")
62-
.optopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
63-
.optopt("", "kani-dir-path", "path to directory where kani is located", "PATH")
64-
.optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
65-
.optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH")
66-
.optopt("", "lldb-python", "path to python to use for doc tests", "PATH")
67-
.optopt("", "docck-python", "path to python to use for doc tests", "PATH")
68-
.optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
69-
.optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
70-
.optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
71-
.optopt("", "run-clang-based-tests-with", "path to Clang executable", "PATH")
72-
.optopt("", "llvm-filecheck", "path to LLVM's FileCheck binary", "DIR")
60+
opts
7361
.optopt("", "src-base", "directory to scan for test files", "PATH")
7462
.optopt("", "build-base", "directory to deposit test outputs", "PATH")
7563
.optopt(
@@ -85,67 +73,14 @@ pub fn parse_config(args: Vec<String>) -> Config {
8573
"which suite of compile tests to run. used for nicer error reporting.",
8674
"SUITE",
8775
)
88-
.optopt(
89-
"",
90-
"pass",
91-
"force {check,build,run}-pass tests to this mode.",
92-
"check | build | run",
93-
)
94-
.optopt("", "run", "whether to execute run-* tests", "auto | always | never")
9576
.optflag("", "ignored", "run tests marked as ignored")
9677
.optflag("", "exact", "filters match exactly")
97-
.optopt(
98-
"",
99-
"runtool",
100-
"supervisor program to run tests under \
101-
(eg. emulator, valgrind)",
102-
"PROGRAM",
103-
)
104-
.optmulti("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS")
105-
.optmulti("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS")
106-
.optopt("", "target-panic", "what panic strategy the target supports", "unwind | abort")
10778
.optflag("", "verbose", "run tests verbosely, showing all output")
108-
.optflag(
109-
"",
110-
"bless",
111-
"overwrite stderr/stdout files instead of complaining about a mismatch",
112-
)
11379
.optflag("", "quiet", "print one character per test instead of one line")
11480
.optopt("", "color", "coloring: auto, always, never", "WHEN")
11581
.optopt("", "logfile", "file to log test execution to", "FILE")
11682
.optopt("", "target", "the target to build for", "TARGET")
11783
.optopt("", "host", "the host to build for", "HOST")
118-
.optopt("", "cdb", "path to CDB to use for CDB debuginfo tests", "PATH")
119-
.optopt("", "gdb", "path to GDB to use for GDB debuginfo tests", "PATH")
120-
.optopt("", "lldb-version", "the version of LLDB used", "VERSION STRING")
121-
.optopt("", "llvm-version", "the version of LLVM used", "VERSION STRING")
122-
.optflag("", "system-llvm", "is LLVM the system LLVM")
123-
.optopt("", "android-cross-path", "Android NDK standalone path", "PATH")
124-
.optopt("", "adb-path", "path to the android debugger", "PATH")
125-
.optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH")
126-
.optopt("", "lldb-python-dir", "directory containing LLDB's python module", "PATH")
127-
.optopt("", "cc", "path to a C compiler", "PATH")
128-
.optopt("", "cxx", "path to a C++ compiler", "PATH")
129-
.optopt("", "cflags", "flags for the C compiler", "FLAGS")
130-
.optopt("", "ar", "path to an archiver", "PATH")
131-
.optopt("", "linker", "path to a linker", "PATH")
132-
.optopt("", "llvm-components", "list of LLVM components built in", "LIST")
133-
.optopt("", "llvm-bin-dir", "Path to LLVM's `bin` directory", "PATH")
134-
.optopt("", "nodejs", "the name of nodejs", "PATH")
135-
.optopt("", "npm", "the name of npm", "PATH")
136-
.optopt("", "remote-test-client", "path to the remote test client", "PATH")
137-
.optopt(
138-
"",
139-
"compare-mode",
140-
"mode describing what file the actual ui output will be compared to",
141-
"COMPARE MODE",
142-
)
143-
.optflag(
144-
"",
145-
"rustfix-coverage",
146-
"enable this to generate a Rustfix coverage file, which is saved in \
147-
`./<build_base>/rustfix_missing_coverage.txt`",
148-
)
14984
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
15085
.optflag("h", "help", "show this message")
15186
.optopt("", "edition", "default Rust edition", "EDITION");
@@ -197,7 +132,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
197132
let mode = matches.opt_str("mode").unwrap().parse().expect("invalid mode");
198133

199134
Config {
200-
kani_dir_path: opt_path(matches, "kani-dir-path", &["target/debug"]),
201135
src_base,
202136
build_base: opt_path(matches, "build-base", &["build", "tests", suite.as_str()]),
203137
mode,
@@ -206,20 +140,12 @@ pub fn parse_config(args: Vec<String>) -> Config {
206140
filters: matches.free.clone(),
207141
filter_exact: matches.opt_present("exact"),
208142
logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
209-
host_rustcflags: Some(matches.opt_strs("host-rustcflags").join(" ")),
210-
target_rustcflags: Some(matches.opt_strs("target-rustcflags").join(" ")),
211-
target_panic: match matches.opt_str("target-panic").as_deref() {
212-
Some("unwind") | None => PanicStrategy::Unwind,
213-
Some("abort") => PanicStrategy::Abort,
214-
_ => panic!("unknown `--target-panic` option `{}` given", mode),
215-
},
216143
target,
217144
host: opt_str2(matches.opt_str("host")),
218145
verbose: matches.opt_present("verbose"),
219146
quiet: matches.opt_present("quiet"),
220147
color,
221148
edition: matches.opt_str("edition"),
222-
223149
force_rerun: matches.opt_present("force-rerun"),
224150
mir_linker: cfg!(mir_linker),
225151
}
@@ -234,8 +160,6 @@ pub fn log_config(config: &Config) {
234160
logv(c, format!("run_ignored: {}", config.run_ignored));
235161
logv(c, format!("filters: {:?}", config.filters));
236162
logv(c, format!("filter_exact: {}", config.filter_exact));
237-
logv(c, format!("host-rustcflags: {}", opt_str(&config.host_rustcflags)));
238-
logv(c, format!("target-rustcflags: {}", opt_str(&config.target_rustcflags)));
239163
logv(c, format!("target: {}", config.target));
240164
logv(c, format!("host: {}", config.host));
241165
logv(c, format!("verbose: {}", config.verbose));

0 commit comments

Comments
 (0)