Skip to content

Commit d2f4a9d

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#37488 - frewsxcv:quiet-travis, r=alexcrichton
Use quieter test output when running tests on Travis CI. Fixes rust-lang#36788.
2 parents 0a20ec3 + c8c6d2c commit d2f4a9d

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ before_install:
1515
script:
1616
- docker run -v `pwd`:/build rust
1717
sh -c "
18-
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 &&
18+
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
1919
make tidy &&
2020
make check -j4
2121
"

configure

+1
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ opt docs 1 "build standard library documentation"
615615
opt compiler-docs 0 "build compiler documentation"
616616
opt optimize-tests 1 "build tests with optimizations"
617617
opt debuginfo-tests 0 "build tests with debugger metadata"
618+
opt quiet-tests 0 "enable quieter output when running tests"
618619
opt libcpp 1 "build llvm with libc++ instead of libstdc++ when using clang"
619620
opt llvm-assertions 0 "build LLVM with assertions"
620621
opt debug-assertions 0 "build with debugging assertions"

src/bootstrap/check.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ pub fn compiletest(build: &Build,
187187
cmd.arg("--verbose");
188188
}
189189

190+
if build.config.quiet_tests {
191+
cmd.arg("--quiet");
192+
}
193+
190194
// Only pass correct values for these flags for the `run-make` suite as it
191195
// requires that a C++ compiler was configured which isn't always the case.
192196
if suite == "run-make" {
@@ -277,7 +281,13 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
277281
build.add_rustc_lib_path(compiler, &mut cmd);
278282
cmd.arg("--test");
279283
cmd.arg(markdown);
280-
cmd.arg("--test-args").arg(build.flags.args.join(" "));
284+
285+
let mut test_args = build.flags.args.join(" ");
286+
if build.config.quiet_tests {
287+
test_args.push_str(" --quiet");
288+
}
289+
cmd.arg("--test-args").arg(test_args);
290+
281291
build.run(&mut cmd);
282292
}
283293

@@ -367,6 +377,11 @@ pub fn krate(build: &Build,
367377
dylib_path.insert(0, build.sysroot_libdir(compiler, target));
368378
cargo.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
369379

380+
if build.config.quiet_tests {
381+
cargo.arg("--");
382+
cargo.arg("--quiet");
383+
}
384+
370385
if target.contains("android") {
371386
build.run(cargo.arg("--no-run"));
372387
krate_android(build, compiler, target, mode);

src/bootstrap/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub struct Config {
7777

7878
// misc
7979
pub channel: String,
80+
pub quiet_tests: bool,
8081
// Fallback musl-root for all targets
8182
pub musl_root: Option<PathBuf>,
8283
pub prefix: Option<String>,
@@ -338,6 +339,7 @@ impl Config {
338339
("RPATH", self.rust_rpath),
339340
("OPTIMIZE_TESTS", self.rust_optimize_tests),
340341
("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
342+
("QUIET_TESTS", self.quiet_tests),
341343
("LOCAL_REBUILD", self.local_rebuild),
342344
("NINJA", self.ninja),
343345
("CODEGEN_TESTS", self.codegen_tests),

0 commit comments

Comments
 (0)