diff options
author | Keith Packard <keithp@keithp.com> | 2025-02-25 19:30:09 -0800 |
---|---|---|
committer | Chris Packham <judge.packham@gmail.com> | 2025-03-01 19:33:37 +1300 |
commit | 7458341776f14d4d12e6d6fe51382e87e832894f (patch) | |
tree | a5519e994458b46e6cdbecd3c607be2dfede9623 /contrib/gcc-test-suite | |
parent | 5a11188bd0540e4780e7c5c9b51299f3ec8308fc (diff) | |
download | crosstool-ng-7458341776f14d4d12e6d6fe51382e87e832894f.tar.gz crosstool-ng-7458341776f14d4d12e6d6fe51382e87e832894f.tar.bz2 crosstool-ng-7458341776f14d4d12e6d6fe51382e87e832894f.zip |
contrib/gcc-test-suite: Add configuration options including qemu setup
This makes the options necessary to run the gcc test suite
configurable in the crosstool-ng config file.
That includes the ability to run the test suite using qemu instead of
on a remote host.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'contrib/gcc-test-suite')
-rw-r--r-- | contrib/gcc-test-suite/Makefile | 27 | ||||
-rw-r--r-- | contrib/gcc-test-suite/default.cfg | 11 |
2 files changed, 33 insertions, 5 deletions
diff --git a/contrib/gcc-test-suite/Makefile b/contrib/gcc-test-suite/Makefile index c3e17942..7dc836bc 100644 --- a/contrib/gcc-test-suite/Makefile +++ b/contrib/gcc-test-suite/Makefile @@ -13,16 +13,23 @@ # # Internal configuration -TARGET:=@@DG_TARGET@@ TOPDIR:=$(shell pwd) LOGDIR:=$(TOPDIR)/tmp # Include default configuration include default.cfg +TARGET:=$(DG_TARGET) + # Add toolchain to path PATH:=$(shell cd ../../bin && pwd):$(PATH) +# Set sysroot +SYSROOT:=$(shell cd ../../$(TARGET)/sysroot && pwd) + +# Set qemu +DG_QEMU_PROGRAM:=qemu-$(shell echo $(TARGET) | sed 's/-.*$$//') + # Select test set ifeq ($(DG_TOOLNAME),gcc) DG_TESTS:=$(DG_C_TESTS) @@ -31,6 +38,12 @@ ifeq ($(DG_TOOLNAME),g++) DG_TESTS:=$(DG_CPP_TESTS) endif +ifeq ($(DG_QEMU),y) + TARGET_BOARD=unix +else + TARGET_BOARD=board +endif + # Check that we have 'runtest' installed RUNTEST=$(shell which runtest) ifeq ($(RUNTEST),) @@ -48,6 +61,7 @@ $(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR) echo 'set tmpdir "$(TOPDIR)"'; \ echo 'set target_alias $(TARGET)'; } > $@ +# Create config for remote execution $(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR) @{ echo 'load_generic_config "unix"'; \ echo 'process_multilib_options ""'; \ @@ -57,19 +71,26 @@ $(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR) echo 'set_board_info hostname $(DG_TARGET_HOSTNAME)'; \ echo 'set_board_info username $(DG_TARGET_USERNAME)'; } > $@ +# create config for local execution via qemu +$(LOGDIR)/unix.exp: $(TOPDIR)/default.cfg $(LOGDIR) + @{ echo 'load_generic_config "unix"'; \ + echo 'process_multilib_options ""'; \ + echo 'set_board_info bmk,use_alarm 1'; \ + echo 'set_board_info exec_shell "$(DG_QEMU_PROGRAM) $(DG_QEMU_ARGS)"'; } > $@ + # As Martin puts it: # > The thing is that when you run 50k+ test cases the odds are that at # > least one will fail and thus runtest basically always return an error # > despite the fact that the test session has executed successfully. # So just ignore any error reported by runtest -test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR) +test: $(LOGDIR)/$(TARGET_BOARD).exp $(LOGDIR)/site.exp $(LOGDIR) @runtest --tool $(DG_TOOLNAME) \ --srcdir $(TOPDIR)/testsuite \ --objdir $(LOGDIR) \ --outdir $(LOGDIR) \ --all \ --target $(TARGET) \ - --target_board board \ + --target_board $(TARGET_BOARD) \ $(DG_TESTS) \ GXX_UNDER_TEST=$(TARGET)-g++ || true @printf "Result files available in '%s'\n" "$(LOGDIR)" diff --git a/contrib/gcc-test-suite/default.cfg b/contrib/gcc-test-suite/default.cfg index d523008b..2089d77a 100644 --- a/contrib/gcc-test-suite/default.cfg +++ b/contrib/gcc-test-suite/default.cfg @@ -1,9 +1,16 @@ # Default test suite configuration +DG_TARGET = @@DG_TARGET@@ + # Default DejaGnu configuration DG_TOOLNAME = gcc -DG_TARGET_HOSTNAME = 127.0.0.1 -DG_TARGET_USERNAME = root +DG_SSH = @@DG_SSH@@ +DG_QEMU = @@DG_QEMU@@ +DG_TARGET_HOSTNAME = @@DG_TARGET_HOSTNAME@@ +DG_TARGET_USERNAME = @@DG_TARGET_USERNAME@@ + +DG_QEMU_PROGRAM = @@DG_QEMU_PROGRAM@@ +DG_QEMU_ARGS = @@DG_QEMU_ARGS@@ # Default tests DG_C_TESTS = |