lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 081bb55 5/5: Add a ledger unit test


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 081bb55 5/5: Add a ledger unit test
Date: Fri, 5 Oct 2018 20:32:47 -0400 (EDT)

branch: master
commit 081bb5583c51fab10c9a91284f21655ae93ddb0a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Add a ledger unit test
---
 Makefile.am     | 24 +++++++++++++++++++++++
 ledger_test.cpp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 objects.make    | 22 +++++++++++++++++++++
 3 files changed, 107 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 0d74f88..dfe3987 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,6 +113,7 @@ TESTS = \
     test_interpolate_string \
     test_irc7702a \
     test_istream_to_string \
+    test_ledger \
     test_loads \
     test_map_lookup \
     test_materially_equal \
@@ -822,6 +823,29 @@ test_istream_to_string_SOURCES = \
   timer.cpp
 test_istream_to_string_CXXFLAGS = $(AM_CXXFLAGS)
 
+test_ledger_SOURCES = \
+  $(common_test_objects) \
+  calendar_date.cpp \
+  crc32.cpp \
+  facets.cpp \
+  global_settings.cpp \
+  ledger.cpp \
+  ledger_base.cpp \
+  ledger_invariant.cpp \
+  ledger_test.cpp \
+  ledger_variant.cpp \
+  mc_enum.cpp \
+  mc_enum_types.cpp \
+  mc_enum_types_aux.cpp \
+  miscellany.cpp \
+  null_stream.cpp \
+  path_utility.cpp \
+  timer.cpp
+test_ledger_CXXFLAGS = $(AM_CXXFLAGS)
+test_ledger_LDADD = \
+  $(BOOST_LIBS) \
+  $(XMLWRAPP_LIBS)
+
 test_loads_SOURCES = \
   $(common_test_objects) \
   loads.cpp \
diff --git a/ledger_test.cpp b/ledger_test.cpp
new file mode 100644
index 0000000..641356e
--- /dev/null
+++ b/ledger_test.cpp
@@ -0,0 +1,61 @@
+// Ledger data--unit test.
+//
+// Copyright (C) 2018 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
+
+#include "pchfile.hpp"
+
+#include "ledger.hpp"
+#include "ledger_invariant.hpp"
+#include "ledger_variant.hpp"
+
+#include "test_tools.hpp"
+
+//#define SUPPRESSED_FOR_LEDGER_TEST 1
+
+//class BasicValues;
+//void LedgerInvariant::Init(BasicValues const*) {}
+
+class ledger_test
+{
+  public:
+    static void test()
+        {
+        test0();
+        test1();
+        }
+
+  private:
+    static void test0();
+    static void test1();
+};
+
+void ledger_test::test0()
+{
+}
+
+void ledger_test::test1()
+{
+}
+
+int test_main(int, char*[])
+{
+    ledger_test::test();
+    return EXIT_SUCCESS;
+}
diff --git a/objects.make b/objects.make
index 20fb150..ce549eb 100644
--- a/objects.make
+++ b/objects.make
@@ -439,6 +439,7 @@ unit_test_targets := \
   interpolate_string_test \
   irc7702a_test \
   istream_to_string_test \
+  ledger_test \
   loads_test \
   map_lookup_test \
   materially_equal_test \
@@ -731,6 +732,27 @@ istream_to_string_test$(EXEEXT): \
   istream_to_string_test.o \
   timer.o \
 
+ledger_test$(EXEEXT): \
+  $(boost_filesystem_objects) \
+  $(common_test_objects) \
+  $(xmlwrapp_objects) \
+  calendar_date.o \
+  crc32.o \
+  facets.o \
+  global_settings.o \
+  ledger.o \
+  ledger_base.o \
+  ledger_invariant.o \
+  ledger_test.o \
+  ledger_variant.o \
+  mc_enum.o \
+  mc_enum_types.o \
+  mc_enum_types_aux.o \
+  miscellany.o \
+  null_stream.o \
+  path_utility.o \
+  timer.o \
+
 loads_test$(EXEEXT): \
   $(common_test_objects) \
   loads.o \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]