|
1 | 1 | SHELL=/bin/bash |
2 | 2 |
|
3 | 3 | # be carefully, this path will be used in clean(rm -rf)!!! |
| 4 | +# github action or native |
| 5 | +RUN_PLATFORM ?= native |
4 | 6 | # need to set the $(CHIP_TARGET) with tc_lx(2, 3, 4...) |
5 | 7 | CHIP_TARGET ?= tc_l3 |
6 | 8 | ROOT_PATH := $(shell pwd)/dependency |
@@ -243,7 +245,21 @@ $(cpuTestLogFile): |
243 | 245 | $(cpuTestCaseName): cputest-%: $(CPUTEST_HOME)/build/%-riscv64-mycpu.bin |
244 | 246 | $(call getRecursiveTestRes, $(CPUTEST_HOME), 33) |
245 | 247 |
|
246 | | -unit-test: simBuild riscvRecursiveTest cpuRecursiveTest |
| 248 | +postTest: |
| 249 | +# ifeq dont's need to indent |
| 250 | +# ref to: https://stackoverflow.com/questions/55133855/how-to-compare-two-string-variables-in-makefile |
| 251 | + @echo -e "\033[0;33mstart post test check...\033[0m"; |
| 252 | +ifeq ($(RUN_PLATFORM), action) |
| 253 | + @if [ "$$(echo $$(echo $$(cat $(CPUTEST_HOME)/build/log/allcasenum-log.txt) - $$(cat $(CPUTEST_HOME)/build/log/passcasenum-log.txt) | bc))" = "1" ]; then\ |
| 254 | + echo -e "\033[0;32maction check pass!\033[0m";\ |
| 255 | + else \ |
| 256 | + echo -e "\033[0;31maction check fail!\033[0m";\ |
| 257 | + exit 1; \ |
| 258 | + fi |
| 259 | +endif |
| 260 | + @echo -e "\033[0;32mpost check done!\033[0m"; |
| 261 | + |
| 262 | +unit-test: simBuild riscvRecursiveTest cpuRecursiveTest postTest |
247 | 263 |
|
248 | 264 | ###### soc name rule test target ###### |
249 | 265 | socTopModify: |
@@ -309,6 +325,6 @@ cleanAll: cleanBuild cleanMillOut cleanDepRepo |
309 | 325 | nemuBuild dramsim3Build difftestBuild changeTargetToSimTop changeTargetToSoCTop simBuild \ |
310 | 326 | simpleTestBuild riscvTestBuild cpuTestBuild amTestBuild coremarkTestBuild \ |
311 | 327 | dhrystoneTestBuild microbenchTestBuild fecmuxTestBuild demoTest \ |
312 | | - simpleRecursiveTest riscvRecursiveTest cpuRecursiveTest unit-test \ |
| 328 | + simpleRecursiveTest riscvRecursiveTest cpuRecursiveTest postTest unit-test \ |
313 | 329 | socTopModify socNameCheck socLintCheck socPrevBuild socBuild socSubmit socTest\ |
314 | 330 | cleanBuild cleanMillOut cleanDepRepo cleanAll |
0 commit comments