Skip to content

Commit a8d45e4

Browse files
alexcrichtongnzlbg
authored andcommitted
Use workspaces and fix tests
* 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`
1 parent 5a8322c commit a8d45e4

File tree

8 files changed

+17
-14
lines changed

8 files changed

+17
-14
lines changed

.gitignore

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
Cargo.lock
22
.*.swp
3-
/target
4-
tags
5-
/coresimd/target
6-
/stdsimd-test/target
7-
/stdsimd-test/assert-instr-macro/target
8-
/stdsimd-test/simd-test-macro/target
3+
target
4+
tags

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ install:
3535
- if [ "$NO_ADD" == "" ]; then rustup target add $TARGET; fi
3636

3737
script:
38+
- cargo generate-lockfile
3839
- ci/run-docker.sh $TARGET $FEATURES
3940

4041
notifications:

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ keywords = ["std", "simd", "intrinsics"]
1111
categories = ["hardware-support"]
1212
license = "MIT/Apache-2.0"
1313

14+
[workspace]
15+
1416
[badges]
1517
travis-ci = { repository = "BurntSushi/stdsimd" }
1618
appveyor = { repository = "BurntSushi/stdsimd" }
@@ -34,4 +36,4 @@ opt-level = 3
3436
strict = [ "coresimd/strict" ]
3537
# Internal-usage only: enables only those intrinsics supported by Intel's
3638
# Software Development Environment (SDE).
37-
intel_sde = [ "coresimd/intel_sde" ]
39+
intel_sde = [ "coresimd/intel_sde" ]

ci/run-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ run() {
1919
--env TARGET=$target \
2020
--env FEATURES=$2 \
2121
--env STDSIMD_TEST_EVERYTHING \
22-
--volume `pwd`:/checkout \
22+
--volume `pwd`:/checkout:ro \
2323
--volume `pwd`/target:/checkout/target \
2424
--workdir /checkout \
2525
--privileged \

ci/run.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ echo "RUSTFLAGS=${RUSTFLAGS}"
2121
echo "FEATURES=${FEATURES}"
2222
echo "OBJDUMP=${OBJDUMP}"
2323

24-
cd coresimd
25-
cargo test --all --target $TARGET --features $FEATURES --verbose -- --nocapture
26-
cargo test --all --release --target $TARGET --features $FEATURES --verbose -- --nocapture
27-
cd ..
28-
cargo test --all --target $TARGET --features $FEATURES --verbose -- --nocapture
29-
cargo test --all --release --target $TARGET --features $FEATURES --verbose -- --nocapture
24+
cargo_test() {
25+
cmd="cargo test --all --target=$TARGET --features $FEATURES --verbose $1 -- --nocapture $2"
26+
$cmd
27+
}
28+
29+
cargo_test
30+
cargo_test "--release"

stdsimd-test/assert-instr-macro/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Alex Crichton <[email protected]>"]
55

66
[lib]
77
proc-macro = true
8+
test = false
89

910
[dependencies]
1011
proc-macro2 = { version = "0.1", features = ["unstable"] }

stdsimd-test/simd-test-macro/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["Alex Crichton <[email protected]>"]
55

66
[lib]
77
proc-macro = true
8+
test = false
89

910
[dependencies]
1011
proc-macro2 = { version = "0.1", features = ["unstable"] }

tests/cpu-detection.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#[macro_use]
77
extern crate stdsimd;
88

9+
#[test]
910
#[cfg(all(target_arch = "arm", target_os = "linux"))]
1011
fn arm_linux() {
1112
println!("neon: {}", cfg_feature_enabled!("neon"));

0 commit comments

Comments
 (0)