diff --git a/tests/Makefile.in b/tests/Makefile.in index 4d6503fbe3..569f6523cd 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -68,6 +68,7 @@ TEST_OBJECTS = \ test_arrays.o \ test_base64.o \ test_cmdlinetest.o \ + test_config.o \ test_fileconf.o \ test_regconf.o \ test_datetimetest.o \ @@ -611,6 +612,9 @@ test_base64.o: $(srcdir)/base64/base64.cpp $(TEST_ODEP) test_cmdlinetest.o: $(srcdir)/cmdline/cmdlinetest.cpp $(TEST_ODEP) $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/cmdline/cmdlinetest.cpp +test_config.o: $(srcdir)/config/config.cpp $(TEST_ODEP) + $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/config/config.cpp + test_fileconf.o: $(srcdir)/config/fileconf.cpp $(TEST_ODEP) $(CXXC) -c -o $@ $(TEST_CXXFLAGS) $(srcdir)/config/fileconf.cpp diff --git a/tests/config/config.cpp b/tests/config/config.cpp index e5f13d03a8..a38bc920dd 100644 --- a/tests/config/config.cpp +++ b/tests/config/config.cpp @@ -6,8 +6,9 @@ // Copyright: (c) 2007 Marcin Wojdyr /////////////////////////////////////////////////////////////////////////////// -// NOTE: this test is compiled in test_gui because it uses wxColour for -// its testing purpose. +// NOTE: this test is compiled both as part of the non-GUI test and test_gui +// because it can only use wxColour in the latter. +// // See also tests/config/fileconf.cpp for wxFileConfig specific tests and // tests/config/regconf.cpp for wxRegConfig specific tests. @@ -25,9 +26,18 @@ #endif // WX_PRECOMP #include "wx/config.h" -#include "wx/colour.h" #include "wx/scopedptr.h" +// Tests using wxColour can only be done when using GUI library and they +// require template functions that are not supported by some ancient compilers. +#if wxUSE_GUI && defined(wxHAS_CONFIG_TEMPLATE_RW) + #define TEST_WXCOLOUR +#endif + +#ifdef TEST_WXCOLOUR + #include "wx/colour.h" +#endif + // -------------------------------------------------------------------------- // the tests // -------------------------------------------------------------------------- @@ -54,9 +64,9 @@ TEST_CASE("wxConfig::ReadWriteLocal", "[config]") config->Write("ull", uval64); config->Write("size", size_t(UINT_MAX)); -#ifdef wxHAS_CONFIG_TEMPLATE_RW +#ifdef TEST_WXCOLOUR config->Write("color1", wxColour(11,22,33,44)); -#endif // wxHAS_CONFIG_TEMPLATE_RW +#endif // TEST_WXCOLOUR config->Flush(); config.reset(new wxConfig(app, vendor, "", "", @@ -115,14 +125,14 @@ TEST_CASE("wxConfig::ReadWriteLocal", "[config]") CHECK( config->Read("size", &size) ); CHECK( size == UINT_MAX ); -#ifdef wxHAS_CONFIG_TEMPLATE_RW +#ifdef TEST_WXCOLOUR wxColour color1; r = config->Read("color1", &color1); CHECK( r ); CHECK( color1 == wxColour(11,22,33,44) ); CHECK( config->ReadObject("color1", wxNullColour) == color1 ); -#endif // wxHAS_CONFIG_TEMPLATE_RW +#endif // TEST_WXCOLOUR config->DeleteAll(); } @@ -174,12 +184,12 @@ size_t ReadValues(const wxConfig& config, bool has_values) CHECK( r == has_values ); read++; -#ifdef wxHAS_CONFIG_TEMPLATE_RW +#ifdef TEST_WXCOLOUR wxColour color1; r = config.Read("color1", &color1, wxColour(11,22,33,44)); CHECK( r == has_values ); read++; -#endif // wxHAS_CONFIG_TEMPLATE_RW +#endif // TEST_WXCOLOUR return read; } diff --git a/tests/makefile.gcc b/tests/makefile.gcc index 5671d8b2d1..2235e73821 100644 --- a/tests/makefile.gcc +++ b/tests/makefile.gcc @@ -38,6 +38,7 @@ TEST_OBJECTS = \ $(OBJS)\test_arrays.o \ $(OBJS)\test_base64.o \ $(OBJS)\test_cmdlinetest.o \ + $(OBJS)\test_config.o \ $(OBJS)\test_fileconf.o \ $(OBJS)\test_regconf.o \ $(OBJS)\test_datetimetest.o \ @@ -590,6 +591,9 @@ $(OBJS)\test_base64.o: ./base64/base64.cpp $(OBJS)\test_cmdlinetest.o: ./cmdline/cmdlinetest.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< +$(OBJS)\test_config.o: ./config/config.cpp + $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< + $(OBJS)\test_fileconf.o: ./config/fileconf.cpp $(CXX) -c -o $@ $(TEST_CXXFLAGS) $(CPPDEPS) $< diff --git a/tests/makefile.vc b/tests/makefile.vc index d819e71170..31543679c3 100644 --- a/tests/makefile.vc +++ b/tests/makefile.vc @@ -41,6 +41,7 @@ TEST_OBJECTS = \ $(OBJS)\test_arrays.obj \ $(OBJS)\test_base64.obj \ $(OBJS)\test_cmdlinetest.obj \ + $(OBJS)\test_config.obj \ $(OBJS)\test_fileconf.obj \ $(OBJS)\test_regconf.obj \ $(OBJS)\test_datetimetest.obj \ @@ -1024,6 +1025,9 @@ $(OBJS)\test_base64.obj: .\base64\base64.cpp $(OBJS)\test_cmdlinetest.obj: .\cmdline\cmdlinetest.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\cmdline\cmdlinetest.cpp +$(OBJS)\test_config.obj: .\config\config.cpp + $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\config\config.cpp + $(OBJS)\test_fileconf.obj: .\config\fileconf.cpp $(CXX) /c /nologo /TP /Fo$@ $(TEST_CXXFLAGS) .\config\fileconf.cpp diff --git a/tests/test.bkl b/tests/test.bkl index 46647e4213..df402f68dc 100644 --- a/tests/test.bkl +++ b/tests/test.bkl @@ -34,6 +34,7 @@ arrays/arrays.cpp base64/base64.cpp cmdline/cmdlinetest.cpp + config/config.cpp config/fileconf.cpp config/regconf.cpp datetime/datetimetest.cpp @@ -187,6 +188,9 @@ graphics/graphmatrix.cpp graphics/graphpath.cpp graphics/imagelist.cpp + config/config.cpp controls/auitest.cpp controls/bitmapcomboboxtest.cpp diff --git a/tests/test.vcxproj b/tests/test.vcxproj index ab71189ad2..66ad910c71 100644 --- a/tests/test.vcxproj +++ b/tests/test.vcxproj @@ -478,6 +478,7 @@ + @@ -571,4 +572,4 @@ - \ No newline at end of file + diff --git a/tests/test.vcxproj.filters b/tests/test.vcxproj.filters index e285713fbf..ca3ec7b4bb 100644 --- a/tests/test.vcxproj.filters +++ b/tests/test.vcxproj.filters @@ -70,6 +70,9 @@ Source Files + + Source Files + Source Files @@ -269,4 +272,4 @@ Source Files - \ No newline at end of file + diff --git a/tests/test_vc7_test.vcproj b/tests/test_vc7_test.vcproj index ad729621a2..c73e715c7e 100644 --- a/tests/test_vc7_test.vcproj +++ b/tests/test_vc7_test.vcproj @@ -313,6 +313,9 @@ + + diff --git a/tests/test_vc8_test.vcproj b/tests/test_vc8_test.vcproj index 46d3829bcd..225e702031 100644 --- a/tests/test_vc8_test.vcproj +++ b/tests/test_vc8_test.vcproj @@ -854,6 +854,10 @@ RelativePath=".\cmdline\cmdlinetest.cpp" > + + diff --git a/tests/test_vc9_test.vcproj b/tests/test_vc9_test.vcproj index 724a21da2f..55d584019a 100644 --- a/tests/test_vc9_test.vcproj +++ b/tests/test_vc9_test.vcproj @@ -826,6 +826,10 @@ RelativePath=".\cmdline\cmdlinetest.cpp" > + +