diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index df1750ee..04c789d5 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -40,15 +40,6 @@ const TOC_SECOND_LEVEL: &[&str] = &[ "2.1. Nested Chapter", ]; -/// Make sure you can load the dummy book and build it without panicking. -#[test] -fn build_the_dummy_book() { - let temp = DummyBook::new().build().unwrap(); - let md = MDBook::load(temp.path()).unwrap(); - - md.build().unwrap(); -} - #[test] fn by_default_mdbook_generates_rendered_content_in_the_book_directory() { let temp = DummyBook::new().build().unwrap(); diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs new file mode 100644 index 00000000..1f75199c --- /dev/null +++ b/tests/testsuite/build.rs @@ -0,0 +1,18 @@ +//! General build tests. +//! +//! More specific tests should usually go into a module based on the feature. +//! This module should just have general build tests, or misc small things. + +use crate::prelude::*; + +// Simple smoke test that building works. +#[test] +fn basic_build() { + BookTest::from_dir("build/basic_build").run("build", |cmd| { + cmd.expect_stderr(str![[r#" +[TIMESTAMP] [INFO] (mdbook::book): Book building has started +[TIMESTAMP] [INFO] (mdbook::book): Running the html backend + +"#]]); + }); +} diff --git a/tests/testsuite/build/basic_build/book.toml b/tests/testsuite/build/basic_build/book.toml new file mode 100644 index 00000000..58d56cb6 --- /dev/null +++ b/tests/testsuite/build/basic_build/book.toml @@ -0,0 +1,2 @@ +[book] +title = "basic_build" diff --git a/tests/testsuite/build/basic_build/src/SUMMARY.md b/tests/testsuite/build/basic_build/src/SUMMARY.md new file mode 100644 index 00000000..7390c828 --- /dev/null +++ b/tests/testsuite/build/basic_build/src/SUMMARY.md @@ -0,0 +1,3 @@ +# Summary + +- [Chapter 1](./chapter_1.md) diff --git a/tests/testsuite/build/basic_build/src/chapter_1.md b/tests/testsuite/build/basic_build/src/chapter_1.md new file mode 100644 index 00000000..b743fda3 --- /dev/null +++ b/tests/testsuite/build/basic_build/src/chapter_1.md @@ -0,0 +1 @@ +# Chapter 1 diff --git a/tests/testsuite/main.rs b/tests/testsuite/main.rs index 8ed64dd3..11cd9a81 100644 --- a/tests/testsuite/main.rs +++ b/tests/testsuite/main.rs @@ -3,6 +3,7 @@ //! See README.md for documentation. mod book_test; +mod build; mod prelude { pub use crate::book_test::BookTest;