From e11f3d11ed16a2ef14c8ac87fbc17ad612d7ff1c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 11 Apr 2017 21:10:13 -0700 Subject: [PATCH] Combine serde_json and tests into one crate --- Cargo.toml | 36 ++++++++++++++++--- json/Cargo.toml | 30 ---------------- json/LICENSE-APACHE | 1 - json/LICENSE-MIT | 1 - json/README.md | 1 - json_tests/Cargo.toml | 18 ---------- {json/src => src}/de.rs | 0 {json/src => src}/error.rs | 0 {json/src => src}/iter.rs | 0 {json/src => src}/lib.rs | 0 {json/src => src}/macros.rs | 0 {json/src => src}/map.rs | 0 {json/src => src}/number.rs | 0 {json/src => src}/read.rs | 0 {json/src => src}/ser.rs | 0 {json/src => src}/value.rs | 0 {json_tests/tests => tests}/compiletest.rs | 4 +-- {json_tests => tests}/deps/Cargo.toml | 2 +- {json_tests => tests}/deps/src/lib.rs | 0 {json_tests/tests => tests}/macros.rs | 0 {json_tests/tests => tests}/test.rs | 0 .../tests => tests}/ui/missing_colon.rs | 0 .../tests => tests}/ui/missing_colon.stderr | 0 .../tests => tests}/ui/missing_value.rs | 0 .../tests => tests}/ui/missing_value.stderr | 0 {json_tests/tests => tests}/ui/not_found.rs | 0 .../tests => tests}/ui/not_found.stderr | 0 {json_tests/tests => tests}/ui/parse_expr.rs | 0 .../tests => tests}/ui/parse_expr.stderr | 0 {json_tests/tests => tests}/ui/parse_key.rs | 0 .../tests => tests}/ui/parse_key.stderr | 0 .../tests => tests}/ui/unexpected_colon.rs | 0 .../ui/unexpected_colon.stderr | 0 .../tests => tests}/ui/unexpected_comma.rs | 0 .../ui/unexpected_comma.stderr | 0 .../tests => tests}/ui/update-references.sh | 0 travis.sh | 13 ++----- 37 files changed, 35 insertions(+), 71 deletions(-) delete mode 100644 json/Cargo.toml delete mode 120000 json/LICENSE-APACHE delete mode 120000 json/LICENSE-MIT delete mode 120000 json/README.md delete mode 100644 json_tests/Cargo.toml rename {json/src => src}/de.rs (100%) rename {json/src => src}/error.rs (100%) rename {json/src => src}/iter.rs (100%) rename {json/src => src}/lib.rs (100%) rename {json/src => src}/macros.rs (100%) rename {json/src => src}/map.rs (100%) rename {json/src => src}/number.rs (100%) rename {json/src => src}/read.rs (100%) rename {json/src => src}/ser.rs (100%) rename {json/src => src}/value.rs (100%) rename {json_tests/tests => tests}/compiletest.rs (78%) rename {json_tests => tests}/deps/Cargo.toml (80%) rename {json_tests => tests}/deps/src/lib.rs (100%) rename {json_tests/tests => tests}/macros.rs (100%) rename {json_tests/tests => tests}/test.rs (100%) rename {json_tests/tests => tests}/ui/missing_colon.rs (100%) rename {json_tests/tests => tests}/ui/missing_colon.stderr (100%) rename {json_tests/tests => tests}/ui/missing_value.rs (100%) rename {json_tests/tests => tests}/ui/missing_value.stderr (100%) rename {json_tests/tests => tests}/ui/not_found.rs (100%) rename {json_tests/tests => tests}/ui/not_found.stderr (100%) rename {json_tests/tests => tests}/ui/parse_expr.rs (100%) rename {json_tests/tests => tests}/ui/parse_expr.stderr (100%) rename {json_tests/tests => tests}/ui/parse_key.rs (100%) rename {json_tests/tests => tests}/ui/parse_key.stderr (100%) rename {json_tests/tests => tests}/ui/unexpected_colon.rs (100%) rename {json_tests/tests => tests}/ui/unexpected_colon.stderr (100%) rename {json_tests/tests => tests}/ui/unexpected_comma.rs (100%) rename {json_tests/tests => tests}/ui/unexpected_comma.stderr (100%) rename {json_tests/tests => tests}/ui/update-references.sh (100%) diff --git a/Cargo.toml b/Cargo.toml index ed69eec..e7c52d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,31 @@ -[workspace] -members = [ - "json", - "json_tests", -] +[package] +name = "serde_json" +version = "0.9.10" +authors = ["Erick Tryzelaar "] +license = "MIT/Apache-2.0" +description = "A JSON serialization file format" +repository = "https://github.com/serde-rs/json" +documentation = "http://docs.serde.rs/serde_json/" +keywords = ["json", "serde", "serialization"] +categories = ["encoding"] +readme = "../README.md" +include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] +publish = false # this branch contains breaking changes + +[badges] +travis-ci = { repository = "serde-rs/json" } + +[features] +preserve_order = ["linked-hash-map"] + +[dependencies] +serde = { git = "https://github.com/serde-rs/serde", branch = "1.0" } +num-traits = "0.1.32" +linked-hash-map = { version = "0.4.1", optional = true } +itoa = "0.3" +dtoa = "0.4" + +[dev-dependencies] +compiletest_rs = "0.2" +serde_bytes = { git = "https://github.com/serde-rs/bytes", branch = "1.0" } +serde_derive = { git = "https://github.com/serde-rs/serde", branch = "1.0" } diff --git a/json/Cargo.toml b/json/Cargo.toml deleted file mode 100644 index 6c3f8b0..0000000 --- a/json/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "serde_json" -version = "0.9.10" -authors = ["Erick Tryzelaar "] -license = "MIT/Apache-2.0" -description = "A JSON serialization file format" -repository = "https://github.com/serde-rs/json" -documentation = "http://docs.serde.rs/serde_json/" -keywords = ["json", "serde", "serialization"] -categories = ["encoding"] -readme = "../README.md" -include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] -publish = false # this branch contains breaking changes - -[badges] -travis-ci = { repository = "serde-rs/json" } - -[features] -preserve_order = ["linked-hash-map"] - -[dependencies] -serde = { git = "https://github.com/serde-rs/serde", branch = "1.0" } -num-traits = "0.1.32" -linked-hash-map = { version = "0.4.1", optional = true } -itoa = "0.3" -dtoa = "0.4" - -[dev-dependencies] -serde_bytes = { git = "https://github.com/serde-rs/bytes", branch = "1.0" } -serde_derive = { git = "https://github.com/serde-rs/serde", branch = "1.0" } diff --git a/json/LICENSE-APACHE b/json/LICENSE-APACHE deleted file mode 120000 index 965b606..0000000 --- a/json/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-APACHE \ No newline at end of file diff --git a/json/LICENSE-MIT b/json/LICENSE-MIT deleted file mode 120000 index 76219eb..0000000 --- a/json/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-MIT \ No newline at end of file diff --git a/json/README.md b/json/README.md deleted file mode 120000 index 32d46ee..0000000 --- a/json/README.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/json_tests/Cargo.toml b/json_tests/Cargo.toml deleted file mode 100644 index e3c2711..0000000 --- a/json_tests/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "serde_json_tests" -version = "0.0.0" -authors = ["Erick Tryzelaar "] -publish = false - -[features] -trace-macros = [] -unstable-testing = ["compiletest_rs"] - -[dev-dependencies] -serde = { git = "https://github.com/serde-rs/serde", branch = "1.0" } -serde_bytes = { git = "https://github.com/serde-rs/bytes", branch = "1.0" } -serde_json = { path = "../json" } -serde_derive = { git = "https://github.com/serde-rs/serde", branch = "1.0" } - -[dependencies] -compiletest_rs = { version = "0.2", optional = true } diff --git a/json/src/de.rs b/src/de.rs similarity index 100% rename from json/src/de.rs rename to src/de.rs diff --git a/json/src/error.rs b/src/error.rs similarity index 100% rename from json/src/error.rs rename to src/error.rs diff --git a/json/src/iter.rs b/src/iter.rs similarity index 100% rename from json/src/iter.rs rename to src/iter.rs diff --git a/json/src/lib.rs b/src/lib.rs similarity index 100% rename from json/src/lib.rs rename to src/lib.rs diff --git a/json/src/macros.rs b/src/macros.rs similarity index 100% rename from json/src/macros.rs rename to src/macros.rs diff --git a/json/src/map.rs b/src/map.rs similarity index 100% rename from json/src/map.rs rename to src/map.rs diff --git a/json/src/number.rs b/src/number.rs similarity index 100% rename from json/src/number.rs rename to src/number.rs diff --git a/json/src/read.rs b/src/read.rs similarity index 100% rename from json/src/read.rs rename to src/read.rs diff --git a/json/src/ser.rs b/src/ser.rs similarity index 100% rename from json/src/ser.rs rename to src/ser.rs diff --git a/json/src/value.rs b/src/value.rs similarity index 100% rename from json/src/value.rs rename to src/value.rs diff --git a/json_tests/tests/compiletest.rs b/tests/compiletest.rs similarity index 78% rename from json_tests/tests/compiletest.rs rename to tests/compiletest.rs index f6585b9..2fa1bb6 100644 --- a/json_tests/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -1,5 +1,3 @@ -#![cfg(feature = "unstable-testing")] - extern crate compiletest_rs as compiletest; use std::env; @@ -8,7 +6,7 @@ fn run_mode(mode: &'static str) { let mut config = compiletest::default_config(); config.mode = mode.parse().expect("invalid mode"); - config.target_rustcflags = Some("-L deps/target/debug/deps".to_owned()); + config.target_rustcflags = Some("-L tests/deps/target/debug/deps".to_owned()); if let Ok(name) = env::var("TESTNAME") { config.filter = Some(name); } diff --git a/json_tests/deps/Cargo.toml b/tests/deps/Cargo.toml similarity index 80% rename from json_tests/deps/Cargo.toml rename to tests/deps/Cargo.toml index 6bf64b5..5af31f6 100644 --- a/json_tests/deps/Cargo.toml +++ b/tests/deps/Cargo.toml @@ -7,4 +7,4 @@ publish = false [workspace] [dependencies] -serde_json = { path = "../../json" } +serde_json = { path = "../.." } diff --git a/json_tests/deps/src/lib.rs b/tests/deps/src/lib.rs similarity index 100% rename from json_tests/deps/src/lib.rs rename to tests/deps/src/lib.rs diff --git a/json_tests/tests/macros.rs b/tests/macros.rs similarity index 100% rename from json_tests/tests/macros.rs rename to tests/macros.rs diff --git a/json_tests/tests/test.rs b/tests/test.rs similarity index 100% rename from json_tests/tests/test.rs rename to tests/test.rs diff --git a/json_tests/tests/ui/missing_colon.rs b/tests/ui/missing_colon.rs similarity index 100% rename from json_tests/tests/ui/missing_colon.rs rename to tests/ui/missing_colon.rs diff --git a/json_tests/tests/ui/missing_colon.stderr b/tests/ui/missing_colon.stderr similarity index 100% rename from json_tests/tests/ui/missing_colon.stderr rename to tests/ui/missing_colon.stderr diff --git a/json_tests/tests/ui/missing_value.rs b/tests/ui/missing_value.rs similarity index 100% rename from json_tests/tests/ui/missing_value.rs rename to tests/ui/missing_value.rs diff --git a/json_tests/tests/ui/missing_value.stderr b/tests/ui/missing_value.stderr similarity index 100% rename from json_tests/tests/ui/missing_value.stderr rename to tests/ui/missing_value.stderr diff --git a/json_tests/tests/ui/not_found.rs b/tests/ui/not_found.rs similarity index 100% rename from json_tests/tests/ui/not_found.rs rename to tests/ui/not_found.rs diff --git a/json_tests/tests/ui/not_found.stderr b/tests/ui/not_found.stderr similarity index 100% rename from json_tests/tests/ui/not_found.stderr rename to tests/ui/not_found.stderr diff --git a/json_tests/tests/ui/parse_expr.rs b/tests/ui/parse_expr.rs similarity index 100% rename from json_tests/tests/ui/parse_expr.rs rename to tests/ui/parse_expr.rs diff --git a/json_tests/tests/ui/parse_expr.stderr b/tests/ui/parse_expr.stderr similarity index 100% rename from json_tests/tests/ui/parse_expr.stderr rename to tests/ui/parse_expr.stderr diff --git a/json_tests/tests/ui/parse_key.rs b/tests/ui/parse_key.rs similarity index 100% rename from json_tests/tests/ui/parse_key.rs rename to tests/ui/parse_key.rs diff --git a/json_tests/tests/ui/parse_key.stderr b/tests/ui/parse_key.stderr similarity index 100% rename from json_tests/tests/ui/parse_key.stderr rename to tests/ui/parse_key.stderr diff --git a/json_tests/tests/ui/unexpected_colon.rs b/tests/ui/unexpected_colon.rs similarity index 100% rename from json_tests/tests/ui/unexpected_colon.rs rename to tests/ui/unexpected_colon.rs diff --git a/json_tests/tests/ui/unexpected_colon.stderr b/tests/ui/unexpected_colon.stderr similarity index 100% rename from json_tests/tests/ui/unexpected_colon.stderr rename to tests/ui/unexpected_colon.stderr diff --git a/json_tests/tests/ui/unexpected_comma.rs b/tests/ui/unexpected_comma.rs similarity index 100% rename from json_tests/tests/ui/unexpected_comma.rs rename to tests/ui/unexpected_comma.rs diff --git a/json_tests/tests/ui/unexpected_comma.stderr b/tests/ui/unexpected_comma.stderr similarity index 100% rename from json_tests/tests/ui/unexpected_comma.stderr rename to tests/ui/unexpected_comma.stderr diff --git a/json_tests/tests/ui/update-references.sh b/tests/ui/update-references.sh similarity index 100% rename from json_tests/tests/ui/update-references.sh rename to tests/ui/update-references.sh diff --git a/travis.sh b/travis.sh index 84b56ca..3acf126 100755 --- a/travis.sh +++ b/travis.sh @@ -28,25 +28,16 @@ if [ -n "${CLIPPY}" ]; then exit fi - cd "$DIR/json" - cargo clippy -- -Dclippy - - cd "$DIR/json_tests" cargo clippy -- -Dclippy else CHANNEL=nightly - cd "$DIR/json" channel clean channel build - channel build --features preserve_order + (cd "$DIR/tests/deps" && channel build) channel test - cd "$DIR/json_tests/deps" - channel build - cd "$DIR/json_tests" - channel test --features unstable-testing + channel test --features preserve_order for CHANNEL in stable 1.12.0 1.13.0 beta; do - cd "$DIR/json" channel clean channel build channel build --features preserve_order