test_tools/
lib.rs

1// #![ cfg_attr( feature = "no_std", no_std ) ]
2#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ]
3#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ]
4#![ doc( html_root_url = "https://docs.rs/test_tools/latest/test_tools/" ) ]
5#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ]
6
7// xxx : remove
8//! ```rust
9//! println!("-- doc test: printing Cargo feature environment variables --");
10//! for (key, val) in std::env::vars() {
11//!     if key.starts_with("CARGO_FEATURE_") {
12//!         println!("{}={}", key, val);
13//!     }
14//! }
15//! ```
16
17// xxx2 : try to repurpose top-level lib.rs fiel for only top level features
18
19/// Namespace with dependencies.
20#[ allow( unused_imports ) ]
21#[ cfg( feature = "enabled" ) ]
22#[ cfg( not( feature = "doctest" ) ) ]
23pub mod dependency
24{
25
26  // // zzz : exclude later
27  // #[ doc( inline ) ]
28  // pub use ::paste;
29  #[ doc( inline ) ]
30  pub use ::trybuild;
31  #[ doc( inline ) ]
32  pub use ::rustversion;
33  #[ doc( inline ) ]
34  pub use ::num_traits;
35
36  #[ cfg( all( feature = "standalone_build", not( feature = "normal_build" ) ) ) ]
37  #[ cfg( feature = "standalone_diagnostics_tools" ) ]
38  #[ doc( inline ) ]
39  pub use ::pretty_assertions;
40
41  #[ doc( inline ) ]
42  pub use super::
43  {
44    error_tools,
45    collection_tools,
46    impls_index,
47    mem_tools,
48    typing_tools,
49    diagnostics_tools,
50    // process_tools,
51  };
52
53}
54
55mod private {}
56
57//
58
59// #[ cfg( feature = "enabled" ) ]
60// // #[ cfg( not( feature = "no_std" ) ) ]
61// ::meta_tools::mod_interface!
62// {
63//   // #![ debug ]
64//
65//   own use super::dependency::*;
66//
67//   layer test;
68//
69//   // xxx : comment out
70//   use super::exposed::meta;
71//   use super::exposed::mem;
72//   use super::exposed::typing;
73//   use super::exposed::dt;
74//   use super::exposed::diagnostics;
75//   use super::exposed::collection;
76//   // use super::exposed::process;
77//
78//   // prelude use ::rustversion::{ nightly, stable };
79//
80//   // // xxx : eliminate need to do such things, putting itself to proper category
81//   // exposed use super::test::compiletime;
82//   // exposed use super::test::helper;
83//   // exposed use super::test::smoke_test;
84//
85//   prelude use ::meta_tools as meta;
86//   prelude use ::mem_tools as mem;
87//   prelude use ::typing_tools as typing;
88//   prelude use ::data_type as dt;
89//   prelude use ::diagnostics_tools as diagnostics;
90//   prelude use ::collection_tools as collection;
91//   // prelude use ::process_tools as process;
92//
93//   use ::collection_tools; // xxx : do that for all dependencies
94//
95//   prelude use ::meta_tools::
96//   {
97//     impls,
98//     index,
99//     tests_impls,
100//     tests_impls_optional,
101//     tests_index,
102//   };
103//
104//   prelude use ::typing_tools::{ implements };
105//
106// }
107
108// xxx : use module namespaces
109// #[ cfg( feature = "enabled" ) ]
110// #[ cfg( not( feature = "no_std" ) ) ]
111// pub use test::{ compiletime, helper, smoke_test };
112
113#[ cfg( feature = "enabled" ) ]
114#[ cfg( not( feature = "doctest" ) ) ]
115pub mod test;
116
117/// Aggegating submodules without using cargo, but including their entry files directly.
118///
119/// We don't want to run doctest of included files, because all of the are relative to submodule.
120/// So we disable doctests of such submodules with `#[ cfg( not( doctest ) ) ]`.
121#[ cfg( feature = "enabled" ) ]
122#[ cfg( not( feature = "doctest" ) ) ]
123// #[ cfg( all( feature = "no_std", feature = "use_alloc" ) ) ]
124#[ cfg( all( feature = "standalone_build", not( feature = "normal_build" ) ) ) ]
125// #[ cfg( any( not( doctest ), not( feature = "standalone_build" ) ) ) ]
126mod standalone;
127
128#[ cfg( feature = "enabled" ) ]
129#[ cfg( not( feature = "doctest" ) ) ]
130#[ cfg( all( feature = "standalone_build", not( feature = "normal_build" ) ) ) ]
131pub use standalone::*;
132
133#[ cfg( feature = "enabled" ) ]
134#[ cfg( not( feature = "doctest" ) ) ]
135#[ cfg( not( all( feature = "standalone_build", not( feature = "normal_build" ) ) ) ) ]
136pub use ::
137{
138  error_tools,
139  collection_tools,
140  impls_index,
141  mem_tools,
142  typing_tools,
143  diagnostics_tools,
144};
145
146#[ cfg( feature = "enabled" ) ]
147#[ cfg( not( feature = "doctest" ) ) ]
148#[ cfg( all( feature = "standalone_build", not( feature = "normal_build" ) ) ) ]
149pub use implsindex as impls_index;
150
151#[ cfg( feature = "enabled" ) ]
152#[ cfg( not( feature = "doctest" ) ) ]
153#[ allow( unused_imports ) ]
154pub use ::
155{
156  // process_tools,
157};
158
159#[ cfg( feature = "enabled" ) ]
160#[ cfg( not( feature = "doctest" ) ) ]
161#[ doc( inline ) ]
162#[ allow( unused_imports ) ]
163pub use own::*;
164
165/// Own namespace of the module.
166#[ cfg( feature = "enabled" ) ]
167#[ cfg( not( feature = "doctest" ) ) ]
168#[ allow( unused_imports ) ]
169pub mod own
170{
171  use super::*;
172
173  #[ doc( inline ) ]
174  pub use orphan::*;
175
176  #[ doc( inline ) ]
177  pub use test::own::*;
178
179  #[ doc( inline ) ]
180  pub use
181  {
182    error_tools::orphan::*,
183    collection_tools::orphan::*,
184    impls_index::orphan::*,
185    mem_tools::orphan::*,
186    typing_tools::orphan::*,
187    diagnostics_tools::orphan::*,
188  };
189
190}
191
192/// Shared with parent namespace of the module
193#[ cfg( feature = "enabled" ) ]
194#[ cfg( not( feature = "doctest" ) ) ]
195#[ allow( unused_imports ) ]
196pub mod orphan
197{
198  use super::*;
199
200  #[ doc( inline ) ]
201  pub use exposed::*;
202
203  #[ doc( inline ) ]
204  pub use test::orphan::*;
205
206}
207
208/// Exposed namespace of the module.
209#[ cfg( feature = "enabled" ) ]
210#[ cfg( not( feature = "doctest" ) ) ]
211#[ allow( unused_imports ) ]
212pub mod exposed
213{
214  use super::*;
215
216  #[ doc( inline ) ]
217  pub use prelude::*;
218
219  #[ doc( inline ) ]
220  pub use test::exposed::*;
221
222  #[ doc( inline ) ]
223  pub use
224  {
225    error_tools::exposed::*,
226    collection_tools::exposed::*,
227    impls_index::exposed::*,
228    mem_tools::exposed::*,
229    typing_tools::exposed::*,
230    diagnostics_tools::exposed::*,
231  };
232
233}
234
235/// Prelude to use essentials: `use my_module::prelude::*`.
236#[ cfg( feature = "enabled" ) ]
237#[ cfg( not( feature = "doctest" ) ) ]
238#[ allow( unused_imports ) ]
239pub mod prelude
240{
241  use super::*;
242
243  #[ doc( inline ) ]
244  pub use test::prelude::*;
245
246  pub use ::rustversion::{ nightly, stable };
247
248  #[ doc( inline ) ]
249  pub use
250  {
251    error_tools::prelude::*,
252    collection_tools::prelude::*,
253    impls_index::prelude::*,
254    mem_tools::prelude::*,
255    typing_tools::prelude::*,
256    diagnostics_tools::prelude::*,
257  };
258
259}