From 9aa4a949530afe44109568c40539da44f3d40ee9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 28 Mar 2014 11:10:15 -0700 Subject: [PATCH] compiletest: Switch field privacy where necessary --- src/compiletest/common.rs | 56 +++++++++++++++++++------------------- src/compiletest/errors.rs | 6 +++- src/compiletest/header.rs | 20 +++++++------- src/compiletest/procsrv.rs | 2 +- 4 files changed, 44 insertions(+), 40 deletions(-) diff --git a/src/compiletest/common.rs b/src/compiletest/common.rs index 4d1f7ab5956..ea6e98fafa7 100644 --- a/src/compiletest/common.rs +++ b/src/compiletest/common.rs @@ -21,87 +21,87 @@ pub enum mode { #[deriving(Clone)] pub struct config { // The library paths required for running the compiler - compile_lib_path: ~str, + pub compile_lib_path: ~str, // The library paths required for running compiled programs - run_lib_path: ~str, + pub run_lib_path: ~str, // The rustc executable - rustc_path: Path, + pub rustc_path: Path, // The clang executable - clang_path: Option, + pub clang_path: Option, // The llvm binaries path - llvm_bin_path: Option, + pub llvm_bin_path: Option, // The directory containing the tests to run - src_base: Path, + pub src_base: Path, // The directory where programs should be built - build_base: Path, + pub build_base: Path, // Directory for auxiliary libraries - aux_base: Path, + pub aux_base: Path, // The name of the stage being built (stage1, etc) - stage_id: ~str, + pub stage_id: ~str, // The test mode, compile-fail, run-fail, run-pass - mode: mode, + pub mode: mode, // Run ignored tests - run_ignored: bool, + pub run_ignored: bool, // Only run tests that match this filter - filter: Option<~str>, + pub filter: Option<~str>, // Write out a parseable log of tests that were run - logfile: Option, + pub logfile: Option, // Write out a json file containing any metrics of the run - save_metrics: Option, + pub save_metrics: Option, // Write and ratchet a metrics file - ratchet_metrics: Option, + pub ratchet_metrics: Option, // Percent change in metrics to consider noise - ratchet_noise_percent: Option, + pub ratchet_noise_percent: Option, - // "Shard" of the testsuite to run: this has the form of + // "Shard" of the testsuite to pub run: this has the form of // two numbers (a,b), and causes only those tests with // positional order equal to a mod b to run. - test_shard: Option<(uint,uint)>, + pub test_shard: Option<(uint,uint)>, // A command line to prefix program execution with, // for running under valgrind - runtool: Option<~str>, + pub runtool: Option<~str>, // Flags to pass to the compiler when building for the host - host_rustcflags: Option<~str>, + pub host_rustcflags: Option<~str>, // Flags to pass to the compiler when building for the target - target_rustcflags: Option<~str>, + pub target_rustcflags: Option<~str>, // Run tests using the JIT - jit: bool, + pub jit: bool, // Target system to be tested - target: ~str, + pub target: ~str, // Host triple for the compiler being invoked - host: ~str, + pub host: ~str, // Extra parameter to run adb on arm-linux-androideabi - adb_path: ~str, + pub adb_path: ~str, // Extra parameter to run test sute on arm-linux-androideabi - adb_test_dir: ~str, + pub adb_test_dir: ~str, // status whether android device available or not - adb_device_status: bool, + pub adb_device_status: bool, // Explain what's going on - verbose: bool + pub verbose: bool } diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 285bad0fc4b..42b756271d4 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -10,7 +10,11 @@ use std::io::{BufferedReader, File}; -pub struct ExpectedError { line: uint, kind: ~str, msg: ~str } +pub struct ExpectedError { + pub line: uint, + pub kind: ~str, + pub msg: ~str, +} // Load any test directives embedded in the file pub fn load_errors(testfile: &Path) -> Vec { diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index f6ae45d766a..b45a68518a3 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -14,26 +14,26 @@ use util; pub struct TestProps { // Lines that should be expected, in order, on standard out - error_patterns: Vec<~str> , + pub error_patterns: Vec<~str> , // Extra flags to pass to the compiler - compile_flags: Option<~str>, + pub compile_flags: Option<~str>, // If present, the name of a file that this test should match when // pretty-printed - pp_exact: Option, + pub pp_exact: Option, // Modules from aux directory that should be compiled - aux_builds: Vec<~str> , + pub aux_builds: Vec<~str> , // Environment settings to use during execution - exec_env: Vec<(~str,~str)> , + pub exec_env: Vec<(~str,~str)> , // Commands to be given to the debugger, when testing debug info - debugger_cmds: Vec<~str> , + pub debugger_cmds: Vec<~str> , // Lines to check if they appear in the expected debugger output - check_lines: Vec<~str> , + pub check_lines: Vec<~str> , // Flag to force a crate to be built with the host architecture - force_host: bool, + pub force_host: bool, // Check stdout for error-pattern output as well as stderr - check_stdout: bool, + pub check_stdout: bool, // Don't force a --crate-type=dylib flag on the command line - no_prefer_dynamic: bool, + pub no_prefer_dynamic: bool, } // Load any test directives embedded in the file diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 4ab3a1ef596..e00b864f2e9 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -57,7 +57,7 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> { return env; } -pub struct Result {status: ProcessExit, out: ~str, err: ~str} +pub struct Result {pub status: ProcessExit, pub out: ~str, pub err: ~str} pub fn run(lib_path: &str, prog: &str,