Browse Source

* Merged revisions 3997-3998

git-svn-id: branches/fixes_2_0@3999 -
michael 19 years ago
parent
commit
70a7fb2b7f

+ 1 - 0
.gitattributes

@@ -717,6 +717,7 @@ fcl/fpcunit/tests/frameworktest.pp svneol=native#text/plain
 fcl/fpcunit/tests/suitetest.pp svneol=native#text/plain
 fcl/fpcunit/tests/suitetest.pp svneol=native#text/plain
 fcl/fpcunit/testutils.pp svneol=native#text/plain
 fcl/fpcunit/testutils.pp svneol=native#text/plain
 fcl/fpcunit/ubmockobject.pp svneol=native#text/plain
 fcl/fpcunit/ubmockobject.pp svneol=native#text/plain
+fcl/fpcunit/xmlreporter.pas svneol=native#text/plain
 fcl/freebsd/syncobjs.pp svneol=native#text/plain
 fcl/freebsd/syncobjs.pp svneol=native#text/plain
 fcl/go32v2/custapp.inc svneol=native#text/plain
 fcl/go32v2/custapp.inc svneol=native#text/plain
 fcl/go32v2/eventlog.inc svneol=native#text/plain
 fcl/go32v2/eventlog.inc svneol=native#text/plain

+ 98 - 54
fcl/fpcunit/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/06]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/06/12]
 #
 #
 default: all
 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-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince powerpc64-linux
+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 m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -233,118 +233,124 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages/base $(FPCDIR)/packages/ext
 override PACKAGE_NAME=fcl
 override PACKAGE_NAME=fcl
 PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl/Makefile.fpc,$(PACKAGESDIR))))))
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-os2)
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-beos)
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netware)
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-wince)
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+override TARGET_UNITS+=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 endif
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_EXAMPLEDIRS+=exampletests
 override TARGET_EXAMPLEDIRS+=exampletests
@@ -382,6 +388,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_EXAMPLEDIRS+=exampletests
 override TARGET_EXAMPLEDIRS+=exampletests
 endif
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_EXAMPLEDIRS+=exampletests
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_EXAMPLEDIRS+=exampletests
 override TARGET_EXAMPLEDIRS+=exampletests
 endif
 endif
@@ -457,6 +466,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_EXAMPLEDIRS+=exampletests
 override TARGET_EXAMPLEDIRS+=exampletests
 endif
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_EXAMPLEDIRS+=exampletests
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_EXAMPLEDIRS+=exampletests
 override TARGET_EXAMPLEDIRS+=exampletests
 endif
 endif
@@ -497,6 +509,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -572,6 +587,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -611,6 +629,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_TARGETDIR+=../$(OS_TARGET)
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 endif
 endif
@@ -686,6 +707,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_TARGETDIR+=../$(OS_TARGET)
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 override COMPILER_TARGETDIR+=../$(OS_TARGET)
 endif
 endif
@@ -897,6 +921,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
 ifeq ($(OS_TARGET),go32v1)
@@ -1009,6 +1034,11 @@ EXEEXT=
 HASSHAREDLIB=1
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 SHORTSUFFIX=dwn
 endif
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 else
 ifeq ($(OS_TARGET),go32v1)
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
 PPUEXT=.pp1
@@ -1329,12 +1359,17 @@ endif
 endif
 endif
 export ZIPPROG
 export ZIPPROG
 ifndef TARPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 TARPROG= __missing_command_TARPROG
 else
 else
 TARPROG:=$(firstword $(TARPROG))
 TARPROG:=$(firstword $(TARPROG))
 endif
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 endif
 export TARPROG
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
 ASNAME=$(BINUTILSPREFIX)as
@@ -1458,6 +1493,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -1533,6 +1571,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -1568,6 +1609,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 override FPCOPT+=-T$(OS_TARGET)
 endif
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
 endif
@@ -1602,14 +1646,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 override FPCOPTDEF+=DEBUG
 endif
 endif
 ifdef RELEASE
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
 endif
+else
+FPCCPUOPT:=-O2
 endif
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
 override FPCOPTDEF+=RELEASE
@@ -1618,9 +1663,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 override FPCOPT+=-Xs
 endif
 endif
 ifdef OPTIMIZE
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 endif
 ifdef VERBOSE
 ifdef VERBOSE
 override FPCOPT+=-vwni
 override FPCOPT+=-vwni
@@ -1664,11 +1707,6 @@ override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
 override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
 override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
 endif
 endif
 endif
 endif
