[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [6237] Add a simple unit test for wxPdfDocument
From: |
Greg Chicares |
Subject: |
[lmi-commits] [6237] Add a simple unit test for wxPdfDocument |
Date: |
Fri, 07 Aug 2015 00:37:15 +0000 |
Revision: 6237
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6237
Author: chicares
Date: 2015-08-07 00:37:15 +0000 (Fri, 07 Aug 2015)
Log Message:
-----------
Add a simple unit test for wxPdfDocument
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/objects.make
lmi/trunk/workhorse.make
Added Paths:
-----------
lmi/trunk/wx_pdfdoc_test.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-08-07 00:25:15 UTC (rev 6236)
+++ lmi/trunk/ChangeLog 2015-08-07 00:37:15 UTC (rev 6237)
@@ -36501,3 +36501,30 @@
Retrieve wx archives from github by sha1sum. See:
http://lists.nongnu.org/archive/html/lmi/2015-07/msg00019.html
+20150807T0003Z <address@hidden> [508]
+
+ install_wx.make
+Don't disable wxRegEx when building wx. See:
+ http://lists.nongnu.org/archive/html/lmi/2015-07/msg00020.html
+
+20150807T0007Z <address@hidden> [508]
+
+ install_wx.make
+Handle more options in portable wx-config. See:
+ http://lists.nongnu.org/archive/html/lmi/2015-07/msg00020.html
+
+20150807T0025Z <address@hidden> [508]
+
+ install_msw.sh
+ install_wxpdfdoc.make [new file]
+Install wxPdfDocument library as part of lmi installation. See:
+ http://lists.nongnu.org/archive/html/lmi/2015-07/msg00020.html
+
+20150807T0037Z <address@hidden> [508]
+
+ objects.make
+ workhorse.make
+ wx_pdfdoc_test.cpp [new file]
+Add a simple unit test for wxPdfDocument. See:
+ http://lists.nongnu.org/archive/html/lmi/2015-07/msg00020.html
+
Modified: lmi/trunk/objects.make
===================================================================
--- lmi/trunk/objects.make 2015-08-07 00:25:15 UTC (rev 6236)
+++ lmi/trunk/objects.make 2015-08-07 00:37:15 UTC (rev 6237)
@@ -454,6 +454,7 @@
value_cast_test \
vector_test \
wx_new_test \
+ wx_pdfdoc_test \
xml_serialize_test \
zero_test \
@@ -913,6 +914,10 @@
$(common_test_objects) \
wx_new_test.o \
+wx_pdfdoc_test$(EXEEXT): \
+ $(common_test_objects) \
+ wx_pdfdoc_test.o \
+
xml_serialize_test$(EXEEXT): \
$(common_test_objects) \
$(xmlwrapp_objects) \
Modified: lmi/trunk/workhorse.make
===================================================================
--- lmi/trunk/workhorse.make 2015-08-07 00:25:15 UTC (rev 6236)
+++ lmi/trunk/workhorse.make 2015-08-07 00:37:15 UTC (rev 6237)
@@ -172,6 +172,12 @@
ifeq (gcc,$(toolset))
wx_config_cxxflags := $(shell $(wx_config_script) --cxxflags)
wx_config_libs := $(shell $(wx_config_script) --libs)
+ wx_config_basename := $(shell $(wx_config_script) --basename)
+ wx_config_version := $(shell $(wx_config_script) --version)
+
+ # Define the variables used to construct the names of wxCode libraries.
+ wxcode_basename := $(shell echo $(wx_config_basename) | sed 's/^wx/wxcode/')
+ wxcode_version := $(shell echo $(wx_config_version) | sed 's/\.[0-9]*$$//')
endif
# ...combines options that we prefer to keep separate.
@@ -612,6 +618,9 @@
$(platform_wx_libraries) \
$(platform_gui_ldflags) \
+wx_pdfdoc_ldflags := \
+ -l$(wxcode_basename)_pdfdoc-$(wxcode_version)
+
################################################################################
# Flags.
@@ -853,6 +862,8 @@
wx_new$(SHREXT): wx_new.o
+wx_pdfdoc_test$(EXEEXT): EXTRA_LDFLAGS := $(wx_pdfdoc_ldflags) $(wx_ldflags)
+
wx_test$(EXEEXT): lmi_so_attributes := -DLMI_USE_SO
wx_test$(EXEEXT): EXTRA_LDFLAGS := $(wx_ldflags)
wx_test$(EXEEXT): $(wx_test_objects) skeleton$(SHREXT) liblmi$(SHREXT)
Added: lmi/trunk/wx_pdfdoc_test.cpp
===================================================================
--- lmi/trunk/wx_pdfdoc_test.cpp (rev 0)
+++ lmi/trunk/wx_pdfdoc_test.cpp 2015-08-07 00:37:15 UTC (rev 6237)
@@ -0,0 +1,55 @@
+// wxPdfDocument library unit test.
+//
+// Copyright (C) 2015 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$
+
+// This unit test checks that linking with wxPdfDocument library and
+// generating the simplest possible document with it works.
+
+#ifdef __BORLANDC__
+# include "pchfile.hpp"
+# pragma hdrstop
+#endif
+
+#include "platform_dependent.hpp" // access()
+#include "test_tools.hpp"
+
+#include <wx/pdfdoc.h>
+
+#include <wx/init.h>
+
+int test_main(int argc, char* argv[])
+{
+ wxInitializer init(argc, argv);
+ BOOST_TEST( init );
+
+ wxPdfDocument pdf_doc(wxLANDSCAPE, "pt", wxPAPER_LETTER);
+ pdf_doc.AddPage();
+ pdf_doc.SetFont("Helvetica", "", 16);
+ pdf_doc.Text(20, 20, "Hello PDF!");
+
+ char const* const p = "/tmp/eraseme.pdf";
+ pdf_doc.SaveAsFile(p);
+ BOOST_TEST_EQUAL(0, access(p, R_OK));
+ BOOST_TEST(0 == std::remove(p));
+
+ return 0;
+}
Property changes on: lmi/trunk/wx_pdfdoc_test.cpp
___________________________________________________________________
Added: svn:keywords
+ Id
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [6237] Add a simple unit test for wxPdfDocument,
Greg Chicares <=