Browse Source

+ infrastructure for tests depending on packages, by default, package tests are executed.
Setting QUICKTEST when calling the makefile disables package tests
* first tests moved

git-svn-id: trunk@10805 -

florian 17 years ago
parent
commit
8205f6c7b0

+ 2 - 2
.gitattributes

@@ -6083,7 +6083,6 @@ tests/bench/stream.pp svneol=native#text/x-pascal
 tests/bench/timer.pas svneol=native#text/plain
 tests/bench/whet.pas svneol=native#text/plain
 tests/dbdigest.cfg.example -text
-tests/packages/webtbs/tw3820.pp svneol=native#text/plain
 tests/readme.txt svneol=native#text/plain
 tests/tbf/tb0001.pp svneol=native#text/plain
 tests/tbf/tb0002.pp svneol=native#text/plain
@@ -7278,6 +7277,8 @@ tests/test/opt/treg3.pp svneol=native#text/plain
 tests/test/opt/treg4.pp svneol=native#text/plain
 tests/test/opt/tretopt.pp svneol=native#text/plain
 tests/test/opt/tspace.pp svneol=native#text/plain
+tests/test/packages/webtbs/tw3820.pp svneol=native#text/plain
+tests/test/packages/win-base/tdispvar1.pp svneol=native#text/plain
 tests/test/t4cc1.pp svneol=native#text/plain
 tests/test/t4cc2.pp svneol=native#text/plain
 tests/test/tabstrcl.pp svneol=native#text/plain
@@ -7313,7 +7314,6 @@ tests/test/tclass8.pp svneol=native#text/plain
 tests/test/tclrprop.pp svneol=native#text/plain
 tests/test/tcmp.pp svneol=native#text/plain
 tests/test/tcmp0.pp svneol=native#text/plain
-tests/test/tdispvar1.pp svneol=native#text/plain
 tests/test/tendian1.pp svneol=native#text/plain
 tests/test/tenum1.pp svneol=native#text/plain
 tests/test/tenum2.pp svneol=native#text/plain

+ 8 - 2
tests/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/03/24]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/04/26]
 #
 default: allexectests
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1418,6 +1418,12 @@ ifndef LOG
 export LOG:=$(TEST_OUTPUTDIR)/log
 endif
 TESTSUBDIRS=cg cg/variants cg/cdecl opt units/system units/dos units/crt units/objects units/strings units/sysutils units/math units/sharemem
+TESTPACKAGESUBDIRS=cg packages/win-base packages/webtbs
+ifdef QUICKTEST
+export QUICKTEST
+else
+override TESTSUBDIRS+=TESTSUBDIRS $(TESTPACKAGESUBDIRS)
+endif
 TESTDIRS:=test $(addprefix test/,$(TESTSUBDIRS))
 .PHONY: utils units copyfiles testprep
 utils:

+ 7 - 0
tests/Makefile.fpc

@@ -110,6 +110,13 @@ endif
 
 # Subdirs available in the test subdir
 TESTSUBDIRS=cg cg/variants cg/cdecl opt units/system units/dos units/crt units/objects units/strings units/sysutils units/math units/sharemem
+TESTPACKAGESUBDIRS=cg packages/win-base packages/webtbs
+
+ifdef QUICKTEST
+export QUICKTEST
+else
+override TESTSUBDIRS+=TESTSUBDIRS $(TESTPACKAGESUBDIRS)
+endif
 
 # All full dirnames in the test/ dir including the subdir self
 TESTDIRS:=test $(addprefix test/,$(TESTSUBDIRS))

+ 10 - 8
tests/readme.txt

@@ -28,14 +28,15 @@ webtbs...........Tests for web-bug-database bugs (should compile/run)
 webtbf...........Tests for web-bug-database bugs (should not compile/run)
                    Digits in filename refer to bug database entry
 test.............Test suites for different aspects of the compiler/rtl etc
+test/packages....Tests depending on packages. The tests are sorted by package
+                 though this is not mandatory because tests can depend on
+                 multiple packages
 tbs..............Tests for other bugs, added by the fpc core team
                    (success in compilation) Digits in filename is a serial no
 tbf..............Tests for other bugs, added by the fpc core team
                    (fail compile) Digits in filename is a serial no
 units............Helper units for doing the tests
 utils............Utilities for processing tests
-packages.........Tests for packages: to run these tests, the full fpc sources
-                 must be built
 
 
 Writing a test
