[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5863] Add inchoate GUI test (VS)
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5863] Add inchoate GUI test (VS) |
Date: |
Sat, 01 Mar 2014 14:16:15 +0000 |
Revision: 5863
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5863
Author: chicares
Date: 2014-03-01 14:16:15 +0000 (Sat, 01 Mar 2014)
Log Message:
-----------
Add inchoate GUI test (VS)
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/Makefile.am
lmi/trunk/objects.make
lmi/trunk/skeleton.hpp
lmi/trunk/workhorse.make
Added Paths:
-----------
lmi/trunk/main_wx_test.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-02-26 21:03:29 UTC (rev 5862)
+++ lmi/trunk/ChangeLog 2014-03-01 14:16:15 UTC (rev 5863)
@@ -33619,3 +33619,13 @@
Move wxApp implementation (VS). See:
http://lists.nongnu.org/archive/html/lmi/2014-02/msg00004.html
+20140301T1416Z <address@hidden> [542]
+
+ Makefile.am
+ main_wx_test.cpp [new file]
+ objects.make
+ skeleton.hpp
+ workhorse.make
+Add inchoate GUI test (VS). See:
+ http://lists.nongnu.org/archive/html/lmi/2014-02/msg00004.html
+
Modified: lmi/trunk/Makefile.am
===================================================================
--- lmi/trunk/Makefile.am 2014-02-26 21:03:29 UTC (rev 5862)
+++ lmi/trunk/Makefile.am 2014-03-01 14:16:15 UTC (rev 5863)
@@ -112,6 +112,7 @@
test_input \
test_irc7702a \
test_istream_to_string \
+ test_lmi_wx \
test_loads \
test_map_lookup \
test_materially_equal \
@@ -729,6 +730,13 @@
timer.cpp
test_istream_to_string_CXXFLAGS = $(AM_CXXFLAGS)
+test_lmi_wx_SOURCES = \
+ main_wx_test.cpp
+test_lmi_wx_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS)
+test_lmi_wx_LDADD = \
+ liblmi_wx_lib.la \
+ $(WX_LIBS)
+
test_loads_SOURCES = \
$(common_test_objects) \
expm1.c \
Added: lmi/trunk/main_wx_test.cpp
===================================================================
--- lmi/trunk/main_wx_test.cpp (rev 0)
+++ lmi/trunk/main_wx_test.cpp 2014-03-01 14:16:15 UTC (rev 5863)
@@ -0,0 +1,94 @@
+// Main file for automated testing of wx interface.
+//
+// Copyright (C) 2014 Gregory W. Chicares.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2 as
+// published by the Free Software Foundation.
+//
+// This program 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.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+//
+// http://savannah.nongnu.org/projects/lmi
+// email: <address@hidden>
+// snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
+
+// $Id$
+
+#ifdef __BORLANDC__
+# include "pchfile.hpp"
+# pragma hdrstop
+#endif
+
+#include "test_tools.hpp"
+
+#include "skeleton.hpp"
+
+#include "fenv_guard.hpp"
+#include "fenv_lmi.hpp"
+#include "handle_exceptions.hpp"
+#include "main_common.hpp"
+#include "msw_workarounds.hpp"
+#include "path_utility.hpp"
+
+#include <wx/defs.h>
+
+class SkeletonTest;
+DECLARE_APP(SkeletonTest)
+
+class application_test
+{
+ public:
+ static void test()
+ {
+ }
+};
+
+// Application to drive the tests
+class SkeletonTest : public Skeleton
+{
+ public:
+ SkeletonTest() {}
+ virtual bool OnInit();
+
+ private:
+ void RunTheTests();
+};
+
+IMPLEMENT_APP_NO_MAIN(SkeletonTest)
+IMPLEMENT_WX_THEME_SUPPORT
+
+bool SkeletonTest::OnInit()
+{
+ if(!Skeleton::OnInit())
+ return false;
+
+ // Run the tests at idle time, when the main loop is running, in order to
+ // do it in as realistic conditions as possible.
+ CallAfter(&SkeletonTest::RunTheTests);
+
+ return true;
+}
+
+void SkeletonTest::RunTheTests()
+{
+ application_test::test();
+ ExitMainLoop();
+}
+
+int test_main(int argc, char* argv[])
+{
+ initialize_application();
+ initialize_filesystem();
+#ifdef LMI_MSW
+ MswDllPreloader::instance().PreloadDesignatedDlls();
+#endif
+ return wxEntry(argc, argv);
+}
+
Property changes on: lmi/trunk/main_wx_test.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make 2014-02-26 21:03:29 UTC (rev 5862)
+++ lmi/trunk/objects.make 2014-03-01 14:16:15 UTC (rev 5863)
@@ -346,8 +346,12 @@
lmi_wx_objects := \
main_wx.o \
+lmi_wx_test_objects := \
+ main_wx_test.o \
+
ifneq (,$(RC))
lmi_wx_objects += lmi_msw_res.o
+ lmi_wx_test_objects += lmi_msw_res.o
endif
################################################################################
Modified: lmi/trunk/skeleton.hpp
===================================================================
--- lmi/trunk/skeleton.hpp 2014-02-26 21:03:29 UTC (rev 5862)
+++ lmi/trunk/skeleton.hpp 2014-03-01 14:16:15 UTC (rev 5863)
@@ -54,7 +54,6 @@
class Skeleton
: public wxApp
, private lmi::uncopyable <Skeleton>
- ,virtual private obstruct_slicing<Skeleton>
{
public:
Skeleton();
@@ -63,6 +62,13 @@
// Called by view classes when they are instantiated.
wxMDIChildFrame* CreateChildFrame(wxDocument*, ViewEx*);
+ protected:
+ // wxApp overrides.
+ virtual bool OnExceptionInMainLoop ();
+ virtual int OnExit ();
+ virtual bool OnInit ();
+ virtual void OnUnhandledException ();
+
private:
wxMenuBar* AdjustMenus(wxMenuBar*);
@@ -111,12 +117,6 @@
void UponWindowTileHorizontally (wxCommandEvent&);
void UponWindowTileVertically (wxCommandEvent&);
- // wxApp overrides.
- virtual bool OnExceptionInMainLoop ();
- virtual int OnExit ();
- virtual bool OnInit ();
- virtual void OnUnhandledException ();
-
bool ProcessCommandLine(int argc, char* argv[]);
void UpdateViews();
Modified: lmi/trunk/workhorse.make
===================================================================
--- lmi/trunk/workhorse.make 2014-02-26 21:03:29 UTC (rev 5862)
+++ lmi/trunk/workhorse.make 2014-03-01 14:16:15 UTC (rev 5863)
@@ -96,6 +96,7 @@
ifneq (safestdlib,$(findstring safestdlib,$(build_type)))
default_targets += \
lmi_wx_shared$(EXEEXT) \
+ lmi_wx_test$(EXEEXT) \
lmi_wx_lib_shared$(SHREXT) \
wx_new$(SHREXT) \
@@ -832,6 +833,10 @@
lmi_wx_shared$(EXEEXT): EXTRA_LDFLAGS := $(wx_ldflags)
lmi_wx_shared$(EXEEXT): $(lmi_wx_objects) lmi_wx_lib_shared$(SHREXT)
liblmi$(SHREXT) wx_new$(SHREXT)
+lmi_wx_test$(EXEEXT): lmi_so_attributes := -DLMI_USE_SO
+lmi_wx_test$(EXEEXT): EXTRA_LDFLAGS := $(platform_wx_libraries)
+lmi_wx_test$(EXEEXT): $(lmi_wx_test_objects) lmi_wx_lib_shared$(SHREXT)
liblmi$(SHREXT) wx_new$(SHREXT)
+
lmi_wx_static$(EXEEXT): EXTRA_LDFLAGS := $(wx_ldflags)
lmi_wx_static$(EXEEXT): $(lmi_wx_objects) $(lmi_wx_lib_objects) liblmi.a
wx_new$(SHREXT)
@@ -973,6 +978,7 @@
$(bin_dir)/liblmi$(SHREXT) \
$(bin_dir)/lmi_cli_shared$(EXEEXT) \
$(bin_dir)/lmi_wx_shared$(EXEEXT) \
+ $(bin_dir)/lmi_wx_test$(EXEEXT) \
$(bin_dir)/wx_new$(SHREXT) \
$(wildcard $(prefix)/local/bin/*$(SHREXT)) \
$(wildcard $(prefix)/local/lib/*$(SHREXT)) \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5863] Add inchoate GUI test (VS),
Greg Chicares <=