Rename header -> directives

compiletest has confusingly two terminology to refer to the same concept
-- "headers" and "directives". To make this more self-consistent and
less confusing, stick with "directives" only.

This commit **intentionally** tries to be limited to move-only (modulo
some key usage reference renames) to help git history.
This commit is contained in:
Jieyou Xu 2025-06-30 17:15:32 +08:00
parent 085c24790e
commit cf5788d30d
No known key found for this signature in database
GPG key ID: 045B995028EA6AFC
12 changed files with 12 additions and 12 deletions

View file

@ -13,8 +13,8 @@ use crate::common::{Config, Debugger, FailMode, Mode, PassMode};
use crate::debuggers::{extract_cdb_version, extract_gdb_version};
use crate::errors::ErrorKind;
use crate::executor::{CollectedTestDesc, ShouldPanic};
use crate::header::auxiliary::{AuxProps, parse_and_update_aux};
use crate::header::needs::CachedNeedsConditions;
use crate::directives::auxiliary::{AuxProps, parse_and_update_aux};
use crate::directives::needs::CachedNeedsConditions;
use crate::help;
use crate::util::static_regex;

View file

@ -1,7 +1,7 @@
use std::collections::HashSet;
use crate::common::{CompareMode, Config, Debugger};
use crate::header::IgnoreDecision;
use crate::directives::IgnoreDecision;
const EXTRA_ARCHS: &[&str] = &["spirv"];

View file

@ -1,5 +1,5 @@
use crate::common::{Config, KNOWN_CRATE_TYPES, KNOWN_TARGET_HAS_ATOMIC_WIDTHS, Sanitizer};
use crate::header::{IgnoreDecision, llvm_has_libzstd};
use crate::directives::{IgnoreDecision, llvm_has_libzstd};
pub(super) fn handle_needs(
cache: &CachedNeedsConditions,

View file

@ -19,7 +19,7 @@ fn make_test_description<R: Read>(
) -> CollectedTestDesc {
let cache = HeadersCache::load(config);
let mut poisoned = false;
let test = crate::header::make_test_description(
let test = crate::directives::make_test_description(
config,
&cache,
name,

View file

@ -14,7 +14,7 @@ mod debuggers;
pub mod diagnostics;
pub mod errors;
mod executor;
pub mod header;
pub mod directives;
mod json;
mod raise_fd_limit;
mod read2;
@ -37,13 +37,13 @@ use rayon::iter::{ParallelBridge, ParallelIterator};
use tracing::debug;
use walkdir::WalkDir;
use self::header::{EarlyProps, make_test_description};
use self::directives::{EarlyProps, make_test_description};
use crate::common::{
CompareMode, Config, Debugger, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path,
output_base_dir, output_relative_path,
};
use crate::executor::{CollectedTest, ColorConfig, OutputFormat};
use crate::header::HeadersCache;
use crate::directives::HeadersCache;
use crate::util::logv;
/// Creates the `Config` instance for this invocation of compiletest.
@ -254,8 +254,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
Some(x) => panic!("argument for --color must be auto, always, or never, but found `{}`", x),
};
let llvm_version =
matches.opt_str("llvm-version").as_deref().map(header::extract_llvm_version).or_else(
|| header::extract_llvm_version_from_binary(&matches.opt_str("llvm-filecheck")?),
matches.opt_str("llvm-version").as_deref().map(directives::extract_llvm_version).or_else(
|| directives::extract_llvm_version_from_binary(&matches.opt_str("llvm-filecheck")?),
);
let run_ignored = matches.opt_present("ignored");

View file

@ -24,7 +24,7 @@ use crate::common::{
};
use crate::compute_diff::{DiffLine, make_diff, write_diff, write_filtered_diff};
use crate::errors::{Error, ErrorKind, load_errors};
use crate::header::TestProps;
use crate::directives::TestProps;
use crate::read2::{Truncated, read2_abbreviated};
use crate::util::{Utf8PathBufExt, add_dylib_path, logv, static_regex};
use crate::{ColorConfig, help, json, stamp_file_path, warning};

View file

@ -4,7 +4,7 @@ use std::sync::Arc;
use std::{env, fs};
use build_helper::util::try_run;
use compiletest::header::TestProps;
use compiletest::directives::TestProps;
use config::Config;
mod config;