Skip to content

Commit 0830b0b

Browse files
authored
Merge pull request #155 from wangnuannuan/jingru-test-sync_bsp
sort examples and set tags for each example
2 parents bf32fc5 + 628bffe commit 0830b0b

File tree

10 files changed

+254
-118
lines changed

10 files changed

+254
-118
lines changed

.travis.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ env:
1414
"context": "travis-ci/$NAME",
1515
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
1616
}\nDATA'
17-
18-
COMMENT=none
19-
COMMENTS=$'curl -so/dev/null --user "$EMBARC_BOT" --request POST
20-
https://api.github.com/repos/$TRAVIS_REPO_SLUG/issues/$TRAVIS_PULL_REQUEST/comments
21-
--data @- << DATA\n{
22-
"body": "$COMMENT"
23-
}\nDATA'
17+
2418
- TOOLCHAIN_VER="2020.09"
2519
- OSP_ROOT="."
2620
- EXAMPLES="example/baremetal,example/freertos"
@@ -39,7 +33,7 @@ before_install:
3933
# setup git config
4034
- git config --global user.name "embARC Automated Bot"
4135
- git config --global user.email "jingru@synopsys.com"
42-
- bash .ci/before_install.sh
36+
- bash ./scripts/.ci/before_install.sh
4337

4438
after_success:
4539
- bash -c "$STATUS" success "Local $NAME testing has passed"
@@ -48,7 +42,7 @@ after_failure:
4842
- bash -c "$STATUS" failure "Local $NAME testing has failed"
4943

5044
script:
51-
- bash .ci/script.sh
45+
- bash ./scripts/.ci/script.sh
5246

5347
matrix:
5448
include:

example/baremetal/arc_feature/memory_protection/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static void user_mode_func(void)
9292
arc_kflag(0);
9393
arc_goto_kernelmode(0, 0);
9494

95-
EMBARC_PRINTF("Memory Protection Test Done\n");
95+
EMBARC_PRINTF("MPU Test Done\r\n");
9696
while (1) {
9797
;
9898
}

example/baremetal/arc_feature/xymem/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ int main(void)
120120
}
121121

122122
EMBARC_PRINTF("add for %d numbers : %d cycles\r\n---end----\r\n", DATA_SIZE, end);
123+
EMBARC_PRINTF("XY memory Test Done\n");
123124
#else /* ARC_FEATURE_XCCM_PRESENT && ARC_FEATURE_YCCM_PRESENT */
124125
EMBARC_PRINTF("This example is not supported under current configurations \r\n");
125126
#endif /* ARC_FEATURE_XCCM_PRESENT && ARC_FEATURE_YCCM_PRESENT */

example/baremetal/cxx/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@ int main(void)
139139
if (x.same_value(y)) {
140140
EMBARC_PRINTF("x and y are the same\r\n");
141141
}
142+
EMBARC_PRINTF("CPP Test Done\n");
142143
}

example/examples.yaml

