applied path 906264: test program

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-03-03 22:56:16 +00:00
parent 98eae46601
commit 670ec35765
17 changed files with 1801 additions and 30 deletions
+24 -23
View File
@@ -58,7 +58,7 @@ HOST_SUFFIX = @HOST_SUFFIX@
### Variables: ###
DESTDIR =
WX_VERSION = 2.5.1
WX_VERSION = 2.5.2
LIBDIRNAME = $(top_builddir)lib
WXREGEX_CFLAGS = $(CPPFLAGS) $(CFLAGS)
WXREGEX_OBJECTS = \
@@ -1002,9 +1002,9 @@ LOCALE_LINGUAS = ca cs da de el es fi fr hu id it ja nl pl ru sl sv tr uk zh zh_
@COND_UNICODE_1@WXUNICODEFLAG = u
@COND_WXUNIV_1@WXUNIVNAME = univ
@COND_PLATFORM_WIN32_0@WXDLLNAMEPREFIX = wx_base$(WXBASEPORT)
@COND_PLATFORM_WIN32_1@WXDLLNAMEPREFIX = wxbase$(WXBASEPORT)251
@COND_PLATFORM_WIN32_1@WXDLLNAMEPREFIX = wxbase$(WXBASEPORT)252
@COND_PLATFORM_WIN32_0@WXDLLNAMEPREFIXGUI = wx_$(PORTNAME)$(WXUNIVNAME)
@COND_PLATFORM_WIN32_1@WXDLLNAMEPREFIXGUI = wx$(PORTNAME)$(WXUNIVNAME)251
@COND_PLATFORM_WIN32_1@WXDLLNAMEPREFIXGUI = wx$(PORTNAME)$(WXUNIVNAME)252
@COND_PLATFORM_WIN32_0@WXDLLVERSIONTAG = -2.5
@COND_PLATFORM_WIN32_1@WXDLLVERSIONTAG =
COND_WXUSE_REGEX_BUILTIN___wxregex___depname = \
@@ -1043,8 +1043,8 @@ COND_WXUSE_REGEX_BUILTIN___wxregex___depname = \
@COND_WXUSE_EXPAT_BUILTIN@ $(LIBDIRNAME)/$(LIBPREFIX)wxexpat$(WXDEBUGFLAG)$(HOST_SUFFIX).a
@COND_SHARED_0_WXUSE_EXPAT_BUILTIN@__install_wxexpat___depname \
@COND_SHARED_0_WXUSE_EXPAT_BUILTIN@ = install_wxexpat
@COND_PLATFORM_UNIX_0@PLUGIN_VERSION0 = 251
@COND_PLATFORM_UNIX_1@PLUGIN_VERSION0 = 2.5.1
@COND_PLATFORM_UNIX_0@PLUGIN_VERSION0 = 252
@COND_PLATFORM_UNIX_1@PLUGIN_VERSION0 = 2.5.2
@COND_PLATFORM_UNIX_0@PLUGVERDELIM =
@COND_PLATFORM_UNIX_1@PLUGVERDELIM = -
@COND_BUILD_DEBUG_UNICODE_0@PLUGINSUFFIX = _d
@@ -1414,6 +1414,7 @@ COND_TOOLKIT_MOTIF_GUI_HDR = \
wx/motif/cursor.h \
wx/motif/dataform.h \
wx/motif/dataobj.h \
wx/motif/dataobj2.h \
wx/motif/dc.h \
wx/motif/dcclient.h \
wx/motif/dcmemory.h \
@@ -5476,9 +5477,9 @@ COND_WITH_PLUGIN_SDL_1___sound_sdl___depname = \
@COND_WITH_PLUGIN_SDL_1@__install_sound_sdl___depname = install_sound_sdl
@COND_USE_GUI_1@__install_afm___depname = install-afm
@COND_USE_GUI_1@__install_gsafm___depname = install-gsafm
@COND_TOOLKIT_MAC@__macos_res___depname = lib/libwx_$(TOOLCHAIN_NAME).1.r
@COND_TOOLKIT_MAC@__macos_res___depname = lib/libwx_$(TOOLCHAIN_NAME).2.r
@COND_TOOLKIT_MAC@__macos_res_install___depname = macos-res-install
@COND_TOOLKIT_COCOA@__cocoa_res___depname = lib/libwx_$(TOOLCHAIN_NAME).1.r
@COND_TOOLKIT_COCOA@__cocoa_res___depname = lib/libwx_$(TOOLCHAIN_NAME).2.r
@COND_TOOLKIT_COCOA@__cocoa_res_install___depname = cocoa-res-install
@COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS =
COND_TOOLKIT_GTK___LOWLEVEL_SRC_OBJECTS = \
@@ -6180,13 +6181,13 @@ COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_9 = \
corelib_utilsx.o \
corelib_window.o
@COND_TOOLKIT_X11@__LOWLEVEL_SRC_OBJECTS_9 = $(COND_TOOLKIT_X11___LOWLEVEL_SRC_OBJECTS_9)
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@dll___targetsuf2 = .$(SO_SUFFIX).1
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf2 = .1.$(SO_SUFFIX)
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@dll___targetsuf2 = .$(SO_SUFFIX).2
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf2 = .2.$(SO_SUFFIX)
@COND_USE_SOVERSION_0@dll___targetsuf2 = .$(SO_SUFFIX)
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@dll___targetsuf3 \
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@ = .$(SO_SUFFIX).1.0.0
@COND_PLATFORM_MACOSX_0_USE_SOVERSION_1@ = .$(SO_SUFFIX).2.0.0
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@dll___targetsuf3 \
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .1.0.0.$(SO_SUFFIX)
@COND_PLATFORM_MACOSX_1_USE_SOVERSION_1@ = .2.0.0.$(SO_SUFFIX)
@COND_USE_SOVERSION_0@dll___targetsuf3 = .$(SO_SUFFIX)
@COND_PLATFORM_MACOSX_1@dll___macver = \
@COND_PLATFORM_MACOSX_1@ -compatibility_version $(WX_VERSION) \
@@ -6316,8 +6317,8 @@ clean:
rm -f $(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)_gl-2.5$(HOST_SUFFIX).a
rm -f $(DLLPREFIX_MODULE)sound_sdl$(PLUGINSUFFIX)$(PLUGVERDELIM)$(PLUGIN_VERSION0)$(WXCOMPILER).$(SO_SUFFIX_MODULE)
(cd samples && $(MAKE) clean)
rm -f lib/libwx_$(TOOLCHAIN_NAME).1.rsrc lib/libwx_$(TOOLCHAIN_NAME).1.r
rm -f lib/libwx_$(TOOLCHAIN_NAME).1.rsrc lib/libwx_$(TOOLCHAIN_NAME).1.r
rm -f lib/libwx_$(TOOLCHAIN_NAME).2.rsrc lib/libwx_$(TOOLCHAIN_NAME).2.r
rm -f lib/libwx_$(TOOLCHAIN_NAME).2.rsrc lib/libwx_$(TOOLCHAIN_NAME).2.r
distclean: clean
rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
@@ -6678,21 +6679,21 @@ locale_install:
fi ; \
done
@COND_TOOLKIT_MAC@lib/libwx_$(TOOLCHAIN_NAME).1.r:
@COND_TOOLKIT_MAC@ $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/mac/apprsrc.r $(top_srcdir)/src/mac/carbrsrc.r $(top_srcdir)/src/mac/corersrc.r -o lib/libwx_$(TOOLCHAIN_NAME).1.rsrc
@COND_TOOLKIT_MAC@ $(DEREZ) lib/libwx_$(TOOLCHAIN_NAME).1.rsrc Carbon.r -useDF >lib/libwx_$(TOOLCHAIN_NAME).1.r
@COND_TOOLKIT_MAC@lib/libwx_$(TOOLCHAIN_NAME).2.r:
@COND_TOOLKIT_MAC@ $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/mac/apprsrc.r $(top_srcdir)/src/mac/carbrsrc.r $(top_srcdir)/src/mac/corersrc.r -o lib/libwx_$(TOOLCHAIN_NAME).2.rsrc
@COND_TOOLKIT_MAC@ $(DEREZ) lib/libwx_$(TOOLCHAIN_NAME).2.rsrc Carbon.r -useDF >lib/libwx_$(TOOLCHAIN_NAME).2.r
@COND_TOOLKIT_MAC@macos-res-install: $(__macos_res___depname)
@COND_TOOLKIT_MAC@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).1.r $(libdir)
@COND_TOOLKIT_MAC@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).1.rsrc $(libdir)
@COND_TOOLKIT_MAC@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).2.r $(libdir)
@COND_TOOLKIT_MAC@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).2.rsrc $(libdir)
@COND_TOOLKIT_COCOA@lib/libwx_$(TOOLCHAIN_NAME).1.r:
@COND_TOOLKIT_COCOA@ $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/cocoa/dummy.r -o lib/libwx_$(TOOLCHAIN_NAME).1.rsrc
@COND_TOOLKIT_COCOA@ $(DEREZ) lib/libwx_$(TOOLCHAIN_NAME).1.rsrc -useDF >lib/libwx_$(TOOLCHAIN_NAME).1.r
@COND_TOOLKIT_COCOA@lib/libwx_$(TOOLCHAIN_NAME).2.r:
@COND_TOOLKIT_COCOA@ $(RESCOMP) -d __UNIX__ -useDF $(top_srcdir)/src/cocoa/dummy.r -o lib/libwx_$(TOOLCHAIN_NAME).2.rsrc
@COND_TOOLKIT_COCOA@ $(DEREZ) lib/libwx_$(TOOLCHAIN_NAME).2.rsrc -useDF >lib/libwx_$(TOOLCHAIN_NAME).2.r
@COND_TOOLKIT_COCOA@cocoa-res-install: $(__macos_res___depname)
@COND_TOOLKIT_COCOA@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).1.r $(libdir)
@COND_TOOLKIT_COCOA@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).1.rsrc $(libdir)
@COND_TOOLKIT_COCOA@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).2.r $(libdir)
@COND_TOOLKIT_COCOA@ $(INSTALL_DATA) lib/libwx_$(TOOLCHAIN_NAME).2.rsrc $(libdir)
wxregex_regcomp.o: $(srcdir)/src/regex/regcomp.c
$(CCC) -c -o $@ $(WXREGEX_CFLAGS) $<
Vendored
+82 -1
View File
@@ -1091,7 +1091,7 @@ AC_DEFUN(PKG_CHECK_MODULES, [
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN(AM_PATH_SDL,
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
@@ -2015,3 +2015,84 @@ AC_DEFUN(AC_BAKEFILE,
builtin(include, autoconf_inc.m4)
])
dnl
dnl AM_PATH_CPPUNIT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl
AC_DEFUN(AM_PATH_CPPUNIT,
[
AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
cppunit_config_prefix="$withval", cppunit_config_prefix="")
AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
if test x$cppunit_config_exec_prefix != x ; then
cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
fi
fi
if test x$cppunit_config_prefix != x ; then
cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
fi
fi
AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
cppunit_version_min=$1
AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
no_cppunit=""
if test "$CPPUNIT_CONFIG" = "no" ; then
no_cppunit=yes
else
CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
cppunit_version=`$CPPUNIT_CONFIG --version`
cppunit_major_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_major_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_version_proper=`expr \
$cppunit_major_version \> $cppunit_major_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \> $cppunit_minor_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \= $cppunit_minor_min \& \
$cppunit_micro_version \>= $cppunit_micro_min `
if test "$cppunit_version_proper" = "1" ; then
AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
else
AC_MSG_RESULT(no)
no_cppunit=yes
fi
fi
if test "x$no_cppunit" = x ; then
ifelse([$2], , :, [$2])
else
CPPUNIT_CFLAGS=""
CPPUNIT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
])
+1
View File
@@ -44,6 +44,7 @@
../../contrib/samples/*/*.bkl
../../contrib/samples/*/*/*.bkl
../../contrib/utils/*/*.bkl
../../tests/*.bkl
</input>
<!-- List of output formats to generate: -->
+5
View File
@@ -62,6 +62,11 @@
</if>
</template>
<template id="wx_test_console" template="wx_sample_console">
<cppflags>$(CPPUNIT_CFLAGS)</cppflags>
<ldflags>$(CPPUNIT_LIBS)</ldflags>
</template>
<!-- =============================================================== -->
<!-- Support for samples data files: -->
+17
View File
@@ -177,6 +177,23 @@ where object files are stored as well as the location of
compiled .lib files and setup.h under the lib/ toplevel directory.
</description>
</option>
<!-- unit tests support: -->
<option name="CPPUNIT_CFLAGS">
<default-value></default-value>
<description>
Compiler flags needed to compile test suite in tests directory. If you want
to run the tests, set it so that the compiler can find CppUnit headers.
</description>
</option>
<option name="CPPUNIT_LIBS">
<default-value></default-value>
<description>
Linker flags needed to link test suite in tests directory. If you want
to run the tests, include CppUnit library here.
</description>
</option>
<!-- ================================================================== -->
Vendored
+138 -2
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -5956,6 +5956,8 @@ AC_SUBST(TOOLKIT_VERSION)
AC_SUBST(SAMPLES_RPATH_FLAG)
AC_SUBST(SAMPLES_RPATH_POSTLINK)
AC_SUBST(HOST_SUFFIX)
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
AC_BAKEFILE
@@ -6168,6 +6170,8 @@ else dnl we build wxBase only
dnl there are no wxBase programs in contrib nor demos
SUBDIRS="samples utils"
fi
dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected
AM_PATH_CPPUNIT(1.8.0, SUBDIRS="$SUBDIRS tests")
for subdir in `echo $SUBDIRS`; do
if test -d ${srcdir}/${subdir} ; then
@@ -6189,11 +6193,13 @@ for subdir in `echo $SUBDIRS`; do
dnl wxBase
if test ${subdir} = "samples"; then
makefiles="samples/Makefile.in samples/console/Makefile.in"
else dnl utils
elif test ${subdir} = "utils"; then
makefiles="utils/HelpGen/Makefile.in \
utils/HelpGen/src/Makefile.in \
utils/tex2rtf/Makefile.in \
utils/tex2rtf/src/Makefile.in"
else dnl assume that everything compiles for tests
makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)`
fi
fi
+49 -3
View File
@@ -3,7 +3,7 @@
Unit tests for wxWindows are written using small cppunit framework. To compile
(but not to run) them you need to have it installed. Hence the first part of
this note exlpains how to do it while the second one explains how to write the
this note explains how to do it while the second one explains how to write the
test.
I. CppUnit Installation
@@ -27,15 +27,61 @@ II. Writing tests with CppUnit
1. Create a new directory tests/foo
2. Write the main.cpp file for the test program copying, if you want,
2. Write a cpp file for the test copying, if you want,
from one of the existing tests. The things to look for:
a) #include "wx/cppunit.h" instead of directly including CppUnit headers
b) don't put too many things in one test case nor in one method of a test
case as it makes understanding what exactly failed harder later
c) 'register' your tests as follows so that the test program will find and
execute them:
// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION(MBConvTestCase);
// also include in it's own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(MBConvTestCase, "MBConvTestCase");
Read CppUnit documentation for more.
3. Write a bakefile for the new test (again, copy an existing one...)
3. add a '<sources>' tag for your source file to tests/test.bkl
III. Running the tests
----------------------
1. Regenerate the make/project files from test.bkl using bakefile_gen, e.g.:
cd build/bakefile
bakefile_gen ../../tests/test.bkl
and if you're on a unix system re-run configure.
2. Build the test program using one of the make/project files in the tests
subdirectory.
3. Run the test program with no arguments to run the default set of tests
(which are all those registered with CPPUNIT_TEST_SUITE_REGISTRATION).
Or to list the tests without running them:
test -l
4. Tests that have been registered under a name using
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION can also be run separately. For
example:
test MBConvTestCase
or to list the tests:
test -l MBConvTestCase
IV. Notes
---------
1. You can register your tests (or a subset of them) just under a name, and not
in the unnamed registry if you don't want them to be executed by default.
2. If you are going to register your tests both in the unnamed registry and
under a name, then use the name that the tests have in the 'test -l'
listing (which is often the name of the TestCase class). Then the top
level names in a 'test -l' listing can be a hint as to the name those
tests have been registered under.
=== EOF ===
+113
View File
@@ -0,0 +1,113 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.1.3 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@MAKE_SET@
prefix = @prefix@
exec_prefix = @exec_prefix@
INSTALL = @INSTALL@
EXEEXT = @EXEEXT@
SETFILE = @SETFILE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
CPPUNIT_LIBS = @CPPUNIT_LIBS@
TOOLKIT = @TOOLKIT@
TOOLKIT_LOWERCASE = @TOOLKIT_LOWERCASE@
TOOLKIT_VERSION = @TOOLKIT_VERSION@
EXTRALIBS = @EXTRALIBS@
HOST_SUFFIX = @HOST_SUFFIX@
SAMPLES_RPATH_FLAG = @SAMPLES_RPATH_FLAG@
SAMPLES_RPATH_POSTLINK = @SAMPLES_RPATH_POSTLINK@
### Variables: ###
DESTDIR =
LIBDIRNAME = $(top_builddir)lib
TEST_CXXFLAGS = -D__WX$(TOOLKIT)__ $(__WXUNIV_DEFINE_p) -I$(srcdir) \
$(__DLLFLAG_p) $(CPPUNIT_CFLAGS) $(CPPFLAGS) $(CXXFLAGS)
TEST_OBJECTS = \
test_test.o \
test_main.o
### Conditionally set variables: ###
@COND_DEPS_TRACKING_0@CXXC = $(CXX)
@COND_DEPS_TRACKING_1@CXXC = $(top_builddir)./bk-deps $(CXX)
@COND_USE_GUI_0@PORTNAME = base
@COND_USE_GUI_1@PORTNAME = $(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)
@COND_TOOLKIT_MAC@WXBASEPORT = _carbon
@COND_BUILD_DEBUG_DEBUG_FLAG_DEFAULT@WXDEBUGFLAG = d
@COND_DEBUG_FLAG_1@WXDEBUGFLAG = d
@COND_UNICODE_1@WXUNICODEFLAG = u
@COND_WXUNIV_1@WXUNIVNAME = univ
@COND_PLATFORM_MAC_1@__test___mac_setfilecmd = \
@COND_PLATFORM_MAC_1@ $(SETFILE) -t APPL test$(EXEEXT)
@COND_WXUNIV_1@__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
@COND_SHARED_1@__DLLFLAG_p = -DWXUSINGDLL
@COND_MONOLITHIC_0@__WXLIB_BASE_p = \
@COND_MONOLITHIC_0@ -lwx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
COND_MONOLITHIC_1___WXLIB_MONO_p = \
-lwx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)-2.5$(HOST_SUFFIX)
@COND_MONOLITHIC_1@__WXLIB_MONO_p = $(COND_MONOLITHIC_1___WXLIB_MONO_p)
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@__LIB_TIFF_p \
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ = \
@COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN@ -lwxtiff$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@__LIB_JPEG_p \
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ = \
@COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN@ -lwxjpeg$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@__LIB_PNG_p \
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@ = \
@COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN@ -lwxpng$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_WXUSE_ZLIB_BUILTIN@__LIB_ZLIB_p = \
@COND_WXUSE_ZLIB_BUILTIN@ -lwxzlib$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_WXUSE_ODBC_BUILTIN@__LIB_ODBC_p = \
@COND_WXUSE_ODBC_BUILTIN@ -lwxodbc$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_WXUSE_REGEX_BUILTIN@__LIB_REGEX_p = \
@COND_WXUSE_REGEX_BUILTIN@ -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(HOST_SUFFIX)
@COND_WXUSE_EXPAT_BUILTIN@__LIB_EXPAT_p = \
@COND_WXUSE_EXPAT_BUILTIN@ -lwxexpat$(WXDEBUGFLAG)$(HOST_SUFFIX)
### Targets: ###
all: test$(EXEEXT)
install: all
uninstall:
install-strip: install
clean:
rm -rf ./.deps ./.pch
rm -f ./*.o
rm -f test$(EXEEXT)
distclean: clean
rm -f configure config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
test$(EXEEXT): $(TEST_OBJECTS)
$(CXX) -o $@ $(TEST_OBJECTS) $(LDFLAGS) -L$(LIBDIRNAME) $(SAMPLES_RPATH_FLAG) $(CPPUNIT_LIBS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) $(__LIB_ZLIB_p) $(__LIB_ODBC_p) $(__LIB_REGEX_p) $(__LIB_EXPAT_p) $(EXTRALIBS)
$(__test___mac_setfilecmd) $(SAMPLES_RPATH_POSTLINK)
test_test.o: $(srcdir)/test.cpp
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $<
test_main.o: $(srcdir)/mbconv/main.cpp
$(CXXC) -c -o $@ $(TEST_CXXFLAGS) $<
# Include dependency info, if present:
@IF_GNU_MAKE@-include .deps/*.d
.PHONY: all install uninstall clean distclean
+158
View File
@@ -0,0 +1,158 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.1.3 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
.autodepend
!ifndef BCCDIR
!ifndef MAKEDIR
!error Your Borland compiler does not define MAKEDIR. Please define the BCCDIR variable, e.g. BCCDIR=d:\bc4
!endif
BCCDIR = $(MAKEDIR)\..
!endif
!include ../build/msw/config.bcc
# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------
### Variables: ###
OBJS = \
bcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
SETUPHDIR = \
$(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
TEST_CXXFLAGS = $(__RUNTIME_LIBS_6) -I$(BCCDIR)\include $(__DEBUGINFO) \
$(__OPTIMIZEFLAG_2) -tWM -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
$(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) -I.\..\include -I$(SETUPHDIR) -I. \
$(__DLLFLAG_p) $(CPPUNIT_CFLAGS) $(CPPFLAGS) $(CXXFLAGS)
TEST_OBJECTS = \
$(OBJS)\test_test.obj \
$(OBJS)\test_main.obj
### Conditionally set variables: ###
!if "$(USE_GUI)" == "0"
PORTNAME = base
!endif
!if "$(USE_GUI)" == "1"
PORTNAME = msw
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default"
WXDEBUGFLAG = d
!endif
!if "$(DEBUG_FLAG)" == "1"
WXDEBUGFLAG = d
!endif
!if "$(UNICODE)" == "1"
WXUNICODEFLAG = u
!endif
!if "$(WXUNIV)" == "1"
WXUNIVNAME = univ
!endif
!if "$(SHARED)" == "1"
WXDLLFLAG = dll
!endif
!if "$(BUILD)" == "debug"
__OPTIMIZEFLAG_2 = -Od
!endif
!if "$(BUILD)" == "release"
__OPTIMIZEFLAG_2 = -O2
!endif
!if "$(RUNTIME_LIBS)" == "dynamic"
__RUNTIME_LIBS_6 = -tWR
!endif
!if "$(RUNTIME_LIBS)" == "static"
__RUNTIME_LIBS_6 =
!endif
!if "$(RUNTIME_LIBS)" == "dynamic"
__RUNTIME_LIBS_7 = i
!endif
!if "$(RUNTIME_LIBS)" == "static"
__RUNTIME_LIBS_7 =
!endif
!if "$(WXUNIV)" == "1"
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default"
__DEBUG_DEFINE_p = -D__WXDEBUG__
!endif
!if "$(DEBUG_FLAG)" == "1"
__DEBUG_DEFINE_p = -D__WXDEBUG__
!endif
!if "$(UNICODE)" == "1"
__UNICODE_DEFINE_p = -D_UNICODE
!endif
!if "$(SHARED)" == "1"
__DLLFLAG_p = -DWXUSINGDLL
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_BASE_p = wxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib
!endif
!if "$(MONOLITHIC)" == "1"
__WXLIB_MONO_p = \
wx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib
!endif
!if "$(USE_GUI)" == "1"
__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib
!endif
!if "$(MSLU)" == "1"
__UNICOWS_LIB_p = unicows.lib
!endif
!if "$(SHARED)" == "0"
LIBDIRNAME = .\..\lib\bcc_lib$(CFG)
!endif
!if "$(SHARED)" == "1"
LIBDIRNAME = .\..\lib\bcc_dll$(CFG)
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO = -v
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO = -v-
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO = -v-
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO = -v
!endif
all: $(OBJS)
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
### Targets: ###
all: $(OBJS)\test.exe
clean:
-if exist $(OBJS)\*.obj del $(OBJS)\*.obj
-if exist $(OBJS)\*.res del $(OBJS)\*.res
-if exist $(OBJS)\test.exe del $(OBJS)\test.exe
-if exist $(OBJS)\test.tds del $(OBJS)\test.tds
-if exist $(OBJS)\test.ilc del $(OBJS)\test.ilc
-if exist $(OBJS)\test.ild del $(OBJS)\test.ild
-if exist $(OBJS)\test.ilf del $(OBJS)\test.ilf
-if exist $(OBJS)\test.ils del $(OBJS)\test.ils
$(OBJS)\test.exe: $(TEST_OBJECTS)
ilink32 -Tpe -q $(LDFLAGS) -L$(BCCDIR)\lib -L$(BCCDIR)\lib\psdk $(__DEBUGINFO) -L$(LIBDIRNAME) -ap $(CPPUNIT_LIBS) @&&|
c0x32.obj $(TEST_OBJECTS),$@,, $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib $(__UNICOWS_LIB_p) ole2w32.lib oleacc.lib odbc32.lib import32.lib cw32mt$(__RUNTIME_LIBS_7).lib,,
|
$(OBJS)\test_test.obj: .\test.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
$(OBJS)\test_main.obj: .\mbconv\main.cpp
$(CXX) -q -c -P -o$@ $(TEST_CXXFLAGS) $**
+154
View File
@@ -0,0 +1,154 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.1.3 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
include ../build/msw/config.gcc
# -------------------------------------------------------------------------
# Do not modify the rest of this file!
# -------------------------------------------------------------------------
### Variables: ###
OBJS = \
gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
SETUPHDIR = \
$(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
TEST_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG_2) $(GCCFLAGS) -DHAVE_W32API_H \
-D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) $(__UNICODE_DEFINE_p) \
-I.\..\include -I$(SETUPHDIR) -Wall -I. $(__DLLFLAG_p) $(CPPUNIT_CFLAGS) \
$(__EXCEPTIONSFLAG_4) $(__EXCEPTIONSFLAG_5) $(CPPFLAGS) $(CXXFLAGS)
TEST_OBJECTS = \
$(OBJS)\test_test.o \
$(OBJS)\test_main.o
### Conditionally set variables: ###
ifeq ($(GCC_VERSION),2.95)
GCCFLAGS = -fvtable-thunks
endif
ifeq ($(USE_GUI),0)
PORTNAME = base
endif
ifeq ($(USE_GUI),1)
PORTNAME = msw
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_FLAG),default)
WXDEBUGFLAG = d
endif
endif
ifeq ($(DEBUG_FLAG),1)
WXDEBUGFLAG = d
endif
ifeq ($(UNICODE),1)
WXUNICODEFLAG = u
endif
ifeq ($(WXUNIV),1)
WXUNIVNAME = univ
endif
ifeq ($(SHARED),1)
WXDLLFLAG = dll
endif
ifeq ($(BUILD),debug)
__OPTIMIZEFLAG_2 = -O0
endif
ifeq ($(BUILD),release)
__OPTIMIZEFLAG_2 = -O2
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONSFLAG_4 = -fno-rtti
endif
ifeq ($(USE_EXCEPTIONS),1)
__EXCEPTIONSFLAG_4 =
endif
ifeq ($(USE_EXCEPTIONS),0)
__EXCEPTIONSFLAG_5 = -fno-exceptions
endif
ifeq ($(USE_EXCEPTIONS),1)
__EXCEPTIONSFLAG_5 =
endif
ifeq ($(WXUNIV),1)
__WXUNIV_DEFINE_p = -D__WXUNIVERSAL__
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_FLAG),default)
__DEBUG_DEFINE_p = -D__WXDEBUG__
endif
endif
ifeq ($(DEBUG_FLAG),1)
__DEBUG_DEFINE_p = -D__WXDEBUG__
endif
ifeq ($(UNICODE),1)
__UNICODE_DEFINE_p = -D_UNICODE
endif
ifeq ($(SHARED),1)
__DLLFLAG_p = -DWXUSINGDLL
endif
ifeq ($(MONOLITHIC),0)
__WXLIB_BASE_p = -lwxbase25$(WXUNICODEFLAG)$(WXDEBUGFLAG)
endif
ifeq ($(MONOLITHIC),1)
__WXLIB_MONO_p = \
-lwx$(PORTNAME)$(WXUNIVNAME)25$(WXUNICODEFLAG)$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_TIFF_p = -lwxtiff$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_JPEG_p = -lwxjpeg$(WXDEBUGFLAG)
endif
ifeq ($(USE_GUI),1)
__LIB_PNG_p = -lwxpng$(WXDEBUGFLAG)
endif
ifeq ($(MSLU),1)
__UNICOWS_LIB_p = -lunicows
endif
ifeq ($(SHARED),0)
LIBDIRNAME = .\..\lib\gcc_lib$(CFG)
endif
ifeq ($(SHARED),1)
LIBDIRNAME = .\..\lib\gcc_dll$(CFG)
endif
ifeq ($(BUILD),debug)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO = -g
endif
endif
ifeq ($(BUILD),release)
ifeq ($(DEBUG_INFO),default)
__DEBUGINFO =
endif
endif
ifeq ($(DEBUG_INFO),0)
__DEBUGINFO =
endif
ifeq ($(DEBUG_INFO),1)
__DEBUGINFO = -g
endif
all: $(OBJS)
$(OBJS):
-if not exist $(OBJS) mkdir $(OBJS)
### Targets: ###
all: $(OBJS)\test.exe
clean:
-if exist $(OBJS)\*.o del $(OBJS)\*.o
-if exist $(OBJS)\test.exe del $(OBJS)\test.exe
$(OBJS)\test.exe: $(TEST_OBJECTS)
$(CXX) -o $@ $(TEST_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) -mthreads -L$(LIBDIRNAME) $(CPPUNIT_LIBS) $(__WXLIB_BASE_p) $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) -lwxzlib$(WXDEBUGFLAG) -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(__UNICOWS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
$(OBJS)\test_test.o: ./test.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
$(OBJS)\test_main.o: ./mbconv/main.cpp
$(CXX) -c -o $@ $(TEST_CXXFLAGS) $<
.PHONY: all clean
+214
View File
File diff suppressed because it is too large Load Diff
+208
View File
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" ?>
<!-- $id$ -->
<makefile>
<include file="../build/bakefiles/common_samples.bkl"/>
<exe id="test" template="wx_test_console"
template_append="wx_append_base">
<sources>
test.cpp
mbconv/main.cpp
</sources>
<wx-lib>base</wx-lib>
</exe>
</makefile>
+136
View File
@@ -0,0 +1,136 @@
///////////////////////////////////////////////////////////////////////////////
// Name: test.cpp
// Purpose: Test program for wxWidgets
// Author: Mike Wetherell
// RCS-ID: $Id$
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWidgets licence
///////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation
#pragma interface
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/cmdline.h"
#include "wx/cppunit.h"
#include <iostream>
using namespace std;
using namespace CppUnit;
// The application class
//
class TestApp : public wxAppConsole
{
public:
TestApp();
// standard overrides
void OnInitCmdLine(wxCmdLineParser& parser);
bool OnCmdLineParsed(wxCmdLineParser& parser);
bool OnInit();
int OnRun();
private:
void List(Test *test, int depth = 0) const;
// command lines options/parameters
bool m_list;
string m_registry;
};
IMPLEMENT_APP_CONSOLE(TestApp)
TestApp::TestApp()
: m_list(false)
{
}
// Init
//
bool TestApp::OnInit()
{
cout << "Test program for wxWidgets\n"
<< "build: " << WX_BUILD_OPTIONS_SIGNATURE << endl;
return wxAppConsole::OnInit();
};
// The table of command line options
//
void TestApp::OnInitCmdLine(wxCmdLineParser& parser)
{
wxAppConsole::OnInitCmdLine(parser);
static const wxCmdLineEntryDesc cmdLineDesc[] = {
{ wxCMD_LINE_SWITCH, _T("l"), _T("list"),
_T("list the tests, do not run them"),
wxCMD_LINE_VAL_NONE, 0 },
{ wxCMD_LINE_PARAM, 0, 0, _T("REGISTRY"), wxCMD_LINE_VAL_STRING,
wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE , 0, 0, 0, wxCMD_LINE_VAL_NONE, 0 }
};
parser.SetDesc(cmdLineDesc);
}
// Handle command line options
//
bool TestApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if (parser.GetParamCount() > 0)
m_registry = parser.GetParam(0).mb_str();
m_list = parser.Found(_T("list"));
return wxAppConsole::OnCmdLineParsed(parser);
}
// Run
//
int TestApp::OnRun()
{
Test *test = m_registry.empty()?
TestFactoryRegistry::getRegistry().makeTest() :
TestFactoryRegistry::getRegistry(m_registry).makeTest();
if (m_list) {
List(test);
return EXIT_SUCCESS;
} else {
TextUi::TestRunner runner;
runner.addTest(test);
return runner.run("", false, true, false) ? EXIT_SUCCESS : EXIT_FAILURE;
}
}
// List the tests
//
void TestApp::List(Test *test, int depth /*=0*/) const
{
cout << string(depth * 2, ' ') << test->getName() << "\n";
TestSuite *suite = dynamic_cast<TestSuite*>(test);
if (suite) {
typedef const std::vector<Test*> Tests;
typedef Tests::const_iterator Iter;
Tests& tests = suite->getTests();
for (Iter it = tests.begin(); it != tests.end(); ++it)
List(*it, depth + 1);
}
}
+447
View File
File diff suppressed because it is too large Load Diff
+31
View File
@@ -0,0 +1,31 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "test"=test.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name base
End Project Dependency
}}}
###############################################################################
Project: "base"=..\build\msw\wx_base.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################