diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-03-13 20:54:49 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-04-03 15:34:13 -0400 |
commit | a389375f5b5fb67acdda6be028526ac44df2fbff (patch) | |
tree | 09265b6996cafdf2a9e6d6164e45d60f8dc8caba /sim/testsuite | |
parent | a0e674c1ce2c877426f8a861c5294c535c5d49e6 (diff) | |
download | gdb-a389375f5b5fb67acdda6be028526ac44df2fbff.zip gdb-a389375f5b5fb67acdda6be028526ac44df2fbff.tar.gz gdb-a389375f5b5fb67acdda6be028526ac44df2fbff.tar.bz2 |
sim: testsuite: integrate common tests into build
Now that we have the common automake build with support for build-time
programs working, we can integrate the common tests into the default
`make check` flow.
Diffstat (limited to 'sim/testsuite')
-rw-r--r-- | sim/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | sim/testsuite/common/Makefile.in | 53 | ||||
-rw-r--r-- | sim/testsuite/common/local.mk | 84 | ||||
-rw-r--r-- | sim/testsuite/local.mk | 2 |
4 files changed, 92 insertions, 53 deletions
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog index a88c995..4160911 100644 --- a/sim/testsuite/ChangeLog +++ b/sim/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2021-04-03 Mike Frysinger <vapier@gentoo.org> + + * local.mk: Include %D%/common/local.mk. + * common/Makefile.in: Removed. + * common/local.mk: New file. + 2021-03-07 Mike Frysinger <vapier@gentoo.org> * Makefile.in: Removed. diff --git a/sim/testsuite/common/Makefile.in b/sim/testsuite/common/Makefile.in deleted file mode 100644 index d088501..0000000 --- a/sim/testsuite/common/Makefile.in +++ /dev/null @@ -1,53 +0,0 @@ -CC=gcc -CFLAGS = -Wall -Werror -I../../common -I../../../include -g -default: check - - -# Verify SIM-BITS - -check: bits32m0.ok bits32m31.ok bits64m0.ok bits64m63.ok -all: bits32m0 bits32m31 bits64m0 bits64m63 - -bits32m0.c: bits-gen bits-tst.c - ./bits-gen 32 0 big > tmp-bits32m0.c - cat bits-tst.c >> tmp-bits32m0.c - mv tmp-bits32m0.c bits32m0.c -bits32m31.c: bits-gen bits-tst.c - ./bits-gen 32 31 little > tmp-bits32m31.c - cat bits-tst.c >> tmp-bits32m31.c - mv tmp-bits32m31.c bits32m31.c -bits64m0.c: bits-gen bits-tst.c - ./bits-gen 64 0 big > tmp-bits64m0.c - cat bits-tst.c >> tmp-bits64m0.c - mv tmp-bits64m0.c bits64m0.c -bits64m63.c: bits-gen bits-tst.c - ./bits-gen 64 63 little > tmp-bits64m63.c - cat bits-tst.c >> tmp-bits64m63.c - mv tmp-bits64m63.c bits64m63.c - - - -# Verify SIM-FPU -# -#check: fpu-tst.ok -#all: fpu-tst - - - -# Verify SIM-ALU - -check: alu-tst.ok -all: alu-tst -alu-tst.o: alu-tst.c alu-n-tst.h - -clean: - rm -f *.o - rm -f *.ok - rm -f bits32m0 bits32m31 bits64m0 bits64m63 bits-gen - rm -f tmp-* - rm -f alu-tst - -.SUFIXES: .ok -%.ok: % - ./$< - touch $<.ok diff --git a/sim/testsuite/common/local.mk b/sim/testsuite/common/local.mk new file mode 100644 index 0000000..38ffb0b --- /dev/null +++ b/sim/testsuite/common/local.mk @@ -0,0 +1,84 @@ +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +EXTRA_PROGRAMS += %D%/bits-gen + +# We don't build this normally as it relies on the Berkeley SoftFloat/TestFloat +# projects being installed/available first. +EXTRA_PROGRAMS += %D%/fpu-tst + +TESTS = \ + %D%/bits32m0 \ + %D%/bits32m31 \ + %D%/bits64m0 \ + %D%/bits64m63 \ + %D%/alu-tst +check_PROGRAMS += $(TESTS) + +%C%_CPPFLAGS = \ + -I$(srcdir)/common \ + -I$(srcroot)/include + +# These tests are build-time only tools. Override the default rules for them. +%D%/%.o: %D%/%.c + $(AM_V_CC)$(COMPILE_FOR_BUILD) $(%C%_CPPFLAGS) -c $< -o $@ + +%D%/alu-tst$(EXEEXT): $(%C%_alu_tst_OBJECTS) $(%C%_alu_tst_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_alu_tst_OBJECTS) $(%C%_alu_tst_LDADD) + +%D%/fpu-tst$(EXEEXT): $(%C%_fpu_tst_OBJECTS) $(%C%_fpu_tst_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_fpu_tst_OBJECTS) $(%C%_fpu_tst_LDADD) + +%D%/bits-gen$(EXEEXT): $(%C%_bits_gen_OBJECTS) $(%C%_bits_gen_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_bits_gen_OBJECTS) $(%C%_bits_gen_LDADD) + +%D%/bits32m0$(EXEEXT): $(%C%_bits32m0_OBJECTS) $(%C%_bits32m0_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_bits32m0_OBJECTS) $(%C%_bits32m0_LDADD) + +%D%/bits32m0.c: %D%/bits-gen %D%/bits-tst.c + $< 32 0 big > $@.tmp + cat $(srcdir)/%D%/bits-tst.c >> $@.tmp + mv $@.tmp $@ + +%D%/bits32m31$(EXEEXT): $(%C%_bits32m31_OBJECTS) $(%C%_bits32m31_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_bits32m31_OBJECTS) $(%C%_bits32m31_LDADD) + +%D%/bits32m31.c: %D%/bits-gen %D%/bits-tst.c + $< 32 31 little > $@.tmp + cat $(srcdir)/%D%/bits-tst.c >> $@.tmp + mv $@.tmp $@ + +%D%/bits64m0$(EXEEXT): $(%C%_bits64m0_OBJECTS) $(%C%_bits64m0_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_bits64m0_OBJECTS) $(%C%_bits64m0_LDADD) + +%D%/bits64m0.c: %D%/bits-gen %D%/bits-tst.c + $< 64 0 big > $@.tmp + cat $(srcdir)/%D%/bits-tst.c >> $@.tmp + mv $@.tmp $@ + +%D%/bits64m63$(EXEEXT): $(%C%_bits64m63_OBJECTS) $(%C%_bits64m63_DEPENDENCIES) %D%/$(am__dirstamp) + $(AM_V_CCLD)$(LINK_FOR_BUILD) $(%C%_bits64m63_OBJECTS) $(%C%_bits64m63_LDADD) + +%D%/bits64m63.c: %D%/bits-gen %D%/bits-tst.c + $< 64 63 little > $@.tmp + cat $(srcdir)/%D%/bits-tst.c >> $@.tmp + mv $@.tmp $@ + +CLEANFILES += \ + %D%/bits-gen \ + %D%/bits32m0.c \ + %D%/bits32m31.c \ + %D%/bits64m0.c \ + %D%/bits64m63.c diff --git a/sim/testsuite/local.mk b/sim/testsuite/local.mk index bd8a206..82eb70d 100644 --- a/sim/testsuite/local.mk +++ b/sim/testsuite/local.mk @@ -32,3 +32,5 @@ check-DEJAGNU: site.exp MOSTLYCLEANFILES += \ site-srcdir.exp testrun.log testrun.sum + +include %D%/common/local.mk |