Skip to content

Commit e0b30ad

Browse files
committed
scripts: fix build log file
stdout and stderr are redirected to the same location Signed-off-by: Jingru Wang <jingru@synopsys.com>
1 parent ed7cc28 commit e0b30ad

File tree

5 files changed

+58
-51
lines changed

5 files changed

+58
-51
lines changed

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: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
examples:
2-
example.baremetal.blinky:
3-
build_only: true
42
example.baremetal.arc_feature.udma:
53
build_only: false
64
platform_exclude: axs
@@ -9,36 +7,52 @@ examples:
97
platform_exclude: axs nsim
108
example.baremetal.arc_feature.timer_interrupt:
119
build_only: false
12-
example.baremetal.dma_spiflash:
10+
example.baremetal.arc_feature.memory_protection:
11+
build_only: false
12+
example.baremetal.arc_feature.multicore:
1313
build_only: true
14-
platform_exclude:
15-
emsk: 11 22
16-
example.baremetal.imu_mpu9250:
14+
example.baremetal.arc_feature.xymem:
15+
build_only: false
16+
toolchain_allow: gnu
17+
example.baremetal.axs103:
18+
build_only: true
19+
platform_allow: axs
20+
example.baremetal.ble_rn4020:
1721
build_only: true
1822
platform_exclude: nsim
1923
example.baremetal.ble_hm1x:
2024
build_only: true
2125
platform_exclude: nsim
26+
example.baremetal.blinky:
27+
build_only: true
28+
example.baremetal.bootloader:
29+
build_only: true
30+
platform_exclude: emsdp hsdk axs nsim
31+
example.baremetal.cxx:
32+
build_only: false
33+
example.baremetal.dma_spiflash:
34+
build_only: true
35+
platform_exclude:
36+
emsk: 11 22
2237
example.baremetal.graphic_u8glib:
2338
build_only: true
2439
platform_exclude: nsim
25-
example.baremetal.ble_rn4020:
40+
example.baremetal.imu_mpu9250:
2641
build_only: true
2742
platform_exclude: nsim
28-
example.baremetal.openthread.ncp:
29-
build_only: true
30-
platform_exclude: nsim emsdp iotdk
3143
example.baremetal.openthread.cli:
3244
build_only: true
3345
platform_exclude: emsdp axs nsim
34-
example.baremetal.secureshield.secret_secure_sid:
46+
example.baremetal.openthread.ncp:
47+
build_only: true
48+
platform_exclude: nsim emsdp iotdk
49+
example.baremetal.secureshield.secret_normal:
3550
skip: true
3651
tags: secureshield
3752
extra_args: USE_SECURESHIELD_APPL_GEN=1
3853
build_only: true
3954
platform_allow:
4055
emsk: 23
41-
nsim: 10
4256
iotdk: 10
4357
example.baremetal.secureshield.secret_secure:
4458
skip: true
@@ -48,13 +62,14 @@ examples:
4862
platform_allow:
4963
emsk: 23
5064
iotdk: 10
51-
example.baremetal.secureshield.secret_normal:
65+
example.baremetal.secureshield.secret_secure_sid:
5266
skip: true
5367
tags: secureshield
5468
extra_args: USE_SECURESHIELD_APPL_GEN=1
5569
build_only: true
5670
platform_allow:
5771
emsk: 23
72+
nsim: 10
5873
iotdk: 10
5974
example.baremetal.secureshield.test_case:
6075
tags: secureshield
@@ -63,43 +78,41 @@ examples:
6378
emsk: 23
6479
nsim: 10
6580
iotdk: 10
66-
example.baremetal.axs103:
67-
build_only: true
68-
platform_allow: axs
69-
example.baremetal.bootloader:
81+
example.freertos.esp8266_wifi:
7082
build_only: true
71-
platform_exclude: emsdp hsdk axs nsim
72-
example.freertos.kernel_secure:
83+
platform_exclude: nsim
84+
example.freertos.freertos_blinky:
7385
build_only: true
74-
platform_allow:
75-
emsk: 23
76-
example.freertos.sec.mbedtls.ssl.client2:
86+
example.freertos.iot.coap.coap_server:
7787
build_only: true
78-
platform_exclude: iotdk nsim hsdk
79-
example.freertos.sec.mbedtls.ssl.server2:
88+
platform_exclude: nsim
89+
example.freertos.iot.lwm2m.lwm2m_client:
8090
build_only: true
81-
platform_exclude: iotdk nsim hsdk
82-
example.freertos.sec.mbedtls.dtls.client:
91+
platform_exclude: nsim
92+
example.freertos.iot.lwm2m.lwm2m_server:
8393
build_only: true
84-
platform_exclude: iotdk nsim hsdk
85-
example.freertos.sec.mbedtls.dtls.server:
94+
platform_exclude: nsim
95+
example.freertos.kernel:
96+
build_only: true
97+
example.freertos.kernel_secure:
8698
build_only: true
87-
platform_exclude: iotdk nsim hsdk
99+
platform_allow:
100+
emsk: 23
88101
example.freertos.net.httpserver:
89102
build_only: true
90103
platform_exclude: nsim
91104
example.freertos.net.ntshell:
92105
build_only: true
93106
platform_exclude: nsim
94-
example.freertos.esp8266_wifi:
107+
example.freertos.sec.mbedtls.dtls.client:
95108
build_only: true
96-
platform_exclude: nsim
97-
example.freertos.iot.coap.coap_server:
109+
platform_exclude: iotdk nsim hsdk
110+
example.freertos.sec.mbedtls.dtls.server:
98111
build_only: true
99-
platform_exclude: nsim
100-
example.freertos.iot.lwm2m.lwm2m_client:
112+
platform_exclude: iotdk nsim hsdk
113+
example.freertos.sec.mbedtls.ssl.client2:
101114
build_only: true
102-
platform_exclude: nsim
103-
example.freertos.iot.lwm2m.lwm2m_server:
115+
platform_exclude: iotdk nsim hsdk
116+
example.freertos.sec.mbedtls.ssl.server2:
104117
build_only: true
105-
platform_exclude: nsim
118+
platform_exclude: iotdk nsim hsdk

scripts/test.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,10 @@ def build(self, **kwargs):
874874
env = os.environ.copy()
875875

876876
p = subprocess.Popen(cmd, cwd=self.build_dir, env=env, **kwargs)
877-
out, errs = p.communicate()
878-
877+
out, _ = p.communicate()
878+
if out:
879+
with open(os.path.join(self.build_dir, self.log), "a") as log:
880+
log.write(out.decode())
879881
results = {}
880882
msg = "build status: %s version %s core %s %s %s" % (
881883
self.platform.name,
@@ -888,19 +890,9 @@ def build(self, **kwargs):
888890
if p.returncode == 0:
889891
self.instance.status = "passed"
890892
results = {'msg': msg, "returncode": p.returncode, "instance": self.instance}
891-
892-
if out:
893-
with open(os.path.join(self.build_dir, self.log), "a") as log:
894-
log.write(out.decode())
895-
else:
893+
if not out:
896894
return None
897895
else:
898-
if out:
899-
with open(os.path.join(self.build_dir, self.log), "a") as log:
900-
log.write(out.decode())
901-
if errs:
902-
log.write(errs.decode())
903-
logger.debug(errs.decode())
904896
self.instance.status = "error"
905897
self.instance.reason = "Build failure"
906898

0 commit comments

Comments
 (0)