Skip to content

Commit 7f92a8e

Browse files
committed
Fix CI for thumb* targets
Main fix is inside 'utest' all the rest are minor fixes due to the new 'testcrate'. Still allow failures on TravisCI for a while.
1 parent 280012b commit 7f92a8e

File tree

7 files changed

+56
-18
lines changed

7 files changed

+56
-18
lines changed

ci/run.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,30 @@ fi
2424
# Test our implementation
2525
case $1 in
2626
thumb*)
27-
for t in $(ls tests); do
27+
run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
28+
for t in $(ls testcrate/tests); do
2829
t=${t%.rs}
2930

30-
# TODO(#154) enable these tests when aeabi_*mul are implemented
31-
case $t in
32-
powi*f2)
33-
continue
34-
;;
35-
esac
36-
37-
xargo test --test $t --target $1 --features 'mem gen-tests' --no-run
31+
RUSTFLAGS="-C debug-assertions=no -C lto" \
32+
CARGO_INCREMENTAL=0 \
33+
$run --test $t --features 'no_std mem c' --no-run
3834
qemu-arm-static target/${1}/debug/$t-*
35+
done
3936

40-
xargo test --test $t --target $1 --features 'mem gen-tests' --no-run --release
37+
for t in $(ls testcrate/tests); do
38+
t=${t%.rs}
39+
RUSTFLAGS="-C lto" \
40+
CARGO_INCREMENTAL=0 \
41+
$run --test $t --features 'no_std mem c' --no-run --release
4142
qemu-arm-static target/${1}/release/$t-*
4243
done
4344
;;
4445
*)
4546
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
46-
$run
47-
$run --release
48-
$run --features c
49-
$run --features c --release
47+
$run --features mangled-names
48+
$run --features mangled-names --release
49+
$run --features 'mangled-names c'
50+
$run --features 'mangled-names c' --release
5051
;;
5152
esac
5253

testcrate/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ rand = { version = "0.4", features = ["i128_support"] }
1414
[dependencies.compiler_builtins]
1515
path = ".."
1616
default-features = false
17-
features = ["mangled-names", "no-lang-items"]
17+
features = ["no-lang-items"]
1818

1919
[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]
20-
test = { git = "https://github.com/japaric/utest" }
21-
utest-cortex-m-qemu = { default-features = false, git = "https://github.com/japaric/utest" }
22-
utest-macros = { git = "https://github.com/japaric/utest" }
20+
test = { git = "https://github.com/paoloteti/utest", branch = "ci" }
21+
utest-cortex-m-qemu = { default-features = false, git = "https://github.com/paoloteti/utest", branch = "ci" }
22+
utest-macros = { git = "https://github.com/paoloteti/utest", branch = "ci" }
2323

2424
[features]
2525
c = ["compiler_builtins/c"]
26+
mem = ["compiler_builtins/mem"]
27+
mangled-names = ["compiler_builtins/mangled-names"]
28+
no_std = []

testcrate/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(feature = "no_std", no_std)]
2+
13
#[cfg(test)]
24
mod tests {
35
#[test]

testcrate/tests/aeabi_memclr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
target_os = "linux",
44
feature = "mem"))]
55
#![feature(compiler_builtins_lib)]
6+
#![feature(lang_items)]
67
#![no_std]
78

89
extern crate compiler_builtins;

testcrate/tests/aeabi_memcpy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
target_os = "linux",
44
feature = "mem"))]
55
#![feature(compiler_builtins_lib)]
6+
#![feature(lang_items)]
67
#![no_std]
78

89
extern crate compiler_builtins;

testcrate/tests/aeabi_memset.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
target_os = "linux",
44
feature = "mem"))]
55
#![feature(compiler_builtins_lib)]
6+
#![feature(lang_items)]
67
#![no_std]
78

89
extern crate compiler_builtins;

testcrate/tests/generated.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1+
#![feature(compiler_builtins_lib)]
12
#![feature(i128_type)]
3+
#![feature(lang_items, core_float, core_float_bits)]
24
#![allow(bad_style)]
5+
#![allow(unused_imports)]
6+
#![no_std]
7+
8+
use core::num::Float;
39

410
extern crate compiler_builtins;
511

12+
#[cfg(all(target_arch = "arm",
13+
not(any(target_env = "gnu", target_env = "musl")),
14+
target_os = "linux",
15+
test))]
16+
extern crate utest_cortex_m_qemu;
17+
18+
#[cfg(all(target_arch = "arm",
19+
not(any(target_env = "gnu", target_env = "musl")),
20+
target_os = "linux",
21+
test))]
22+
#[macro_use]
23+
extern crate utest_macros;
24+
25+
#[cfg(all(target_arch = "arm",
26+
not(any(target_env = "gnu", target_env = "musl")),
27+
target_os = "linux",
28+
test))]
29+
macro_rules! panic { // overrides `panic!`
30+
($($tt:tt)*) => {
31+
upanic!($($tt)*);
32+
};
33+
}
34+
635
include!(concat!(env!("OUT_DIR"), "/generated.rs"));

0 commit comments

Comments
 (0)