-ifeq ($(OS_TARGET),linux)
-ifeq ($(FPC_VERSION),1.0.6)
-override FPCOPTDEF+=HASUNIX
-endif
-endif
 ifdef CREATESHARED
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
 ifeq ($(CPU_TARGET),i386)
@@ -1725,7 +1763,7 @@ ifneq ($(TARGET_EXAMPLES),)
 HASEXAMPLES=1
 HASEXAMPLES=1
 override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
 override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
 override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
 override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
-override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
+override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
 override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
 override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
 ifeq ($(OS_TARGET),os2)
 ifeq ($(OS_TARGET),os2)
 override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
 override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
@@ -1819,7 +1857,7 @@ ifdef INSTALL_BUILDUNIT
 override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
 override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
 endif
 endif
 ifdef INSTALLPPUFILES
 ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 ifneq ($(UNITTARGETDIRPREFIX),)
 ifneq ($(UNITTARGETDIRPREFIX),)
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
@@ -1889,7 +1927,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 endif
 ifdef CLEANPPUFILES
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif
 endif
@@ -2090,6 +2128,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 ifeq ($(FULL_TARGET),i386-wdosx)
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 endif
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 ifeq ($(FULL_TARGET),i386-emx)
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 endif
 endif
@@ -2165,6 +2206,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 endif
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 TARGET_EXAMPLEDIRS_EXAMPLETESTS=1
 endif
 endif

+ 1 - 1
fcl/fpcunit/Makefile.fpc

@@ -6,7 +6,7 @@
 main=fcl
 main=fcl
 
 
 [target]
 [target]
-units=fpcunit  testregistry  testreport testutils testdecorator ubmockobject
+units=fpcunit testregistry testreport testutils testdecorator ubmockobject xmlreporter
 exampledirs=exampletests
 exampledirs=exampletests
 
 
 [compiler]
 [compiler]

+ 23 - 16
fcl/fpcunit/demo/consolerunner/testrunner.pp

