Skip to content

Commit 80f5bd7

Browse files
committed
testing
1 parent cf7650f commit 80f5bd7

File tree

1 file changed

+68
-63
lines changed

1 file changed

+68
-63
lines changed

ci/run.sh

Lines changed: 68 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,75 @@ if [ "${USING_CONTAINER_RUSTC:-}" = 1 ]; then
2020
rustup target add "$target"
2121
fi
2222

23-
# Test our implementation
24-
if [ "${BUILD_ONLY:-}" = "1" ]; then
25-
echo "nothing to do for no_std"
26-
else
27-
run="cargo test --package builtins-test --no-fail-fast --target $target"
28-
$run
29-
$run --release
30-
$run --features c
31-
$run --features c --release
32-
$run --features no-asm
33-
$run --features no-asm --release
34-
$run --features no-f16-f128
35-
$run --features no-f16-f128 --release
36-
$run --benches
37-
$run --benches --release
38-
fi
23+
# # Test our implementation
24+
# if [ "${BUILD_ONLY:-}" = "1" ]; then
25+
# echo "nothing to do for no_std"
26+
# else
27+
# run="cargo test --package builtins-test --no-fail-fast --target $target"
28+
# $run
29+
# $run --release
30+
# $run --features c
31+
# $run --features c --release
32+
# $run --features no-asm
33+
# $run --features no-asm --release
34+
# $run --features no-f16-f128
35+
# $run --features no-f16-f128 --release
36+
# $run --benches
37+
# $run --benches --release
38+
# fi
39+
40+
# if [ "${TEST_VERBATIM:-}" = "1" ]; then
41+
# verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2)
42+
# cargo build --package builtins-test \
43+
# --target "$target" --target-dir "$verb_path" --features c
44+
# fi
45+
46+
47+
## REMOVE
48+
declare -a rlib_paths
49+
50+
# Set the `rlib_paths` global array to a list of all compiler-builtins rlibs
51+
update_rlib_paths() {
52+
if [ -d /builtins-target ]; then
53+
rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
54+
else
55+
rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
56+
fi
57+
}
58+
59+
60+
update_rlib_paths
61+
for rlib in "${rlib_paths[@]}"; do
62+
set +x
63+
echo "================================================================"
64+
echo "checking $rlib for references to core"
65+
echo "================================================================"
66+
set -x
67+
68+
tmpdir="${CARGO_TARGET_DIR:-target}/tmp"
69+
test -d "$tmpdir" || mkdir "$tmpdir"
70+
defined="$tmpdir/defined_symbols.txt"
71+
undefined="$tmpdir/defined_symbols.txt"
72+
73+
$NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined"
74+
$NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined"
75+
grep_has_results=0
76+
grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1
77+
78+
wc -l $defined
79+
wc -l $undefined
80+
81+
if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then
82+
echo "FIXME: powerpc64 fails these tests"
83+
elif [ "$grep_has_results" != 0 ]; then
84+
echo "error: found unexpected references to core"
85+
exit 1
86+
else
87+
echo "success; no references to core found"
88+
fi
89+
done
90+
## END REMOVE
3991

40-
if [ "${TEST_VERBATIM:-}" = "1" ]; then
41-
verb_path=$(cmd.exe //C echo \\\\?\\%cd%\\builtins-test\\target2)
42-
cargo build --package builtins-test \
43-
--target "$target" --target-dir "$verb_path" --features c
44-
fi
4592

4693
# Run a command for each `compiler_builtins` rlib file
4794
for_each_rlib() {
@@ -128,45 +175,3 @@ for_each_rlib nm -A
128175
for_each_rlib "${symcheck[@]}" -- check-core-syms
129176

130177

131-
declare -a rlib_paths
132-
133-
# Set the `rlib_paths` global array to a list of all compiler-builtins rlibs
134-
update_rlib_paths() {
135-
if [ -d /builtins-target ]; then
136-
rlib_paths=( /builtins-target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
137-
else
138-
rlib_paths=( target/"${target}"/debug/deps/libcompiler_builtins-*.rlib )
139-
fi
140-
}
141-
142-
143-
update_rlib_paths
144-
for rlib in "${rlib_paths[@]}"; do
145-
set +x
146-
echo "================================================================"
147-
echo "checking $rlib for references to core"
148-
echo "================================================================"
149-
set -x
150-
151-
tmpdir="${CARGO_TARGET_DIR:-target}/tmp"
152-
test -d "$tmpdir" || mkdir "$tmpdir"
153-
defined="$tmpdir/defined_symbols.txt"
154-
undefined="$tmpdir/defined_symbols.txt"
155-
156-
$NM --quiet -U "$rlib" | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > "$defined"
157-
$NM --quiet -u "$rlib" | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > "$undefined"
158-
grep_has_results=0
159-
grep -v -F -x -f "$defined" "$undefined" && grep_has_results=1
160-
161-
wc -l $defined
162-
wc -l $undefined
163-
164-
if [ "$target" = "powerpc64-unknown-linux-gnu" ]; then
165-
echo "FIXME: powerpc64 fails these tests"
166-
elif [ "$grep_has_results" != 0 ]; then
167-
echo "error: found unexpected references to core"
168-
exit 1
169-
else
170-
echo "success; no references to core found"
171-
fi
172-
done

0 commit comments

Comments
 (0)