pub mod deps;
pub mod extdeps;
pub mod ui_tests;
+pub mod unit_tests;
pub mod unstable_book;
-pub mod libcoretest;
fn filter_dirs(path: &Path) -> bool {
let skip = [
+++ /dev/null
-//! Tidy check to ensure `#[test]` is not used directly inside `libcore`.
-//!
-//! `#![no_core]` libraries cannot be tested directly due to duplicating lang
-//! item. All tests must be written externally in `libcore/tests`.
-
-use std::path::Path;
-
-pub fn check(path: &Path, bad: &mut bool) {
- let libcore_path = path.join("libcore");
- super::walk(
- &libcore_path,
- &mut |subpath| t!(subpath.strip_prefix(&libcore_path)).starts_with("tests"),
- &mut |entry, contents| {
- let subpath = entry.path();
- if let Some("rs") = subpath.extension().and_then(|e| e.to_str()) {
- let contents = contents.trim();
- if !contents.starts_with("//") && contents.contains("#[test]") {
- tidy_error!(
- bad,
- "`{}` contains `#[test]`; libcore tests must be placed inside \
- `src/libcore/tests/`",
- subpath.display()
- );
- }
- }
- },
- );
-}
let collected = features::check(&path, &mut bad, verbose);
pal::check(&path, &mut bad);
unstable_book::check(&path, collected, &mut bad);
- libcoretest::check(&path, &mut bad);
+ unit_tests::check(&path, &mut bad);
if !args.iter().any(|s| *s == "--no-vendor") {
deps::check(&path, &mut bad);
}
--- /dev/null
+//! Tidy check to ensure `#[test]` is not used directly inside `libcore`.
+//!
+//! `#![no_core]` libraries cannot be tested directly due to duplicating lang
+//! item. All tests must be written externally in `libcore/tests`.
+
+use std::path::Path;
+
+pub fn check(path: &Path, bad: &mut bool) {
+ let libcore_path = path.join("libcore");
+ super::walk(
+ &libcore_path,
+ &mut |subpath| t!(subpath.strip_prefix(&libcore_path)).starts_with("tests"),
+ &mut |entry, contents| {
+ let subpath = entry.path();
+ if let Some("rs") = subpath.extension().and_then(|e| e.to_str()) {
+ let contents = contents.trim();
+ if !contents.starts_with("//") && contents.contains("#[test]") {
+ tidy_error!(
+ bad,
+ "`{}` contains `#[test]`; libcore tests must be placed inside \
+ `src/libcore/tests/`",
+ subpath.display()
+ );
+ }
+ }
+ },
+ );
+}