@@ -1,5 +1,3 @@
-{$mode objfpc}
-{$h+}
 {
 {
     This file is part of the Free Component Library (FCL)
     This file is part of the Free Component Library (FCL)
     Copyright (c) 2004 by Dean Zobec, Michael Van Canneyt
     Copyright (c) 2004 by Dean Zobec, Michael Van Canneyt
@@ -12,28 +10,33 @@
     This program is distributed in the hope that it will be useful,
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
+}
 program testrunner;
 program testrunner;
+
+{$mode objfpc}
+{$h+}
+
 uses
 uses
-  custapp, classes, SysUtils, fpcunit, suiteconfig, testreport, testregistry;
+  custapp, Classes, SysUtils, fpcunit, suiteconfig, xmlreporter, testregistry;
+
 
 
-Const
+const
   ShortOpts = 'alh';
   ShortOpts = 'alh';
-  Longopts : Array[1..5] of String = (
+  Longopts: Array[1..5] of String = (
     'all','list','format:','suite:','help');
     'all','list','format:','suite:','help');
-  Version = 'Version 0.1';
+  Version = 'Version 0.2';
 
 
-Type
+
+type
   TTestRunner = Class(TCustomApplication)
   TTestRunner = Class(TCustomApplication)
   private
   private
     FXMLResultsWriter: TXMLResultsWriter;
     FXMLResultsWriter: TXMLResultsWriter;
   protected
   protected
-    procedure DoRun ; Override;
-    procedure doTestRun(aTest: TTest); virtual;
+    procedure   DoRun ; Override;
+    procedure   doTestRun(aTest: TTest); virtual;
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
-    destructor Destroy; override;
+    destructor  Destroy; override;
   end;
   end;
 
 
 
 
@@ -43,11 +46,13 @@ begin
   FXMLResultsWriter := TXMLResultsWriter.Create;
   FXMLResultsWriter := TXMLResultsWriter.Create;
 end;
 end;
 
 
+
 destructor TTestRunner.Destroy;
 destructor TTestRunner.Destroy;
 begin
 begin
   FXMLResultsWriter.Free;
   FXMLResultsWriter.Free;
 end;
 end;
 
 
+
 procedure TTestRunner.doTestRun(aTest: TTest);
 procedure TTestRunner.doTestRun(aTest: TTest);
 var
 var
   testResult: TTestResult;
   testResult: TTestResult;
@@ -55,7 +60,6 @@ begin
   testResult := TTestResult.Create;
   testResult := TTestResult.Create;
   try
   try
     testResult.AddListener(FXMLResultsWriter);
     testResult.AddListener(FXMLResultsWriter);
-    FXMLResultsWriter.WriteHeader;
     aTest.Run(testResult);
     aTest.Run(testResult);
     FXMLResultsWriter.WriteResult(testResult);
     FXMLResultsWriter.WriteResult(testResult);
   finally
   finally
@@ -63,6 +67,7 @@ begin
   end;
   end;
 end;
 end;
 
 
+
 procedure TTestRunner.DoRun;
 procedure TTestRunner.DoRun;
 var
 var
   I : Integer;
   I : Integer;
@@ -119,13 +124,15 @@ begin
 end;
 end;
 
 
 
 
-Var
-  App : TTestRunner;
+var
+  App: TTestRunner;
+
 
 
 begin
 begin
-  App:=TTestRunner.Create(Nil);
+  App := TTestRunner.Create(nil);
   App.Initialize;
   App.Initialize;
   App.Title := 'FPCUnit Console Test Case runner.';
   App.Title := 'FPCUnit Console Test Case runner.';
   App.Run;
   App.Run;
   App.Free;
   App.Free;
 end.
 end.
+

+ 213 - 0
fcl/fpcunit/xmlreporter.pas

@@ -0,0 +1,213 @@
+{
+  Copyright (C) 2006 Graeme Geldenhuys <[email protected]>
+
+  This source 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 2 of the License, or (at your option)
+  any later version.
+
+  This code 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.
+
+  A copy of the GNU General Public License is available on the World Wide Web
+  at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
+  to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+  MA 02111-1307, USA.
+  
+
+  Purpose:
+    This unit contains a XML TestListener for use with the fpcUnit testing
+    framework.  It uses the XMLWrite unit, which is part of FPC, to generate
+    the XML document. The benefit of using the XMLWrite unit, is that the
+    data generated is valid XML, with resevered characters correctly escaped.
+    This allows the XML document to be further processed with XSTL etc without
+    any issues.
+
+}
+
+unit xmlreporter;
+
+{$mode objfpc}{$H+}
+
+interface
+uses
+  Classes
+  ,SysUtils
+  ,fpcUnit
+  ,TestUtils
+  ,dom
+  ,XMLWrite
+  ;
+  
+
+type
+  { XML Test Listner }
+  TXMLResultsWriter = class(TNoRefCountObject, ITestListener)
+  private
+    FDoc: TXMLDocument;
+    { These TDOMNodes are for easy access and a bit of optimization }
+    FResults: TDOMNode;
+    FListing: TDOMNode;
+    FFailures: TDOMNode;
+    FErrors: TDOMNode;
+    { Converts the actual test results into XML nodes. This gets called
+      by the public method WriteResult. }
+    procedure   TestResultAsXML(pTestResult: TTestResult);
+    { This gets called in the class constructor and sets up the starting nodes }
+    procedure   WriteHeader;
+  public
+    constructor Create;
+    destructor  Destroy; override;
+    procedure   WriteResult(aResult: TTestResult);
+
+    { ITestListener interface requirements }
+    procedure   AddFailure(ATest: TTest; AFailure: TTestFailure);
+    procedure   AddError(ATest: TTest; AError: TTestFailure);
+    procedure   StartTest(ATest: TTest);
+    procedure   EndTest(ATest: TTest);
+    
+    { A public property to the internal XML document }
+    property    Document: TXMLDocument read FDoc;
+  end;
+
+
+implementation
+
+
+{ TXMLResultsWriter }
+
+procedure TXMLResultsWriter.TestResultAsXML(pTestResult: TTestResult);
+var
+  i: longint;
+  n, lResults: TDOMNode;
+begin
+  lResults := FDoc.FindNode('TestResults');
+  n := FDoc.CreateElement('NumberOfRunnedTests');
+  n.AppendChild(FDoc.CreateTextNode(IntToStr(pTestResult.RunTests)));
+  lResults.AppendChild(n);
+
+  n := FDoc.CreateElement('NumberOfErrors');
+  n.AppendChild(FDoc.CreateTextNode(IntToStr(pTestResult.NumberOfErrors)));
+  lResults.AppendChild(n);
+
+  n := FDoc.CreateElement('NumberOfFailures');
+  n.AppendChild(FDoc.CreateTextNode(IntToStr(pTestResult.NumberOfFailures)));
+  lResults.AppendChild(n);
+  
+  if pTestResult.NumberOfErrors <> 0 then
+  begin
+    for i := 0 to pTestResult.Errors.Count - 1 do
+      AddError(nil, TTestFailure(pTestResult.Errors.Items[i]));
+  end;
+
+  if pTestResult.NumberOfFailures <> 0 then
+  begin
+    for i := 0 to pTestResult.Failures.Count - 1 do
+      AddFailure(nil, TTestFailure(pTestResult.Failures.Items[i]));
+  end;
+end;
+
+
+procedure TXMLResultsWriter.WriteHeader;
+begin
+  FResults := FDoc.CreateElement('TestResults');
+  FResults.AppendChild(FDoc.CreateComment(' Generated using FPCUnit on '
+      + FormatDateTime('yyyy-mm-dd hh:mm ', Now) ));
+  FDoc.AppendChild(FResults);
+  FListing := FDoc.CreateElement('TestListing');
+  FResults.AppendChild(FListing);
+end;
+
+
+constructor TXMLResultsWriter.Create;
+begin
+  FDoc        := TXMLDocument.Create;
+  FResults    := nil;
+  FFailures   := nil;
+  FErrors     := nil;
+  WriteHeader;
+end;
+
+
+destructor TXMLResultsWriter.Destroy;
+begin
+  FDoc.Free;
+  inherited Destroy;
+end;
+
+
+procedure TXMLResultsWriter.WriteResult(aResult: TTestResult);
+begin
+  TestResultAsXML(aResult);
+end;
+
+
+procedure TXMLResultsWriter.AddFailure(ATest: TTest; AFailure: TTestFailure);
+var
+  n: TDOMElement;
+begin
+  { Try and find the node first }
+  if not Assigned(FFailures) then
+    FFailures := FDoc.FindNode('ListOfFailures');
+  { If we couldn't find it, create it }
+  if not Assigned(FFailures) then
+  begin
+    FFailures := FDoc.CreateElement('ListOfFailures');
+    FResults.AppendChild(FFailures);
+  end;
+  
+  n := FDoc.CreateElement('Failure');
+  n.AppendChild(FDoc.CreateElement('Message')         ).AppendChild(FDoc.CreateTextNode(AFailure.AsString));
+  n.AppendChild(FDoc.CreateElement('ExceptionClass')  ).AppendChild(FDoc.CreateTextNode(AFailure.ExceptionClassName));
+  n.AppendChild(FDoc.CreateElement('ExceptionMessage')).AppendChild(FDoc.CreateTextNode(AFailure.ExceptionMessage));
+  FFailures.AppendChild(n);
+end;
+
+
+procedure TXMLResultsWriter.AddError(ATest: TTest; AError: TTestFailure);
+var
+  n: TDOMElement;
+begin
+  { Try and find the node first }
+  if not Assigned(FErrors) then
+    FErrors := FDoc.FindNode('ListOfErrors');
+  { If we couldn't find it, create it }
+  if not Assigned(FErrors) then
+  begin
+    FErrors := FDoc.CreateElement('ListOfErrors');
+    FResults.AppendChild(FErrors);
+  end;
+
+  n := FDoc.CreateElement('Error');
+  n.AppendChild(FDoc.CreateElement('Message')         ).AppendChild(FDoc.CreateTextNode(AError.AsString));
+  n.AppendChild(FDoc.CreateElement('ExceptionClass')  ).AppendChild(FDoc.CreateTextNode(AError.ExceptionClassName));
+  n.AppendChild(FDoc.CreateElement('ExceptionMessage')).AppendChild(FDoc.CreateTextNode(AError.ExceptionMessage));
+  n.AppendChild(FDoc.CreateElement('SourceUnitName')  ).AppendChild(FDoc.CreateTextNode(AError.SourceUnitName));
+  n.AppendChild(FDoc.CreateElement('LineNumber')      ).AppendChild(FDoc.CreateTextNode(IntToStr(AError.LineNumber)));
+  n.AppendChild(FDoc.CreateElement('FailedMethodName')).AppendChild(FDoc.CreateTextNode(AError.FailedMethodName));
+  FErrors.AppendChild(n);
+end;
+
+
+procedure TXMLResultsWriter.StartTest(ATest: TTest);
+var
+  n: TDOMElement;
+begin
+  if not Assigned(FListing) then
+    exit;
+  n := FDoc.CreateElement('Test');
+  n['Name'] := ATest.TestSuiteName + '.' + ATest.TestName;
+  FListing.AppendChild(n);
+end;
+
+
+procedure TXMLResultsWriter.EndTest(ATest: TTest);
+begin
+  { do nothing }
+end;
+
+
+end.
+