11// Copyright (c) The nextest Contributors
22// SPDX-License-Identifier: MIT OR Apache-2.0
33
4- use super :: {
5- ArchiveConfig , CompiledByProfile , CompiledData , CompiledDefaultFilter , ConfigExperimental ,
6- CustomTestGroup , DefaultJunitImpl , DeserializedOverride , DeserializedProfileScriptConfig ,
7- GlobalTimeout , JunitConfig , JunitImpl , MaxFail , NextestVersionDeserialize , RetryPolicy ,
8- ScriptConfig , ScriptId , SettingSource , SetupScripts , SlowTimeout , TestGroup , TestGroupConfig ,
9- TestSettings , TestThreads , ThreadsRequired , ToolConfigFile , leak_timeout:: LeakTimeout ,
10- } ;
4+ use super :: { NextestVersionDeserialize , ToolConfigFile } ;
115use crate :: {
12- config:: { ListSettings , ProfileScriptType , ScriptInfo , SetupScriptConfig } ,
6+ config:: {
7+ core:: ConfigExperimental ,
8+ elements:: {
9+ ArchiveConfig , CustomTestGroup , DefaultJunitImpl , GlobalTimeout , JunitConfig ,
10+ JunitImpl , LeakTimeout , MaxFail , RetryPolicy , SlowTimeout , TestGroup , TestGroupConfig ,
11+ TestThreads , ThreadsRequired , deserialize_fail_fast, deserialize_leak_timeout,
12+ deserialize_retry_policy, deserialize_slow_timeout,
13+ } ,
14+ overrides:: {
15+ CompiledByProfile , CompiledData , CompiledDefaultFilter , DeserializedOverride ,
16+ ListSettings , SettingSource , TestSettings ,
17+ } ,
18+ scripts:: {
19+ DeserializedProfileScriptConfig , ProfileScriptType , ScriptConfig , ScriptId , ScriptInfo ,
20+ SetupScriptConfig , SetupScripts ,
21+ } ,
22+ } ,
1323 errors:: {
1424 ConfigParseError , ConfigParseErrorKind , ProfileListScriptUsesRunFiltersError ,
1525 ProfileNotFound , ProfileScriptErrors , ProfileUnknownScriptError ,
@@ -206,7 +216,7 @@ impl NextestConfig {
206216 /// Contains the default config as a TOML file.
207217 ///
208218 /// Repository-specific configuration is layered on top of the default config.
209- pub const DEFAULT_CONFIG : & ' static str = include_str ! ( "../../default-config.toml" ) ;
219+ pub const DEFAULT_CONFIG : & ' static str = include_str ! ( "../../../ default-config.toml" ) ;
210220
211221 /// Environment configuration uses this prefix, plus a _.
212222 pub const ENVIRONMENT_PREFIX : & ' static str = "NEXTEST" ;
@@ -840,19 +850,19 @@ impl NextestConfig {
840850
841851/// The state of nextest profiles before build platforms have been applied.
842852#[ derive( Clone , Debug , Default ) ]
843- pub ( super ) struct PreBuildPlatform { }
853+ pub ( in crate :: config ) struct PreBuildPlatform { }
844854
845855/// The state of nextest profiles after build platforms have been applied.
846856#[ derive( Clone , Debug ) ]
847857pub ( crate ) struct FinalConfig {
848858 // Evaluation result for host_spec on the host platform.
849- pub ( super ) host_eval : bool ,
859+ pub ( in crate :: config ) host_eval : bool ,
850860 // Evaluation result for target_spec corresponding to tests that run on the host platform (e.g.
851861 // proc-macro tests).
852- pub ( super ) host_test_eval : bool ,
862+ pub ( in crate :: config ) host_test_eval : bool ,
853863 // Evaluation result for target_spec corresponding to tests that run on the target platform
854864 // (most regular tests).
855- pub ( super ) target_eval : bool ,
865+ pub ( in crate :: config ) target_eval : bool ,
856866}
857867
858868/// A nextest profile that can be obtained without identifying the host and
@@ -868,7 +878,7 @@ pub struct EarlyProfile<'cfg> {
868878 // This is ordered because the scripts are used in the order they're defined.
869879 scripts : & ' cfg ScriptConfig ,
870880 // Invariant: `compiled_data.default_filter` is always present.
871- pub ( super ) compiled_data : CompiledData < PreBuildPlatform > ,
881+ pub ( in crate :: config ) compiled_data : CompiledData < PreBuildPlatform > ,
872882}
873883
874884impl < ' cfg > EarlyProfile < ' cfg > {
@@ -935,7 +945,7 @@ pub struct EvaluatableProfile<'cfg> {
935945 // This is ordered because the scripts are used in the order they're defined.
936946 scripts : & ' cfg ScriptConfig ,
937947 // Invariant: `compiled_data.default_filter` is always present.
938- pub ( super ) compiled_data : CompiledData < FinalConfig > ,
948+ pub ( in crate :: config ) compiled_data : CompiledData < FinalConfig > ,
939949 // The default filter that's been resolved after considering overrides (i.e.
940950 // platforms).
941951 resolved_default_filter : CompiledDefaultFilter ,
@@ -1099,13 +1109,13 @@ impl<'cfg> EvaluatableProfile<'cfg> {
10991109 }
11001110
11011111 #[ cfg( test) ]
1102- pub ( super ) fn custom_profile ( & self ) -> Option < & ' cfg CustomProfileImpl > {
1112+ pub ( in crate :: config ) fn custom_profile ( & self ) -> Option < & ' cfg CustomProfileImpl > {
11031113 self . custom_profile
11041114 }
11051115}
11061116
11071117#[ derive( Clone , Debug ) ]
1108- pub ( super ) struct NextestConfigImpl {
1118+ pub ( in crate :: config ) struct NextestConfigImpl {
11091119 store : StoreConfigImpl ,
11101120 test_groups : BTreeMap < CustomTestGroup , TestGroupConfig > ,
11111121 scripts : ScriptConfig ,
@@ -1133,11 +1143,13 @@ impl NextestConfigImpl {
11331143 . chain ( std:: iter:: once ( NextestConfig :: DEFAULT_PROFILE ) )
11341144 }
11351145
1136- pub ( super ) fn default_profile ( & self ) -> & DefaultProfileImpl {
1146+ pub ( in crate :: config ) fn default_profile ( & self ) -> & DefaultProfileImpl {
11371147 & self . default_profile
11381148 }
11391149
1140- pub ( super ) fn other_profiles ( & self ) -> impl Iterator < Item = ( & str , & CustomProfileImpl ) > {
1150+ pub ( in crate :: config) fn other_profiles (
1151+ & self ,
1152+ ) -> impl Iterator < Item = ( & str , & CustomProfileImpl ) > {
11411153 self . other_profiles
11421154 . iter ( )
11431155 . map ( |( key, value) | ( key. as_str ( ) , value) )
@@ -1205,7 +1217,7 @@ struct StoreConfigImpl {
12051217}
12061218
12071219#[ derive( Clone , Debug ) ]
1208- pub ( super ) struct DefaultProfileImpl {
1220+ pub ( in crate :: config ) struct DefaultProfileImpl {
12091221 default_filter : String ,
12101222 test_threads : TestThreads ,
12111223 threads_required : ThreadsRequired ,
@@ -1270,26 +1282,26 @@ impl DefaultProfileImpl {
12701282 }
12711283 }
12721284
1273- pub ( super ) fn default_filter ( & self ) -> & str {
1285+ pub ( in crate :: config ) fn default_filter ( & self ) -> & str {
12741286 & self . default_filter
12751287 }
12761288
1277- pub ( super ) fn overrides ( & self ) -> & [ DeserializedOverride ] {
1289+ pub ( in crate :: config ) fn overrides ( & self ) -> & [ DeserializedOverride ] {
12781290 & self . overrides
12791291 }
12801292
1281- pub ( super ) fn setup_scripts ( & self ) -> & [ DeserializedProfileScriptConfig ] {
1293+ pub ( in crate :: config ) fn setup_scripts ( & self ) -> & [ DeserializedProfileScriptConfig ] {
12821294 & self . scripts
12831295 }
12841296}
12851297
12861298#[ derive( Clone , Debug , Deserialize ) ]
12871299#[ serde( rename_all = "kebab-case" ) ]
1288- pub ( super ) struct CustomProfileImpl {
1300+ pub ( in crate :: config ) struct CustomProfileImpl {
12891301 /// The default set of tests run by `cargo nextest run`.
12901302 #[ serde( default ) ]
12911303 default_filter : Option < String > ,
1292- #[ serde( default , deserialize_with = "super:: deserialize_retry_policy" ) ]
1304+ #[ serde( default , deserialize_with = "deserialize_retry_policy" ) ]
12931305 retries : Option < RetryPolicy > ,
12941306 #[ serde( default ) ]
12951307 test_threads : Option < TestThreads > ,
@@ -1308,14 +1320,14 @@ pub(super) struct CustomProfileImpl {
13081320 #[ serde(
13091321 default ,
13101322 rename = "fail-fast" ,
1311- deserialize_with = "super:: deserialize_fail_fast"
1323+ deserialize_with = "deserialize_fail_fast"
13121324 ) ]
13131325 max_fail : Option < MaxFail > ,
1314- #[ serde( default , deserialize_with = "super:: deserialize_slow_timeout" ) ]
1326+ #[ serde( default , deserialize_with = "deserialize_slow_timeout" ) ]
13151327 slow_timeout : Option < SlowTimeout > ,
13161328 #[ serde( default ) ]
13171329 global_timeout : Option < GlobalTimeout > ,
1318- #[ serde( default , deserialize_with = "super:: deserialize_leak_timeout" ) ]
1330+ #[ serde( default , deserialize_with = "deserialize_leak_timeout" ) ]
13191331 leak_timeout : Option < LeakTimeout > ,
13201332 #[ serde( default ) ]
13211333 overrides : Vec < DeserializedOverride > ,
@@ -1329,27 +1341,27 @@ pub(super) struct CustomProfileImpl {
13291341
13301342impl CustomProfileImpl {
13311343 #[ cfg( test) ]
1332- pub ( super ) fn test_threads ( & self ) -> Option < TestThreads > {
1344+ pub ( in crate :: config ) fn test_threads ( & self ) -> Option < TestThreads > {
13331345 self . test_threads
13341346 }
13351347
1336- pub ( super ) fn default_filter ( & self ) -> Option < & str > {
1348+ pub ( in crate :: config ) fn default_filter ( & self ) -> Option < & str > {
13371349 self . default_filter . as_deref ( )
13381350 }
13391351
1340- pub ( super ) fn overrides ( & self ) -> & [ DeserializedOverride ] {
1352+ pub ( in crate :: config ) fn overrides ( & self ) -> & [ DeserializedOverride ] {
13411353 & self . overrides
13421354 }
13431355
1344- pub ( super ) fn scripts ( & self ) -> & [ DeserializedProfileScriptConfig ] {
1356+ pub ( in crate :: config ) fn scripts ( & self ) -> & [ DeserializedProfileScriptConfig ] {
13451357 & self . scripts
13461358 }
13471359}
13481360
13491361#[ cfg( test) ]
13501362mod tests {
13511363 use super :: * ;
1352- use crate :: config:: test_helpers:: * ;
1364+ use crate :: config:: utils :: test_helpers:: * ;
13531365 use camino_tempfile:: tempdir;
13541366 use iddqd:: { IdHashItem , IdHashMap , id_hash_map, id_upcast} ;
13551367
0 commit comments