From a93bb5458903392c4a763596629b8c3290bbf7c5 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 1 Aug 2018 11:50:35 +0200 Subject: [PATCH] include all packages in tests and build --- Cargo.toml | 4 ++-- build.sh | 7 ++----- full_test.sh | 9 +++------ test.sh | 9 +++------ zokrates_cli/Cargo.toml | 2 +- zokrates_core/src/compile.rs | 2 +- zokrates_core/src/helpers.rs | 1 + 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 165360dfd..c77892a96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] + members = [ "zokrates_core", "zokrates_cli", "zokrates_fs_resolver", -] - +] \ No newline at end of file diff --git a/build.sh b/build.sh index f48e2b4d2..42644ecb2 100755 --- a/build.sh +++ b/build.sh @@ -3,11 +3,8 @@ # Exit if any subcommand fails set -e -cd zokrates_cli if [ -n "$WITH_LIBSNARK" ]; then - cargo build --features libsnark -else cargo build +else + cargo -Z package-features build --no-default-features fi - -cd .. diff --git a/full_test.sh b/full_test.sh index 3bdbf34a0..9c0280c83 100755 --- a/full_test.sh +++ b/full_test.sh @@ -3,11 +3,8 @@ # Exit if any subcommand fails set -e -cd zokrates_cli if [ -n "$WITH_LIBSNARK" ]; then - cargo test --features libsnark -- --ignored -else cargo test -- --ignored -fi - -cd .. \ No newline at end of file +else + cargo -Z package-features test --no-default-features -- --ignored +fi \ No newline at end of file diff --git a/test.sh b/test.sh index 82900f9e6..39ec4a484 100755 --- a/test.sh +++ b/test.sh @@ -3,11 +3,8 @@ # Exit if any subcommand fails set -e -cd zokrates_cli if [ -n "$WITH_LIBSNARK" ]; then - cargo test --features libsnark -else cargo test -fi - -cd .. \ No newline at end of file +else + cargo -Z package-features test --no-default-features +fi \ No newline at end of file diff --git a/zokrates_cli/Cargo.toml b/zokrates_cli/Cargo.toml index a8da1b114..41a8d0cf8 100644 --- a/zokrates_cli/Cargo.toml +++ b/zokrates_cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Jacob Eberhardt ", "Dennis Kuhnert >(reader mod test { use super::*; use field::FieldPrime; - use std::io::{BufRead, BufReader, Empty}; + use std::io::{BufReader, Empty}; #[test] fn no_resolver_with_imports() { diff --git a/zokrates_core/src/helpers.rs b/zokrates_core/src/helpers.rs index cf367b5bd..425ada3f3 100644 --- a/zokrates_core/src/helpers.rs +++ b/zokrates_core/src/helpers.rs @@ -156,6 +156,7 @@ mod tests { use field::FieldPrime; use super::*; + #[cfg(feature = "libsnark")] mod sha256libsnark { use super::*;