Commit Graph

18 Commits

Author SHA1 Message Date
Maarten Bent
7c1ab06ea5 Add more wxOVERRIDE 2018-09-22 14:44:07 +02:00
Maarten Bent
5da4e81e10 Fix type casts and invalid format specifiers in interactive tests 2018-07-29 16:29:35 +02:00
Maarten Bent
a5b1a418bb Use wxPrintf in interactive tests
Remove unneeded calls to c_str() and mb_str().
2018-07-29 16:26:41 +02:00
Maarten Bent
57180d68c8 Add wxOVERRIDE to test files
And cleanup some tailing spaces and tabs.
2018-07-29 12:08:53 +02:00
Vadim Zeitlin
e70fc11ef1 Replace CppUnit with Catch for unit tests
Drop the legacy CppUnit testing framework used for the unit tests.
Replacing it with Catch has the advantage of not requiring CppUnit
libraries to be installed on the system in order to be able to run
tests (Catch is header-only and a copy of it is now included in the
main repository itself) and, in the future, of being able to write
the tests in a much more natural way.

For now, however, avoid changing the existing tests code as much as
[reasonably] possible to avoid introducing bugs in them and provide
the CppUnit compatibility macros in the new wx/catch_cppunit.h header
which allow to preserve the 99% of the existing code unchanged. Some
of the required changes are:

 - Decompose asserts using "a && b" conditions into multiple asserts
   checking "a" and "b" independently. This would have been better
   even with CppUnit (to know which part of condition exactly failed)
   and is required with Catch.

 - Use extra parentheses around such conditions when they can't be
   easily decomposed in the arrays test, due to the use of macros.
   This is not ideal from the point of view of messages given when
   the tests fail but will do for now.

 - Rewrite asserts using "a || b" as a combination of condition
   checks and assert macros. Again, this is better anyhow, and is
   required with Catch. Incidentally, this allowed to fix a bug in
   the "exec" unit test which didn't leave enough time for the new
   process to be launched before trying to kill it.

 - Remove multiple CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() macros,
   our emulation of this macro can be used only once.

 - Provide string conversions using Catch-specific StringMaker for
   a couple of types.

 - Replace custom wxImage comparison with a Catch-specific matcher
   class.

 - Remove most of test running logic from test.cpp, in particular don't
   parse command line ourselves any longer but use Catch built-in
   command line parser. This is a source of a minor regression:
   previously, both "Foo" and "FooTestCase" could be used as the name of
   the test to run, but now only the latter is accepted.
2017-11-02 01:53:16 +01:00
VZ
4212202a9a Add support for cache directory to wxStandardPaths::GetUserDir()
This has direct equivalent under macOS and when using XDG.

See #17727.
2016-11-29 19:32:14 +01:00
Tobias Taschner
a0fb808087 Add wxStandardPaths::GetUserDir() to get Desktop, Download etc
All major supported platforms have well defined per-user directories to store
Downloads, Music, Pictures, Videos and the Desktop files. The new method
wxStandardPaths::GetUserDir() allows for a unified way to access these on MSW,
OS X and Unix (if XDG user dirs specification is implemented for the latter).

See https://github.com/wxWidgets/wxWidgets/pull/89
2015-10-04 01:05:23 +02:00
Vadim Zeitlin
51404f8792 Cast size_t value when using it with printf() in a test.
Use %lu with a cast to avoid warnings in both 32 and 64 bit builds.

Closes #16720.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-10 00:14:14 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
bb5a951418 Use __WINDOWS__ for OS checks and __WXMSW__ for GUI checks (round 2).
This is continuation of r70796 and serves the same purpose.

Closes #14065, #14066.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-03-04 20:31:42 +00:00
Vadim Zeitlin
6acd08bc95 Fix tests compilation without wxUSE_REGEX.
Don't build wxRegEx unit tests when wxUSE_REGEX == 0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-03 17:14:57 +00:00
Vadim Zeitlin
df53be12c5 Add non-vararg wxFileTypeInfo ctor and various setters.
This allows to create wxFileTypeInfo objects in a more readable even if more
verbose way.

This should also incidentally fix the unit tests compilation with VC6 which
seems to have some existential troubles with the vararg ctor in debug DLL
build (only). Using the non-vararg ctor should hopefully make it happy and let
the unit tests pass with this compiler.

Also document wxFileTypeInfo class which wasn't documented at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-01 13:05:42 +00:00
Vadim Zeitlin
0fbd8b9bbb Really fix interactive output test compilation in ANSI build.
Use a temporary wxString to make sure the code compiles in both ANSI and STL
versions too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-13 14:13:12 +00:00
Vadim Zeitlin
da569065d8 Compilation fix for "interactive" test in wxUSE_STL=1 build.
wxString is not convertible (even explicitly) to char* in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-12 22:50:41 +00:00
Stefan Csomor
a2c8b98460 trying to get it building at least
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-22 11:49:09 +00:00
Francesco Montorsi
ddd4f327f7 blind buildbot fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 23:32:34 +00:00
Francesco Montorsi
995202d020 small warning+PCH fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 21:46:29 +00:00
Francesco Montorsi
81ec0e15af move console sample's interactive tests to two different CppUnit testsuites: InteractiveInputTestCase which requires user input and InteractiveOutputTestCase which outputs stuff to be checked from the user.
Leave in the console sample only a barebone console application (i.e. a real example).

Closes #11960

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 21:03:47 +00:00