diff --git a/Cargo.toml b/Cargo.toml index 52218edf..f3b6d117 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,8 @@ members = [ "juniper_codegen", "juniper", - "juniper_tests", + "integration_tests/juniper_tests", + "integration_tests/juniper_2018_edition_tests", "juniper_hyper", "juniper_iron", "juniper_rocket", diff --git a/integration_tests/juniper_2018_edition_tests/Cargo.toml b/integration_tests/juniper_2018_edition_tests/Cargo.toml new file mode 100644 index 00000000..e228ccc3 --- /dev/null +++ b/integration_tests/juniper_2018_edition_tests/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "juniper_2018_edition_tests" +version = "0.1.0" +authors = ["Christoph Herzog "] +edition = "2018" + +[dependencies] +juniper = { version = "0.11", path = "../../juniper" } diff --git a/integration_tests/juniper_2018_edition_tests/Makefile.toml b/integration_tests/juniper_2018_edition_tests/Makefile.toml new file mode 100644 index 00000000..2eb53565 --- /dev/null +++ b/integration_tests/juniper_2018_edition_tests/Makefile.toml @@ -0,0 +1,16 @@ + +[tasks.build-verbose] +condition = { rust_version = { min = "1.32.0" } } + +[tasks.build-verbose.windows] +condition = { rust_version = { min = "1.32.0" } } + +[tasks.test-verbose] +condition = { rust_version = { min = "1.32.0" } } + +[tasks.test-verbose.windows] +condition = { rust_version = { min = "1.32.0" } } + +[tasks.ci-coverage-flow] +disabled = true + diff --git a/integration_tests/juniper_2018_edition_tests/src/main.rs b/integration_tests/juniper_2018_edition_tests/src/main.rs new file mode 100644 index 00000000..82b6b3da --- /dev/null +++ b/integration_tests/juniper_2018_edition_tests/src/main.rs @@ -0,0 +1,36 @@ +/// A VERY minimal test case that ensures that +/// macros and custom derives work in 2018 edition crates. +/// This can be removed once juniper is refactored to the 2018 edition. + +#[derive(juniper::GraphQLEnum, PartialEq, Eq, Clone, Copy, Debug)] +enum TaskStatus { + Todo, + Done, + Closed, +} + +#[derive(juniper::GraphQLObject, Clone, Debug)] +struct Task { + pub id: i32, + pub status: TaskStatus, + pub title: String, + pub description: Option, +} + +#[derive(juniper::GraphQLInputObject, Clone, Debug)] +struct TaskCreate { + pub title: String, + pub description: Option, +} + +struct Query; + +juniper::graphql_object!(Query: () |&self| { + field task(id: i32) -> Task { + unimplemented!() + } +}); + + +fn main() { +} diff --git a/juniper_tests/Cargo.toml b/integration_tests/juniper_tests/Cargo.toml similarity index 80% rename from juniper_tests/Cargo.toml rename to integration_tests/juniper_tests/Cargo.toml index 5c0d2286..fa300fe0 100644 --- a/juniper_tests/Cargo.toml +++ b/integration_tests/juniper_tests/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" publish = false [dependencies] -juniper = { version = "0.11.0", path = "../juniper" } +juniper = { version = "0.11.0", path = "../../juniper" } serde_json = { version = "1" } [dev-dependencies] diff --git a/juniper_tests/Makefile.toml b/integration_tests/juniper_tests/Makefile.toml similarity index 100% rename from juniper_tests/Makefile.toml rename to integration_tests/juniper_tests/Makefile.toml diff --git a/juniper_tests/src/codegen/derive_enum.rs b/integration_tests/juniper_tests/src/codegen/derive_enum.rs similarity index 100% rename from juniper_tests/src/codegen/derive_enum.rs rename to integration_tests/juniper_tests/src/codegen/derive_enum.rs diff --git a/juniper_tests/src/codegen/derive_input_object.rs b/integration_tests/juniper_tests/src/codegen/derive_input_object.rs similarity index 100% rename from juniper_tests/src/codegen/derive_input_object.rs rename to integration_tests/juniper_tests/src/codegen/derive_input_object.rs diff --git a/juniper_tests/src/codegen/derive_object.rs b/integration_tests/juniper_tests/src/codegen/derive_object.rs similarity index 100% rename from juniper_tests/src/codegen/derive_object.rs rename to integration_tests/juniper_tests/src/codegen/derive_object.rs diff --git a/juniper_tests/src/codegen/mod.rs b/integration_tests/juniper_tests/src/codegen/mod.rs similarity index 100% rename from juniper_tests/src/codegen/mod.rs rename to integration_tests/juniper_tests/src/codegen/mod.rs diff --git a/juniper_tests/src/custom_scalar.rs b/integration_tests/juniper_tests/src/custom_scalar.rs similarity index 100% rename from juniper_tests/src/custom_scalar.rs rename to integration_tests/juniper_tests/src/custom_scalar.rs diff --git a/juniper_tests/src/lib.rs b/integration_tests/juniper_tests/src/lib.rs similarity index 100% rename from juniper_tests/src/lib.rs rename to integration_tests/juniper_tests/src/lib.rs