Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/tools/compiletest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ doctest = false
[[bin]]
name = "compiletest"
path = "src/bin/main.rs"
# The compiletest binary crate is a tiny stub that shouldn't contain any unit
# tests of its own; all of the logic is in the library crate.
test = false

[dependencies]
# tidy-alphabetical-start
Expand Down
12 changes: 9 additions & 3 deletions src/tools/compiletest/src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ mod needs;
mod tests;

pub struct DirectivesCache {
/// "Conditions" used by `ignore-*` and `only-*` directives, prepared in
/// advance so that they don't have to be evaluated repeatedly.
cfg_conditions: cfg::PreparedConditions,
needs: CachedNeedsConditions,
}

impl DirectivesCache {
pub fn load(config: &Config) -> Self {
Self { needs: CachedNeedsConditions::load(config) }
Self {
cfg_conditions: cfg::prepare_conditions(config),
needs: CachedNeedsConditions::load(config),
}
}
}

Expand Down Expand Up @@ -1058,8 +1064,8 @@ pub(crate) fn make_test_description(
};
}

decision!(cfg::handle_ignore(config, ln));
decision!(cfg::handle_only(config, ln));
decision!(cfg::handle_ignore(&cache.cfg_conditions, ln));
decision!(cfg::handle_only(&cache.cfg_conditions, ln));
decision!(needs::handle_needs(&cache.needs, config, ln));
decision!(ignore_llvm(config, ln));
decision!(ignore_backends(config, ln));
Expand Down
Loading
Loading