From 4d06185688aa2bc533776669b53a2479e2cf3e8c Mon Sep 17 00:00:00 2001 From: kennytm Date: Sat, 2 Sep 2017 19:59:53 +0800 Subject: [PATCH] Remove invalid doctest from bootstrap.py. Make sure that if the test is failed, the CI will stop the build. --- src/bootstrap/bootstrap.py | 4 ---- src/bootstrap/bootstrap_test.py | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4c1bd7bdca9e0..4ef6d70e820ea 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -523,10 +523,6 @@ def program_config(self, program): >>> rb.config_toml = 'rustc = "rustc"\\n' >>> rb.program_config('rustc') 'rustc' - >>> cargo_path = rb.program_config('cargo') - >>> cargo_path.rstrip(".exe") == os.path.join("/tmp/rust", - ... "bin", "cargo") - True >>> rb.config_toml = '' >>> cargo_path = rb.program_config('cargo') >>> cargo_path.rstrip(".exe") == os.path.join(rb.bin_root(), diff --git a/src/bootstrap/bootstrap_test.py b/src/bootstrap/bootstrap_test.py index a65a3a4042eca..32ea4b4abe638 100644 --- a/src/bootstrap/bootstrap_test.py +++ b/src/bootstrap/bootstrap_test.py @@ -15,6 +15,7 @@ import unittest import tempfile import hashlib +import sys from shutil import rmtree @@ -110,5 +111,6 @@ def test_same_dates(self): TEST_LOADER.loadTestsFromTestCase(VerifyTestCase), TEST_LOADER.loadTestsFromTestCase(ProgramOutOfDate)]) - RUNNER = unittest.TextTestRunner(verbosity=2) - RUNNER.run(SUITE) + RUNNER = unittest.TextTestRunner(stream=sys.stdout, verbosity=2) + result = RUNNER.run(SUITE) + sys.exit(0 if result.wasSuccessful() else 1)