]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5682] get-config unit-test rebuilds partially automated.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 25 Jul 2018 21:25:43 +0000 (23:25 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 30 Jul 2018 17:03:18 +0000 (19:03 +0200)
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/Makefile.am

index acdb52d3ca730604d1b73731a7dd467f33147e6d..758f23a8f39996565b8f1ef79311d6b6160e39cb 100644 (file)
@@ -392,6 +392,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
             if (config_pair.first == "sanity-checks") {
                 SanityChecksParser parser;
                 parser.parse(*srv_cfg, config_pair.second);
+                continue;
             }
 
             if (config_pair.first == "expired-leases-processing") {
index f23e046e05f3f7ef4b48838fcea329cbc5cd5130..0c31643ae6d682075ad1c0fa32f8694c7a0b584e 100644 (file)
@@ -145,3 +145,21 @@ endif
 noinst_EXTRA_DIST = configs-list.txt
 
 noinst_PROGRAMS = $(TESTS)
+
+# Use this target if you want to rebuild the get-config unit-tests.
+#
+# TODO: We could also automate the replacement step with some variation
+# of this: https://stackoverflow.com/questions/6790631
+rebuild-tests:
+       rm -f x u get_config_unittest.cc
+       cp -f get_config_unittest.cc.skel get_config_unittest.cc
+       $(MAKE) CXXFLAGS=-DEXTRACT_CONFIG V=1
+       ./dhcp4_unittests --gtest_filter="Dhcp4Parser*" > /dev/null 2> x
+       echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest.cc"
+       read -p "Press ENTER when ready"
+       $(MAKE) CXXFLAGS=-DGENERATE_ACTION V=1
+       ./dhcp4_unittests --gtest_filter="Dhcp4GetConfig*" > /dev/null 2> u
+       echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest.cc"
+       read -p "Press ENTER when ready"
+       touch get_config_unittest.cc
+       $(MAKE)
index 2de5e36898e34f00b1d6fbc563e8610d2ffd9498..c59395a4e01dfd7954576d3b7cf4ad073b20c2ba 100644 (file)
@@ -506,6 +506,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
             if (config_pair.first == "sanity-checks") {
                 SanityChecksParser parser;
                 parser.parse(*srv_config, config_pair.second);
+                continue;
             }
 
             if (config_pair.first == "expired-leases-processing") {
index 70dfc4176b4df89c5ca5b0f1377cd23ce276c2d1..f862c374a13bd606a4d8da110b1d2acfcf0f0eae 100644 (file)
@@ -144,3 +144,21 @@ dhcp6_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
 endif
 
 noinst_PROGRAMS = $(TESTS)
+
+# Use this target if you want to rebuild the get-config unit-tests.
+#
+# TODO: We could also automate the replacement step with some variation
+# of this: https://stackoverflow.com/questions/6790631
+rebuild-tests:
+       rm -f x u get_config_unittest.cc
+       cp -f get_config_unittest.cc.skel get_config_unittest.cc
+       $(MAKE) CXXFLAGS=-DEXTRACT_CONFIG V=1
+       ./dhcp6_unittests --gtest_filter="Dhcp6Parser*" > /dev/null 2> x
+       echo "Please copy content of x file into EXTRACTED_CONFIGS in get_config_unittest.cc"
+       read -p "Press ENTER when ready"
+       $(MAKE) CXXFLAGS=-DGENERATE_ACTION V=1
+       ./dhcp6_unittests --gtest_filter="Dhcp6GetConfig*" > /dev/null 2> u
+       echo "Please copy content of u file into UNPARSED_CONFIGS in get_config_unittest.cc"
+       read -p "Press ENTER when ready"
+       touch get_config_unittest.cc
+       $(MAKE)