Skip to content

Commit

Permalink
Merge pull request #1222 from YuliaProkopovych/derive-tools-tests
Browse files Browse the repository at this point in the history
NOT READY(derive_tools): Fix tests
  • Loading branch information
Wandalen authored Apr 8, 2024
2 parents c76beef + 30027e6 commit 43475cd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
13 changes: 6 additions & 7 deletions module/core/derive_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ default = [
"derive_clone_dyn",
# "derive_clone_dyn_use_std",

"strum_derive",
"derive_strum",
"strum_phf",

"derive_from",
Expand Down Expand Up @@ -102,11 +102,11 @@ full = [

"derive_display",
"derive_from_str",

"derive_clone_dyn",
# "derive_clone_dyn_use_std",

"strum_derive",
"derive_strum",
"strum_phf",

"derive_from",
Expand Down Expand Up @@ -159,7 +159,7 @@ derive_display = [ "parse-display" ]
derive_from_str = [ "parse-display", "parse-display/std", "parse-display/regex" ]
# derive_from_str = [ "parse-display", "parse-display/std", "parse-display/regex", "parse-display/once_cell" ]

strum_derive = [ "strum/std", "strum/derive", "strum/strum_macros" ]
derive_strum = [ "strum/std", "strum/derive", "strum/strum_macros" ]
strum_phf = [ "strum/std", "strum/phf", "strum/strum_macros" ]
# zzz : review features

Expand All @@ -170,13 +170,12 @@ derive_clone_dyn_use_alloc = [ "derive_clone_dyn", "clone_dyn/use_alloc" ]

derive_from = [ "derive_tools_meta/derive_from" ]
derive_inner_from = [ "derive_tools_meta/derive_inner_from" ]

parse_display = [ "parse-display" ]

[dependencies]

## external
# derive_more = { version = "~0.99.17", optional = true, default-features = false }
derive_more = { version = "~1.0.0-beta.6", optional = true, default-features = false }
derive_more = { version = "~1.0.0-beta.6", optional = true, default-features = false, features = [ "debug" ] }
strum = { version = "~0.25", optional = true, default-features = false }
# strum_macros = { version = "~0.25.3", optional = true, default-features = false }
parse-display = { version = "~0.8.2", optional = true, default-features = false }
Expand Down
17 changes: 13 additions & 4 deletions module/core/derive_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ mod derive_more
// #[ cfg( feature = "derive_reflect" ) ]
// pub mod reflect;

// use derive_tools_meta::Deref;
// use derive_tools_meta::Deref;
// use derive_tools_meta::VariadicFrom;

/// Namespace with dependencies.
Expand All @@ -66,7 +66,7 @@ pub mod dependency
{
#[ cfg( feature = "derive_more" ) ]
pub use ::derive_more;
#[ cfg( feature = "strum" ) ]
#[ cfg( feature = "derive_strum" ) ]
pub use ::strum;
#[ cfg( feature = "parse_display" ) ]
pub use ::parse_display;
Expand Down Expand Up @@ -125,6 +125,11 @@ pub mod exposed
#[ allow( unused_imports ) ]
pub use super::derive_more::*;

#[ cfg( feature = "derive_strum" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::strum::*;

// #[ cfg( all( feature = "derive_more", feature = "derive_add" ) ) ]
// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
Expand Down Expand Up @@ -188,7 +193,7 @@ pub mod exposed
// UpperHex,
// };

#[ cfg( feature = "strum" ) ]
#[ cfg( feature = "derive_strum" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use ::strum::*;
Expand Down Expand Up @@ -227,13 +232,17 @@ pub mod exposed
#[ cfg( feature = "derive_from" ) ]
pub use ::derive_tools_meta::From;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
#[ cfg( feature = "derive_inner_from" ) ]
pub use ::derive_tools_meta::InnerFrom;

}

/// Prelude to use essentials: `use my_module::prelude::*`.
#[ cfg( feature = "enabled" ) ]
pub mod prelude
{

#[ cfg( feature = "derive_clone_dyn" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
Expand Down
2 changes: 1 addition & 1 deletion module/core/derive_tools/tests/inc/basic_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tests_impls!
#[ cfg( all( feature = "strum", feature = "strum_derive" ) ) ]
fn enum_with_strum()
{
use the_module::*;
use the_module::{ EnumIter, IntoEnumIterator };

#[ derive( EnumIter, Debug, PartialEq ) ]
enum Foo
Expand Down
1 change: 1 addition & 0 deletions module/core/derive_tools/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ use derive_tools as the_module;
#[ allow( unused_imports ) ]
use test_tools::exposed::*;

#[ cfg( feature = "enabled" ) ]
mod inc;

2 changes: 1 addition & 1 deletion module/core/wtools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ derive_is_variant = [ "derive", "derive_tools/derive_is_variant" ]
derive_unwrap = [ "derive", "derive_tools/derive_unwrap" ]
# derive_convert_case = [ "derive", "derive_tools/derive_convert_case" ]

derive_strum = [ "derive", "derive_tools/strum_derive" ]
derive_strum = [ "derive", "derive_tools/derive_strum" ]
derive_strum_phf = [ "derive", "derive_tools/strum_phf" ]

derive_display = [ "derive", "derive_tools/derive_display", "parse-display" ]
Expand Down

0 comments on commit 43475cd

Please sign in to comment.