diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-02-09 20:28:22 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-02-25 17:43:57 +0100 |
| commit | 834347ddafee7c33f3fd556c4976275b1111dc8f (patch) | |
| tree | 859eb0cf3b0502258e116b248af8aca8e828349a /src/bootstrap | |
| parent | da573206f87b5510de4b0ee1a9c044127e409bd3 (diff) | |
| download | rust-834347ddafee7c33f3fd556c4976275b1111dc8f.tar.gz rust-834347ddafee7c33f3fd556c4976275b1111dc8f.zip | |
Add rustdoc JS non-std tests
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 1 | ||||
| -rw-r--r-- | src/bootstrap/test.rs | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 7e6c0a9f52a..71b9cd6f9fb 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -406,6 +406,7 @@ impl<'a> Builder<'a> { test::Clippy, test::CompiletestTest, test::RustdocJS, + test::RustdocJSNotStd, test::RustdocTheme, // Run bootstrap close to the end as it's unlikely to fail test::Bootstrap, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 51412f79c3d..7dcc10e8a09 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -613,6 +613,50 @@ impl Step for RustdocJS { } #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct RustdocJSNotStd { + pub host: Interned<String>, + pub target: Interned<String>, + pub compiler: Compiler, +} + +impl Step for RustdocJSNotStd { + type Output = (); + const DEFAULT: bool = true; + const ONLY_HOSTS: bool = true; + + fn should_run(run: ShouldRun) -> ShouldRun { + run.path("src/test/rustdoc-js-not-std") + } + + fn make_run(run: RunConfig) { + let compiler = run.builder.compiler(run.builder.top_stage, run.host); + run.builder.ensure(RustdocJSNotStd { + host: run.host, + target: run.target, + compiler, + }); + } + + fn run(self, builder: &Builder) { + if let Some(ref nodejs) = builder.config.nodejs { + let mut command = Command::new(nodejs); + command.args(&["src/tools/rustdoc-js-not-std/tester.js", + &*self.host, + builder.top_stage.to_string().as_str()]); + builder.ensure(crate::doc::Std { + target: self.target, + stage: builder.top_stage, + }); + builder.run(&mut command); + } else { + builder.info( + "No nodejs found, skipping \"src/test/rustdoc-js-not-std\" tests" + ); + } + } +} + +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct RustdocUi { pub host: Interned<String>, pub target: Interned<String>, |
