Skip to content

Commit 29d02b7

Browse files
authored
Merge pull request #1139 from cmuellner/testing
Enhance the testing experience
2 parents 96d9f40 + 60f654c commit 29d02b7

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

Makefile.in

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ check-gcc: check-gcc-@default_target@
141141
check-gcc-linux: stamps/check-gcc-linux
142142
check-gcc-newlib: stamps/check-gcc-newlib
143143
check-gcc-newlib-nano: stamps/check-gcc-newlib-nano
144+
.PHONY: check-glibc-linux
145+
check-glibc-linux: $(addprefix stamps/check-glibc-linux-,$(GLIBC_MULTILIB_NAMES))
144146
.PHONY: check-dhrystone check-dhrystone-linux check-dhrystone-newlib
145147
check-dhrystone: check-dhrystone-@default_target@
146148
.PHONY: check-binutils check-binutils-linux check-binutils-newlib
@@ -873,17 +875,24 @@ stamps/build-dejagnu: $(srcdir)/dejagnu $(srcdir)/dejagnu/.git
873875
date > $@
874876

875877
stamps/check-gcc-newlib: stamps/build-gcc-newlib-stage2 $(SIM_STAMP) stamps/build-dejagnu
876-
$(SIM_PREPARE) $(MAKE) -C build-gcc-newlib-stage2 check-gcc "RUNTESTFLAGS=--target_board='$(NEWLIB_TARGET_BOARDS)'"
878+
$(SIM_PREPARE) $(MAKE) -C build-gcc-newlib-stage2 check-gcc "RUNTESTFLAGS=$(RUNTESTFLAGS) --target_board='$(NEWLIB_TARGET_BOARDS)'"
877879
mkdir -p $(dir $@)
878880
date > $@
879881

880882
stamps/check-gcc-newlib-nano: stamps/build-gcc-newlib-stage2 $(SIM_STAMP) stamps/build-dejagnu
881-
$(SIM_PREPARE) $(MAKE) -C build-gcc-newlib-stage2 check-gcc "RUNTESTFLAGS=--target_board='$(NEWLIB_NANO_TARGET_BOARDS)'"
883+
$(SIM_PREPARE) $(MAKE) -C build-gcc-newlib-stage2 check-gcc "RUNTESTFLAGS=$(RUNTESTFLAGS) --target_board='$(NEWLIB_NANO_TARGET_BOARDS)'"
882884
mkdir -p $(dir $@)
883885
date > $@
884886

885887
stamps/check-gcc-linux: stamps/build-gcc-linux-stage2 $(SIM_STAMP) stamps/build-dejagnu
886-
$(SIM_PREPARE) $(MAKE) -C build-gcc-linux-stage2 check-gcc "RUNTESTFLAGS=--target_board='$(GLIBC_TARGET_BOARDS)'"
888+
$(SIM_PREPARE) $(MAKE) -C build-gcc-linux-stage2 check-gcc "RUNTESTFLAGS=$(RUNTESTFLAGS) --target_board='$(GLIBC_TARGET_BOARDS)'"
889+
mkdir -p $(dir $@)
890+
date > $@
891+
892+
stamps/check-glibc-linux-%: $(addprefix stamps/build-glibc-linux-,$(GLIBC_MULTILIB_NAMES))
893+
$(eval $@_BUILD_DIR := $(notdir $@))
894+
$(eval $@_BUILD_DIR := $(subst check-,build-,$($@_BUILD_DIR)))
895+
$(SIM_PREPARE) $(MAKE) -C $($@_BUILD_DIR) check
887896
mkdir -p $(dir $@)
888897
date > $@
889898

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,41 @@ Note:
210210
- spike only support rv64* bare-metal/elf toolchain.
211211
- gdb simulator only support bare-metal/elf toolchain.
212212

213+
#### Selecting the tests to run in GCC's regression test suite
214+
215+
By default GCC will execute all tests of its regression test suite.
216+
While running them in parallel (e.g. `make -j$(nproc) report`) will
217+
significanlty speed up the execution time on multi-processor systems,
218+
the required time for executing all tests is usually too high for
219+
typical development cycles. Therefore GCC allows to select the tests
220+
that are being executed using the environment variable `RUNTESTFLAGS`.
221+
222+
To restrict a test run to only RISC-V specific tests
223+
the following command can be used:
224+
225+
RUNTESTFLAGS="riscv.exp" make report
226+
227+
To to restrict a test run to only RISC-V specific tests with match the
228+
pattern "zb*.c" and "sm*.c" the following command can be used:
229+
230+
RUNTESTFLAGS="riscv.exp=zb*.c\ sm*.c" make report
231+
232+
#### Testing GCC, Binutils, and glibc of a Linux toolchain
233+
234+
The default Makefile target to run toolchain tests is `report`.
235+
This will run all tests of the GCC regression test suite.
236+
Alternatively, the following command can be used to do the same:
237+
238+
make check-gcc
239+
240+
The following command can be used to run the Binutils tests:
241+
242+
make check-binutils
243+
244+
The command below can be used to run the glibc tests:
245+
246+
make check-glibc-linux
247+
213248
### Development
214249

215250
This section is only for developer or advanced user, or you want to build

0 commit comments

Comments
 (0)