diff --git a/micronfig/src/lib.rs b/micronfig/src/lib.rs index 328d9b0..3ae1096 100644 --- a/micronfig/src/lib.rs +++ b/micronfig/src/lib.rs @@ -6,3 +6,5 @@ pub mod envvars; pub mod envfiles; #[cfg(feature = "envdot")] pub mod envdot; + +pub use micronfig_macros::config; diff --git a/micronfig_macros/Cargo.toml b/micronfig_macros/Cargo.toml index 656dfc6..842ec42 100644 --- a/micronfig_macros/Cargo.toml +++ b/micronfig_macros/Cargo.toml @@ -17,5 +17,9 @@ rustdoc-args = ["--document-private-items"] syn = "2.0" quote = "1.0" +[dev-dependencies] +trybuild = "1.0" +micronfig = { version = "0.3.0", path = "../micronfig" } + [lib] proc-macro = true diff --git a/micronfig_macros/tests/configs/01-three-strings.rs b/micronfig_macros/tests/configs/01-three-strings.rs new file mode 100644 index 0000000..8044b7a --- /dev/null +++ b/micronfig_macros/tests/configs/01-three-strings.rs @@ -0,0 +1,7 @@ +use micronfig; + +config! { + GARAS: String, + AUTO: String, + BUS: String, +} diff --git a/micronfig_macros/tests/configs/02-zero-strings.rs b/micronfig_macros/tests/configs/02-zero-strings.rs new file mode 100644 index 0000000..cd5a9eb --- /dev/null +++ b/micronfig_macros/tests/configs/02-zero-strings.rs @@ -0,0 +1,3 @@ +use micronfig; + +config! {} diff --git a/micronfig_macros/tests/trybuild.rs b/micronfig_macros/tests/trybuild.rs new file mode 100644 index 0000000..12ddc35 --- /dev/null +++ b/micronfig_macros/tests/trybuild.rs @@ -0,0 +1,5 @@ +#[test] +fn trybuild() { + let t = trybuild::TestCases::new(); + t.pass("tests/configs/*.rs"); +}