@@ -83,6 +84,7 @@ KNOWNCOMPILEERROR..Known bug, which manifest itself at compile time. To
                    the right of the equal sign is the expected exit code
                    from compiler, followed by an optional note. Will not
                    be logged as a bug.
+QUICKTEST..........If set, only tests without package dependencies are executed
 
   NOTE: A list consists of comma separated items, e. g. CPU=i386,m68k,powerpc
         No space between the elements and the comma.
@@ -114,17 +116,17 @@ TEST_FPC_VERSION       defaults to version of TEST_FPC
 TEST_CCOMPILER         defaults to installed gcc compiler, but only
                        if driver and test full-targets are the same.
 TEST_VERBOSE           let dotest be more verbose, only usefull for debugging
-TEST_DELTEMP           delete temporary executable/object/ppu file, 
+TEST_DELTEMP           delete temporary executable/object/ppu file,
                        default is off
 TEST_TIMEOUT           use timeout wrapper for (remote) execution
 V                      print dotest commandline
 
   (Please add more test options if needed)
 
-NOTE: To clean after a test session, "make clean TEST_FPC=path_to_your_compiler" 
+NOTE: To clean after a test session, "make clean TEST_FPC=path_to_your_compiler"
 must be given the same options as when running the tests.
 
-The utils directory is considerd to belong to the driver environment, 
+The utils directory is considerd to belong to the driver environment,
 all other directories belong to the test environment.
 
 
@@ -145,7 +147,7 @@ TEST_REMOTEPATH      set remote path to use, default is /tmp
 TEST_DELBEFORE       delete remote executable before uploading
 TEST_DELTEMP         delete executable after running, so the remote system
                      doesn't need much free disk space
-TEST_REMOTEPW        pass a password with -pw to remote tools, 
+TEST_REMOTEPW        pass a password with -pw to remote tools,
                      mainly usefull for putty
 
 
@@ -198,7 +200,7 @@ correct files will be removed.
 
 Example cross testing of target arm-wince
 -----------------------------------------
-//arm-wince example: 
+//arm-wince example:
 see FPCTRUNK\DEMO\WINCE\TESTEMU\ for additionally required tools
 Connect your device via ActiveSync and execute:
 
@@ -211,7 +213,7 @@ Tests will be performed in the \fpctests folder on the device.
 
 Result uploading
 ----------------
-Results can be uploaded to the test suite result DB 
+Results can be uploaded to the test suite result DB
 (http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi) by executing
 
   make uploadrun

+ 0 - 0
tests/packages/webtbs/tw3820.pp → tests/test/packages/webtbs/tw3820.pp


+ 0 - 0
tests/test/tdispvar1.pp → tests/test/packages/win-base/tdispvar1.pp


+ 29 - 7
tests/units/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/03/24]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/04/26]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -386,6 +386,9 @@ endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override CLEAN_UNITS+=erroru popuperr ptest
 endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override CLEAN_UNITS+=erroru popuperr ptest
+endif
 ifeq ($(FULL_TARGET),arm-wince)
 override CLEAN_UNITS+=erroru popuperr ptest
 endif
@@ -555,6 +558,9 @@ endif
 ifeq ($(FULL_TARGET),arm-palmos)
 override COMPILER_TARGETDIR+=$(FULL_TARGET)
 endif
+ifeq ($(FULL_TARGET),arm-darwin)
+override COMPILER_TARGETDIR+=$(FULL_TARGET)
+endif
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_TARGETDIR+=$(FULL_TARGET)
 endif
@@ -1687,7 +1693,7 @@ makefiles: fpc_makefiles
 ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 endif
-.PHONY: rtl extra fpcunit all clean cleanrtl clean_ctest
+.PHONY: rtl extra fpcunit packages all clean cleanrtl clean_ctest
 DUMMYINSTALLDIR=$(BASEDIR)/tmp
 INSTALLOPT=INSTALL_PREFIX=$(DUMMYINSTALLDIR) INSTALL_UNITDIR=$(BASEDIR)/$(COMPILER_TARGETDIR)
 rtl-stamp.$(FULL_TARGET):
@@ -1711,13 +1717,25 @@ cleanfpcunit:
 	$(DELTREE) $(DUMMYINSTALLDIR)
 	-$(DEL) fpcunit-stamp.$(FULL_TARGET)
 fpcunit : fpcunit-stamp.$(FULL_TARGET)