Lines changed: 102 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,163 @@
1+
#
2+
# This file contails the supported examples and the test scenario for each example
3+
# Each examples block can define the follwing key/value
4+
# tags: <list of tags>
5+
# a set of string tags. Usually pertains to features and peripherals that
6+
# platform support. Command line invocations of this script can filter the
7+
# set of examples to run based on tag
8+
# skip: <True|False>
9+
# skip example unconditionally
10+
# build_only: <True|False>
11+
# if true, don't try to run the example
12+
# platform_allow: <list of platforms>
13+
# set of platforms that this example should only be run for
14+
# platform_exclude: <list of platforms>
15+
# set of platforms that this example should not be run for
16+
# core_exlude: <list of cores>
17+
# set of cores that this example should not be run for, the
18+
# core should format as <platform_name>_<platform_version>_<core_name>
19+
# extra_args: <list of extra Make arguments>
20+
# extra arguments to pass to Make when building or running the example
21+
#
122
examples:
2-
example.baremetal.blinky:
3-
build_only: true
423
example.baremetal.arc_feature.udma:
24+
tags: dma
525
build_only: false
6-
platform_exclude: axs
726
example.baremetal.arc_feature.cache:
27+
tags: icache dcache
828
build_only: false
9-
platform_exclude: axs nsim
1029
example.baremetal.arc_feature.timer_interrupt:
30+
tags: timer
1131
build_only: false
12-
example.baremetal.dma_spiflash:
32+
example.baremetal.arc_feature.memory_protection:
33+
tags: mpu
34+
build_only: false
35+
example.baremetal.arc_feature.multicore:
36+
tags: smp
1337
build_only: true
14-
platform_exclude:
15-
emsk: 11 22
16-
example.baremetal.imu_mpu9250:
38+
example.baremetal.arc_feature.xymem:
39+
tags: xymem
40+
build_only: false
41+
example.baremetal.axs103:
42+
build_only: true
43+
platform_allow: axs
44+
example.baremetal.ble_rn4020:
45+
tags: uart
1746
build_only: true
1847
platform_exclude: nsim
1948
example.baremetal.ble_hm1x:
49+
tags: uart
2050
build_only: true
2151
platform_exclude: nsim
22-
example.baremetal.graphic_u8glib:
52+
example.baremetal.blinky:
53+
tags: blinky
54+
build_only: true
55+
example.baremetal.bootloader:
56+
tags: bootloader
57+
build_only: true
58+
platform_allow: emsk iotdk
59+
example.baremetal.cxx:
60+
build_only: false
61+
example.baremetal.dma_spiflash:
62+
tags: dma spi
2363
build_only: true
2464
platform_exclude: nsim
25-
example.baremetal.ble_rn4020:
65+
example.baremetal.graphic_u8glib:
2666
build_only: true
2767
platform_exclude: nsim
28-
example.baremetal.openthread.ncp:
68+
example.baremetal.imu_mpu9250:
2969
build_only: true
30-
platform_exclude: nsim emsdp iotdk
70+
platform_exclude: nsim
3171
example.baremetal.openthread.cli:
72+
tags: bootloader
3273
build_only: true
33-
platform_exclude: emsdp axs nsim
34-
example.baremetal.secureshield.secret_secure_sid:
74+
platform_allow: emsk iotdk
75+
core_exlude:
76+
- emsk_23_arcem9d
77+
example.baremetal.openthread.ncp:
78+
tags: bootloader
79+
build_only: true
80+
platform_allow: emsk iotdk
81+
core_exlude:
82+
- emsk_23_arcem9d
83+
example.baremetal.secureshield.secret_normal:
3584
skip: true
36-
tags: secureshield
85+
tags: mpu secureshield
3786
extra_args: USE_SECURESHIELD_APPL_GEN=1
3887
build_only: true
3988
platform_allow:
4089
emsk: 23
41-
nsim: 10
4290
iotdk: 10
4391
example.baremetal.secureshield.secret_secure:
4492
skip: true
45-
tags: secureshield
93+
tags: mpu secureshield
4694
extra_args: USE_SECURESHIELD_APPL_GEN=1
4795
build_only: true
4896
platform_allow:
4997
emsk: 23
5098
iotdk: 10
51-
example.baremetal.secureshield.secret_normal:
99+
example.baremetal.secureshield.secret_secure_sid:
52100
skip: true
53-
tags: secureshield
101+
tags: mpu secureshield
54102
extra_args: USE_SECURESHIELD_APPL_GEN=1
55103
build_only: true
56104
platform_allow:
57105
emsk: 23
106+
nsim: 10
58107
iotdk: 10
59108
example.baremetal.secureshield.test_case:
60-
tags: secureshield
109+
tags: mpu secureshield
61110
build_only: true
62111
platform_allow:
63112
emsk: 23
64113
nsim: 10
65114
iotdk: 10
66-
example.baremetal.axs103:
67-
build_only: true
68-
platform_allow: axs
69-
example.baremetal.bootloader:
115+
example.freertos.esp8266_wifi:
116+
tags: uart
70117
build_only: true
71-
platform_exclude: emsdp hsdk axs nsim
72-
example.freertos.kernel_secure:
118+
platform_exclude: nsim
119+
example.freertos.freertos_blinky:
120+
tags: blinky
73121
build_only: true
74-
platform_allow:
75-
emsk: 23
76-
example.freertos.sec.mbedtls.ssl.client2:
122+
example.freertos.iot.coap.coap_server:
77123
build_only: true
78-
platform_exclude: iotdk nsim hsdk
79-
example.freertos.sec.mbedtls.ssl.server2:
124+
platform_exclude: nsim
125+
example.freertos.iot.lwm2m.lwm2m_client:
80126
build_only: true
81-
platform_exclude: iotdk nsim hsdk
82-
example.freertos.sec.mbedtls.dtls.client:
127+
platform_exclude: nsim
128+
core_exlude:
129+
- emsk_23_arcem9d
130+
example.freertos.iot.lwm2m.lwm2m_server:
83131
build_only: true
84-
platform_exclude: iotdk nsim hsdk
85-
example.freertos.sec.mbedtls.dtls.server:
132+
platform_exclude: nsim
133+
example.freertos.kernel:
134+
build_only: true
135+
example.freertos.kernel_secure:
136+
tags: mpu secureshield
86137
build_only: true
87-
platform_exclude: iotdk nsim hsdk
138+
platform_allow:
139+
emsk: 23
88140
example.freertos.net.httpserver:
89141
build_only: true
90142
platform_exclude: nsim
91143
example.freertos.net.ntshell:
92144
build_only: true
93145
platform_exclude: nsim
94-
example.freertos.esp8266_wifi:
146+
core_exlude:
147+
- emsk_23_arcem9d
148+
example.freertos.sec.mbedtls.dtls.client:
95149
build_only: true
96-
platform_exclude: nsim
97-
example.freertos.iot.coap.coap_server:
150+
platform_exclude: iotdk nsim hsdk
151+
example.freertos.sec.mbedtls.dtls.server:
98152
build_only: true
99-
platform_exclude: nsim
100-
example.freertos.iot.lwm2m.lwm2m_client:
153+
platform_exclude: iotdk nsim hsdk
154+
example.freertos.sec.mbedtls.ssl.client2:
101155
build_only: true
102-
platform_exclude: nsim
103-
example.freertos.iot.lwm2m.lwm2m_server:
156+
platform_exclude: iotdk nsim hsdk
157+
core_exlude:
158+
- emsk_23_arcem9d
159+
example.freertos.sec.mbedtls.ssl.server2:
104160
build_only: true
105-
platform_exclude: nsim
161+
platform_exclude: iotdk nsim hsdk
162+
core_exlude:
163+
- emsk_23_arcem9d

