Skip to content

Commit 0564138

Browse files
committed
ignore procedural-fork tests via a cfg gate
1 parent c368ce3 commit 0564138

File tree

1 file changed

+24
-1
lines changed
  • support/procedural-fork/src

1 file changed

+24
-1
lines changed

support/procedural-fork/src/lib.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,60 @@
1515

1616
extern crate proc_macro;
1717

18+
#[cfg(not(test))]
1819
mod benchmark;
20+
#[cfg(not(test))]
1921
mod construct_runtime;
22+
#[cfg(not(test))]
2023
mod crate_version;
24+
#[cfg(not(test))]
2125
mod derive_impl;
26+
#[cfg(not(test))]
2227
mod dummy_part_checker;
28+
#[cfg(not(test))]
2329
mod dynamic_params;
30+
#[cfg(not(test))]
2431
mod key_prefix;
32+
#[cfg(not(test))]
2533
mod match_and_insert;
34+
#[cfg(not(test))]
2635
mod no_bound;
36+
#[cfg(not(test))]
2737
mod pallet;
38+
#[cfg(not(test))]
2839
mod pallet_error;
40+
#[cfg(not(test))]
2941
mod runtime;
42+
#[cfg(not(test))]
3043
mod storage_alias;
44+
#[cfg(not(test))]
3145
mod transactional;
46+
#[cfg(not(test))]
3247
mod tt_macro;
33-
48+
#[cfg(not(test))]
3449
use std::{cell::RefCell, str::FromStr};
3550

51+
#[cfg(not(test))]
3652
pub(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))]
4057
pub(crate) const NUMBER_OF_INSTANCE: u8 = 16;
4158

4259
thread_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))]
5069
struct Counter(u64);
5170

71+
#[cfg(not(test))]
5272
impl 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))]
6384
fn 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))]
7294
fn counter_prefix(prefix: &str) -> String {
7395
format!("CounterFor{}", prefix)
7496
}
7597

98+
#[cfg(not(test))]
7699
pub mod exports {
77100
pub mod benchmark {
78101
pub use crate::benchmark::*;

0 commit comments

Comments
 (0)