+DUMMYINSTALLDIR=$(BASEDIR)/tmp
+INSTALLOPT=INSTALL_PREFIX=$(DUMMYINSTALLDIR) INSTALL_UNITDIR=$(BASEDIR)/$(COMPILER_TARGETDIR)
+PACKAGESDIR=../../packages
+packages-stamp.$(FULL_TARGET):
+	$(MAKE) -C ../../packages all 'OPT=$(OPT) -n'
+	$(MAKE) -C ../../packages install $(INSTALLOPT)
+	$(ECHO) Compiled > packages-stamp.$(FULL_TARGET)
+cleanpackages:
+	$(DELTREE) $(COMPILER_TARGETDIR)
+	$(DELTREE) $(DUMMYINSTALLDIR)
+	-$(DEL) packages-stamp.$(FULL_TARGET)
+packages : packages-stamp.$(FULL_TARGET)
 TESTOPT=-n -FE$(COMPILER_TARGETDIR) -T$(OS_TARGET) $(OPT)
-ifneq ($(BINUTILSPREFIX),)
-override TESTOPT+=-XP$(BINUTILSPREFIX) -Xc
-endif
 ifeq ($(CPU_TARGET),armeb)
 override TESTOPT+=-Cb
 endif
+ifneq ($(BINUTILSPREFIX),)
+override TESTOPT+=-XP$(BINUTILSPREFIX) -Xc
+endif
 TESTCOMPILER=$(FPC) $(TESTOPT)
 erroru$(PPUEXT) : erroru.pp
 	$(TESTCOMPILER) erroru.pp
@@ -1734,7 +1752,11 @@ ctest:
 	@exit 1
 endif
 extra : erroru$(PPUEXT) ptest$(PPUEXT) popuperr$(PPUEXT)
+ifdef QUICKTEST
 all : rtl fpcunit extra
-clean : cleanrtl cleanall cleanfpcunit
+else
+all : rtl fpcunit packages extra
+endif
+clean : cleanrtl cleanall cleanfpcunit cleanpackages
 clean_ctest :
 	-$(DEL) ../test/cg/obj/$(OS_TARGET)/$(CPU_TARGET)/ctest.o

+ 28 - 3
tests/units/Makefile.fpc

@@ -17,7 +17,7 @@ targetdir=$(FULL_TARGET)
 fpcdir=../..
 
 [rules]
-.PHONY: rtl extra fpcunit all clean cleanrtl clean_ctest
+.PHONY: rtl extra fpcunit packages all clean cleanrtl clean_ctest
 
 #############################
 # RTL
@@ -40,7 +40,7 @@ rtl : rtl-stamp.$(FULL_TARGET)
 
 
 #############################
-# RTL
+# FPCUnit
 #
 
 DUMMYINSTALLDIR=$(BASEDIR)/tmp
@@ -60,6 +60,27 @@ cleanfpcunit:
 fpcunit : fpcunit-stamp.$(FULL_TARGET)
 
 
+#############################
+# Packages
+#
+
+DUMMYINSTALLDIR=$(BASEDIR)/tmp
+INSTALLOPT=INSTALL_PREFIX=$(DUMMYINSTALLDIR) INSTALL_UNITDIR=$(BASEDIR)/$(COMPILER_TARGETDIR)
+PACKAGESDIR=../../packages
+
+packages-stamp.$(FULL_TARGET):
+        $(MAKE) -C ../../packages all 'OPT=$(OPT) -n'
+        $(MAKE) -C ../../packages install $(INSTALLOPT)
+        $(ECHO) Compiled > packages-stamp.$(FULL_TARGET)
+
+cleanpackages:
+        $(DELTREE) $(COMPILER_TARGETDIR)
+        $(DELTREE) $(DUMMYINSTALLDIR)
+        -$(DEL) packages-stamp.$(FULL_TARGET)
+
+packages : packages-stamp.$(FULL_TARGET)
+
+
 #############################
 # Extra units
 #
@@ -101,9 +122,13 @@ extra : erroru$(PPUEXT) ptest$(PPUEXT) popuperr$(PPUEXT)
 # Main rules
 #
 
+ifdef QUICKTEST
 all : rtl fpcunit extra
+else
+all : rtl fpcunit packages extra
+endif
 
-clean : cleanrtl cleanall cleanfpcunit
+clean : cleanrtl cleanall cleanfpcunit cleanpackages
 
 clean_ctest :
         -$(DEL) ../test/cg/obj/$(OS_TARGET)/$(CPU_TARGET)/ctest.o