Skip to content

Commit 5b0f486

Browse files
committed
[ci] run-make/thumb-none-qemu: transfer logic to script.sh
1 parent fdf4d6e commit 5b0f486

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

src/test/run-make/thumb-none-qemu/Makefile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,20 @@
77
ifneq (,$(filter $(TARGET),thumbv6m-none-eabi thumbv7m-none-eabi))
88

99
# For cargo setting
10-
RUSTC := $(RUSTC_ORIGINAL)
10+
export RUSTC := $(RUSTC_ORIGINAL)
1111
LD_LIBRARY_PATH := $(HOST_RPATH_DIR)
1212
# We need to be outside of 'src' dir in order to run cargo
13-
WORK_DIR := $(TMPDIR)
14-
HERE := $(shell pwd)
13+
export WORK_DIR := $(TMPDIR)
14+
export HERE := $(shell pwd)
1515

1616

1717
# hint: we could set variables per $(TARGET) basis in order to support other targets.
18-
CRATE := cortex-m-rt
19-
CRATE_URL := https://github.com/rust-embedded/cortex-m-rt
20-
CRATE_SHA1 := 62972c8a89ff54b76f9ef0d600c1fcf7a233aabd
18+
export CRATE := cortex-m-rt
19+
export CRATE_URL := https://github.com/rust-embedded/cortex-m-rt
20+
export CRATE_SHA1 := 62972c8a89ff54b76f9ef0d600c1fcf7a233aabd
2121

2222
all:
23-
env
24-
mkdir -p $(WORK_DIR)
25-
-cd $(WORK_DIR) && rm -rf $(CRATE)
26-
cd $(WORK_DIR) && bash -x $(HERE)/../git_clone_sha1.sh $(CRATE) $(CRATE_URL) $(CRATE_SHA1)
27-
cd $(WORK_DIR)/$(CRATE) && $(CARGO) run --target $(TARGET) --example qemu | grep "x = 42"
28-
cd $(WORK_DIR)/$(CRATE) && $(CARGO) run --target $(TARGET) --example qemu --release | grep "x = 42"
23+
bash script.sh
2924
else
30-
3125
all:
32-
3326
endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set -exuo pipefail
2+
3+
CRATE=cortex-m-rt
4+
CRATE_URL=https://github.com/rust-embedded/cortex-m-rt
5+
CRATE_SHA1=62972c8a89ff54b76f9ef0d600c1fcf7a233aabd
6+
7+
env | sort
8+
mkdir -p $WORK_DIR
9+
pushd $WORK_DIR
10+
rm -rf $CRATE || echo OK
11+
bash -x $HERE/../git_clone_sha1.sh $CRATE $CRATE_URL $CRATE_SHA1
12+
pushd $CRATE
13+
$CARGO run --target $TARGET --example qemu | grep "x = 42"
14+
$CARGO run --target $TARGET --example qemu --release | grep "x = 42"
15+
popd
16+
popd

0 commit comments

Comments
 (0)