Browse Source

[3752] Added logging.spec check

Francis Dupont 10 years ago
parent
commit
9fff3d4508
2 changed files with 15 additions and 1 deletions
  1. 3 0
      src/lib/dhcpsrv/Makefile.am
  2. 12 1
      src/lib/dhcpsrv/tests/logging_unittest.cc

+ 3 - 0
src/lib/dhcpsrv/Makefile.am

@@ -177,6 +177,9 @@ EXTRA_DIST += hosts_messages.mes
 # Database schema creation script moved to src/bin/admin
 # Database schema creation script moved to src/bin/admin
 EXTRA_DIST += database_backends.dox libdhcpsrv.dox
 EXTRA_DIST += database_backends.dox libdhcpsrv.dox
 
 
+# Specification file
+EXTRA_DIST += logging.spec
+
 install-data-local:
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
 	$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
 
 

+ 12 - 1
src/lib/dhcpsrv/tests/logging_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -25,6 +25,17 @@ using namespace isc::data;
 
 
 namespace {
 namespace {
 
 
+// Helper to get the spec file
+std::string specfile(const std::string& name) {
+    return (std::string(TEST_DATA_BUILDDIR) + "/../" + name);
+}
+
+// Tests that the spec file is valid.
+TEST(LoggingTest, basicSpec) {
+    using namespace isc::config;
+    ASSERT_NO_THROW(moduleSpecFromFile(specfile("logging.spec")));
+}
+
 /// @brief Logging Test Fixture Class
 /// @brief Logging Test Fixture Class
 ///
 ///
 /// Trivial class that ensures that the logging is reset to its defaults after
 /// Trivial class that ensures that the logging is reset to its defaults after