options/toolchain/toolchain_gnu.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ endif
150150

151151
OPENOCD_EXECUTABLE_ROOT = $(dir $(shell $(WHICH) openocd))
152152
ifeq ($(OPENOCD_EXECUTABLE_ROOT), )
153+
ifneq ($(MAKECMDGOALS), )
154+
ifeq ($(findstring $(MAKECMDGOALS),run gui),)
153155
$(info "Tool openocd - openocd doesn't exist, please install it!")
156+
endif
157+
endif
154158
else
155159
OPENOCD_SCRIPT_ROOT = $(OPENOCD_EXECUTABLE_ROOT)/share/openocd/scripts
156160
endif
File renamed without changes.

.ci/script.sh renamed to scripts/.ci/script.sh

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ die() {
77
exit 1
88
}
99

10-
_get_repo_revision() {
11-
if [[ -d $1 ]]; then
12-
cd $1
13-
repo_hash_commit=$(git rev-parse HEAD)
14-
echo -n ${repo_hash_commit}
15-
cd $OLDPWD
16-
else
17-
echo "[Error] $1 doesn't exist"
18-
fi
19-
}
20-
2110
prepare_env() {
2211
out_dir="${_DIR}/out"
2312
logs_dir="${_DIR}/logs"
@@ -30,7 +19,7 @@ prepare_env() {
3019

3120
[ "${TRAVIS}" == "true" ] && {
3221
if [ "${TOOLCHAIN}" == "gnu" ] ; then
33-
python .ci/toolchain.py -v $TOOLCHAIN_VER -c $TOOLCHAIN_CACHE_FOLDER || die
22+
python scripts/.ci/toolchain.py -v $TOOLCHAIN_VER -c $TOOLCHAIN_CACHE_FOLDER || die
3423
if [ -d $TOOLCHAIN_CACHE_FOLDER ] ; then
3524
if [ -d $TOOLCHAIN_CACHE_FOLDER/$TOOLCHAIN_VER ] ; then
3625
ARC_DEV_TOOL_ROOT="${TOOLCHAIN_CACHE_FOLDER}/${TOOLCHAIN_VER}"
@@ -63,31 +52,19 @@ run_test() {
6352
export PYTHONUNBUFFERED=1
6453
{
6554
hostname
66-
python ./scripts/test.py --platform $BOARD --toolchain $TOOLCHAIN $target_flags --build-only --report-dir logs_dir || {
67-
if [[ $? == 124 ]]; then
68-
echo "twister timeout"
69-
fi
70-
true
71-
}
55+
python ./scripts/test.py --platform $BOARD --toolchain $TOOLCHAIN $target_flags --build-only --report-dir $logs_dir -v -v || true
7256
} 2>&1 | tee -a $test_log
7357
}
7458

7559
parse_logs() {
7660
# get rid of MAC \r and change it to UNIX \n
7761
sed -i 's/\r/\n/g' $test_log
78-
# use sed remove ANSI color codes. \x1B is the escape special character, \[ is the second character of the escape sequence, [0-9] is the color value(s) regex
79-
sed -i -r 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g' $test_log
80-
failed=$(cat $test_log | sed -n 's/^.*, \([0-9]\+\) .*failed.*$/\1 /p')
81-
embarc_osp_repo_commit=$(_get_repo_revision ${_DIR})
82-
COMMENT=""
83-
if ! [[ $failed == 0 ]]; then
84-
comment_url="https://api.github.com/repos/$TRAVIS_REPO_SLUG/commits/$embarc_osp_repo_commit/comments"
85-
for line in $(grep "build status:" $test_log | sed -E 's/^.* (.*) failed.*$/\1/'); do
86-
COMMENT="$COMMENT<br>$line"
87-
done
88-
curl --user "$EMBARC_BOT" --request POST https://api.github.com/repos/$TRAVIS_REPO_SLUG/commits/$embarc_osp_repo_commit/comments \
89-
--data '{"body":"'${COMMENT}'"}'
90-
fi
62+
63+
METRICS=$(cat $test_log | grep "test configurations passed" | sed -n 's/^.*-\(.*\)*$/\1/p')
64+
COMMENT="$BOARD ${BD_VER:-} test results: $METRICS. [Details](https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID)"
65+
66+
curl --user "$EMBARC_BOT" --request POST https://api.github.com/repos/$TRAVIS_REPO_SLUG/commits/$TRAVIS_COMMIT/comments \
67+
--data '{"body":"'"${COMMENT}"'"}'
9168
}
9269

9370
main() {
File renamed without changes.

0 commit comments

Comments
 (0)