Skip to content
Permalink
Browse files

Add rustdoc JS non-std tests

  • Loading branch information...
GuillaumeGomez committed Feb 9, 2019
1 parent da57320 commit 834347ddafee7c33f3fd556c4976275b1111dc8f
@@ -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,
@@ -612,6 +612,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>,
@@ -0,0 +1,7 @@
const QUERY = 'Fo';

const EXPECTED = {
'others': [
{ 'path': 'basic', 'name': 'Foo' },
],
};
@@ -0,0 +1 @@
pub struct Foo;
Oops, something went wrong.

0 comments on commit 834347d

Please sign in to comment.
You can’t perform that action at this time.