Skip to content

Commit 085b212

Browse files
committed
Output test name before each test so you can see where the logs are from
1 parent f65d7ad commit 085b212

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

riscof/mlogv32/env/model_test.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ mlogv32_clear_bss: \
5757
addi t0, t0, 1; \
5858
j mlogv32_clear_bss; \
5959
mlogv32_bss_done: \
60+
\
61+
RVMODEL_IO_WRITE_STR(t0, "\n--- ", MLOGV32_TEST_NAME, " ---\n") \
6062
\
6163
tail rvtest_init;
6264

riscof/mlogv32/riscof_mlogv32.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def initialise(self, suite: str, workdir: str, env: str):
6565
self.compile_cmd = (
6666
"riscv{xlen}-unknown-elf-gcc -march={isa} \
6767
-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -g\
68+
-D 'MLOGV32_TEST_NAME=\"{test_name}\"'\
6869
-T "
6970
+ self.pluginpath
7071
+ "/env/{linker_script}\
@@ -123,7 +124,12 @@ def runTests(self, testlist: dict[str, Any]):
123124
# we will iterate over each entry in the testlist. Each entry node will be refered to by the
124125
# variable testname.
125126
for testname in testlist:
126-
logger.info(f"Building test: {testname}")
127+
# hack
128+
_, _, test_display_name = testname.partition(
129+
"riscv-arch-test/riscv-test-suite/"
130+
)
131+
132+
logger.info(f"Building test: {test_display_name}")
127133

128134
# for each testname we get all its fields (as described by the testlist format)
129135
testentry = testlist[testname]
@@ -177,6 +183,7 @@ def runTests(self, testlist: dict[str, Any]):
177183
elf=elf,
178184
macros=compile_macros,
179185
linker_script=linker_script,
186+
test_name=test_display_name,
180187
)
181188

182189
objcopy_cmd = self.objcopy_cmd.format(
@@ -221,7 +228,7 @@ def runTests(self, testlist: dict[str, Any]):
221228
f"{begin_signature=:#x} {end_signature=:#x} {signature_length=}"
222229
)
223230

224-
logger.info(f"Running test: {testname}")
231+
logger.info(f"Running test: {test_display_name}")
225232

226233
processor.stop()
227234
processor.flash(binary_file_host)

0 commit comments

Comments
 (0)