]> git.lizzy.rs Git - rust.git/commitdiff
Extend tidy to allow conditionalizing tests for multiple targets.
authorEd Schouten <ed@nuxi.nl>
Thu, 11 Jan 2018 16:06:33 +0000 (17:06 +0100)
committerEd Schouten <ed@nuxi.nl>
Thu, 11 Jan 2018 16:06:33 +0000 (17:06 +0100)
src/tools/tidy/src/pal.rs

index fdbcfd10bde7cc2377be9925e63636de7ad98f30..8071f07d811959975e8d409d06a674c82102dd7a 100644 (file)
@@ -168,8 +168,8 @@ fn find_test_mod(contents: &str) -> usize {
         let prev_newline_idx = contents[..prev_newline_idx].rfind('\n');
         if let Some(nl) = prev_newline_idx {
             let prev_line = &contents[nl + 1 .. mod_tests_idx];
-            let emcc_cfg = "cfg(all(test, not(target_os";
-            if prev_line.contains(emcc_cfg) {
+            if prev_line.contains("cfg(all(test, not(target_os")
+                || prev_line.contains("cfg(all(test, not(any(target_os") {
                 nl
             } else {
                 mod_tests_idx