1515
1616extern crate proc_macro;
1717
18+ #[ cfg( not( test) ) ]
1819mod benchmark;
20+ #[ cfg( not( test) ) ]
1921mod construct_runtime;
22+ #[ cfg( not( test) ) ]
2023mod crate_version;
24+ #[ cfg( not( test) ) ]
2125mod derive_impl;
26+ #[ cfg( not( test) ) ]
2227mod dummy_part_checker;
28+ #[ cfg( not( test) ) ]
2329mod dynamic_params;
30+ #[ cfg( not( test) ) ]
2431mod key_prefix;
32+ #[ cfg( not( test) ) ]
2533mod match_and_insert;
34+ #[ cfg( not( test) ) ]
2635mod no_bound;
36+ #[ cfg( not( test) ) ]
2737mod pallet;
38+ #[ cfg( not( test) ) ]
2839mod pallet_error;
40+ #[ cfg( not( test) ) ]
2941mod runtime;
42+ #[ cfg( not( test) ) ]
3043mod storage_alias;
44+ #[ cfg( not( test) ) ]
3145mod transactional;
46+ #[ cfg( not( test) ) ]
3247mod tt_macro;
33-
48+ # [ cfg ( not ( test ) ) ]
3449use std:: { cell:: RefCell , str:: FromStr } ;
3550
51+ #[ cfg( not( test) ) ]
3652pub ( crate ) const INHERENT_INSTANCE_NAME : & str = "__InherentHiddenInstance" ;
3753
3854/// The number of module instances supported by the runtime, starting at index 1,
3955/// and up to `NUMBER_OF_INSTANCE`.
56+ #[ cfg( not( test) ) ]
4057pub ( crate ) const NUMBER_OF_INSTANCE : u8 = 16 ;
4158
4259thread_local ! {
4360 /// A global counter, can be used to generate a relatively unique identifier.
61+ #[ cfg( not( test) ) ]
4462 static COUNTER : RefCell <Counter > = const { RefCell :: new( Counter ( 0 ) ) } ;
4563}
4664
4765/// Counter to generate a relatively unique identifier for macros. This is necessary because
4866/// declarative macros gets hoisted to the crate root, which shares the namespace with other pallets
4967/// containing the very same macros.
68+ #[ cfg( not( test) ) ]
5069struct Counter ( u64 ) ;
5170
71+ #[ cfg( not( test) ) ]
5272impl Counter {
5373 fn inc ( & mut self ) -> u64 {
5474 let ret = self . 0 ;
@@ -60,6 +80,7 @@ impl Counter {
6080/// Get the value from the given environment variable set by cargo.
6181///
6282/// The value is parsed into the requested destination type.
83+ #[ cfg( not( test) ) ]
6384fn get_cargo_env_var < T : FromStr > ( version_env : & str ) -> std:: result:: Result < T , ( ) > {
6485 let version = std:: env:: var ( version_env)
6586 . unwrap_or_else ( |_| panic ! ( "`{}` is always set by cargo; qed" , version_env) ) ;
@@ -69,10 +90,12 @@ fn get_cargo_env_var<T: FromStr>(version_env: &str) -> std::result::Result<T, ()
6990
7091/// Generate the counter_prefix related to the storage.
7192/// counter_prefix is used by counted storage map.
93+ #[ cfg( not( test) ) ]
7294fn counter_prefix ( prefix : & str ) -> String {
7395 format ! ( "CounterFor{}" , prefix)
7496}
7597
98+ #[ cfg( not( test) ) ]
7699pub mod exports {
77100 pub mod benchmark {
78101 pub use crate :: benchmark:: * ;
0 commit comments