about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-07-28 17:52:44 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-07-28 18:00:31 -0700
commit8e7849e766730f9e210330485386731cac40d346 (patch)
tree87bd532aafc283b6d9e5ac7da6cd2d4ac1b431ec /src/libstd
parenteba9d7f08ce5c90549ee52337aca0010ad566f0d (diff)
downloadrust-8e7849e766730f9e210330485386731cac40d346.tar.gz
rust-8e7849e766730f9e210330485386731cac40d346.zip
rustbuild: Use Cargo's "target runner"
This commit leverages a relatively new feature in Cargo to execute
cross-compiled tests, the `target.$target.runner` configuration. We configure it
through environment variables in rustbuild and this avoids the need for us to
locate and run tests after-the-fact, instead relying on Cargo to do all that
execution for us.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/process.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 31809e38239..a872e7eee06 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -1417,8 +1417,19 @@ mod tests {
         let output = String::from_utf8(result.stdout).unwrap();
 
         for (ref k, ref v) in env::vars() {
-            // don't check android RANDOM variables
-            if cfg!(target_os = "android") && *k == "RANDOM" {
+            // Don't check android RANDOM variable which seems to change
+            // whenever the shell runs, and our `env_cmd` is indeed running a
+            // shell which means it'll get a different RANDOM than we probably
+            // have.
+            //
+            // Also skip env vars with `-` in the name on android because, well,
+            // I'm not sure. It appears though that the `set` command above does
+            // not print env vars with `-` in the name, so we just skip them
+            // here as we won't find them in the output. Note that most env vars
+            // use `_` instead of `-`, but our build system sets a few env vars
+            // with `-` in the name.
+            if cfg!(target_os = "android") &&
+               (*k == "RANDOM" || k.contains("-")) {
                 continue
             }