Skip to content

Commit

Permalink
Use workspaces and fix tests
Browse files Browse the repository at this point in the history
* Enable a Cargo workspace for the repo
* Disable tests for proc-macro crates
* Move back to mounting source directory read-only
* Refactor test invocation to only test one crate with `--all`
  • Loading branch information
alexcrichton authored and gnzlbg committed Nov 22, 2017
1 parent 28f5d02 commit b576f1e
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
Cargo.lock
.*.swp
/target
tags
/coresimd/target
/stdsimd-test/target
/stdsimd-test/assert-instr-macro/target
/stdsimd-test/simd-test-macro/target
target
tags
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ install:
- if [ "$NO_ADD" == "" ]; then rustup target add $TARGET; fi

script:
- cargo generate-lockfile
- ci/run-docker.sh $TARGET $FEATURES

notifications:
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ keywords = ["std", "simd", "intrinsics"]
categories = ["hardware-support"]
license = "MIT/Apache-2.0"

[workspace]

[badges]
travis-ci = { repository = "BurntSushi/stdsimd" }
appveyor = { repository = "BurntSushi/stdsimd" }
Expand All @@ -34,4 +36,4 @@ opt-level = 3
strict = [ "coresimd/strict" ]
# Internal-usage only: enables only those intrinsics supported by Intel's
# Software Development Environment (SDE).
intel_sde = [ "coresimd/intel_sde" ]
intel_sde = [ "coresimd/intel_sde" ]
2 changes: 1 addition & 1 deletion ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ run() {
--env TARGET=$target \
--env FEATURES=$2 \
--env STDSIMD_TEST_EVERYTHING \
--volume `pwd`:/checkout \
--volume `pwd`:/checkout:ro \
--volume `pwd`/target:/checkout/target \
--workdir /checkout \
--privileged \
Expand Down
13 changes: 7 additions & 6 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ echo "RUSTFLAGS=${RUSTFLAGS}"
echo "FEATURES=${FEATURES}"
echo "OBJDUMP=${OBJDUMP}"

cd coresimd
cargo test --all --target $TARGET --features $FEATURES --verbose -- --nocapture
cargo test --all --release --target $TARGET --features $FEATURES --verbose -- --nocapture
cd ..
cargo test --all --target $TARGET --features $FEATURES --verbose -- --nocapture
cargo test --all --release --target $TARGET --features $FEATURES --verbose -- --nocapture
cargo_test() {
cmd="cargo test --all --target=$TARGET --features $FEATURES --verbose $1 -- --nocapture $2"
$cmd
}

cargo_test
cargo_test "--release"
1 change: 1 addition & 0 deletions stdsimd-test/assert-instr-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ authors = ["Alex Crichton <[email protected]>"]

[lib]
proc-macro = true
test = false

[dependencies]
proc-macro2 = { version = "0.1", features = ["unstable"] }
Expand Down
1 change: 1 addition & 0 deletions stdsimd-test/simd-test-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ authors = ["Alex Crichton <[email protected]>"]

[lib]
proc-macro = true
test = false

[dependencies]
proc-macro2 = { version = "0.1", features = ["unstable"] }
Expand Down
1 change: 1 addition & 0 deletions tests/cpu-detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#[macro_use]
extern crate stdsimd;

#[test]
#[cfg(all(target_arch = "arm", target_os = "linux"))]
fn arm_linux() {
println!("neon: {}", cfg_feature_enabled!("neon"));
Expand Down

0 comments on commit b576f1e

Please sign in to comment.