From: Greg Hudson Date: Mon, 15 Jul 2019 19:09:30 +0000 (-0400) Subject: Add profile tests for final nodes X-Git-Tag: krb5-1.18-beta1~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63fe2905901fa8b06cfccb8f8fe136d556e8cb6c;p=thirdparty%2Fkrb5.git Add profile tests for final nodes --- diff --git a/src/util/profile/Makefile.in b/src/util/profile/Makefile.in index ba589c4250..079443e620 100644 --- a/src/util/profile/Makefile.in +++ b/src/util/profile/Makefile.in @@ -129,7 +129,7 @@ profile_tcl: profile_tcl.o $(PROF_DEPLIB) $(COM_ERR_DEPLIB) $(SUPPORT_DEPLIB) clean-unix:: clean-libs clean-libobjs $(RM) $(PROGS) *.o *~ core prof_err.h profile.h prof_err.c $(RM) test_load test_parse test_profile test_vtable profile_tcl - $(RM) modtest.conf testinc.ini testinc2.ini + $(RM) modtest.conf testinc.ini testinc2.ini final.out $(RM) -r test_include_dir clean-windows:: @@ -140,7 +140,23 @@ check-unix: test_parse test_profile test_vtable test_load modtest.conf $(RUN_TEST) ./test_load DO_TCL=@DO_TCL@ -check-unix: check-unix-tcl-$(DO_TCL) +check-unix: check-unix-final check-unix-tcl-$(DO_TCL) + +F1=$(srcdir)/final1.ini +F2=$(srcdir)/final2.ini +F3=$(srcdir)/final3.ini +F4=$(srcdir)/final4.ini +F5=$(srcdir)/final5.ini +QUERY=query section subsection key +check-unix-final: test_profile + $(RM) final.out + (echo; $(RUN_TEST) ./test_profile $(F1):$(F1) $(QUERY)) > final.out + (echo; $(RUN_TEST) ./test_profile $(F2):$(F1) $(QUERY)) >> final.out + (echo; $(RUN_TEST) ./test_profile $(F3):$(F1) $(QUERY)) >> final.out + (echo; $(RUN_TEST) ./test_profile $(F4):$(F1) $(QUERY)) >> final.out + (echo; $(RUN_TEST) ./test_profile $(F5):$(F1) $(QUERY)) >> final.out + cmp final.out $(srcdir)/final.expected + $(RM) final.out check-unix-tcl-: @echo "+++" diff --git a/src/util/profile/final.expected b/src/util/profile/final.expected new file mode 100644 index 0000000000..fb23b3ccc0 --- /dev/null +++ b/src/util/profile/final.expected @@ -0,0 +1,12 @@ + +value1 +value1 + +value2 +value1 + +value3 + +value4 + +value5 diff --git a/src/util/profile/final1.ini b/src/util/profile/final1.ini new file mode 100644 index 0000000000..0419addff2 --- /dev/null +++ b/src/util/profile/final1.ini @@ -0,0 +1,6 @@ +# A basic profile setting a single relation in a subsection, with +# nothing marked final. +[section] + subsection = { + key = value1 + } diff --git a/src/util/profile/final2.ini b/src/util/profile/final2.ini new file mode 100644 index 0000000000..4b1e15b799 --- /dev/null +++ b/src/util/profile/final2.ini @@ -0,0 +1,7 @@ +# In this variant the relation is marked final. There is parsing +# support for this but no iteration or dumping support, so the marker +# currently has no effect. +[section] + subsection = { + key* = value2 + } diff --git a/src/util/profile/final3.ini b/src/util/profile/final3.ini new file mode 100644 index 0000000000..dcf0ca96a8 --- /dev/null +++ b/src/util/profile/final3.ini @@ -0,0 +1,6 @@ +# In this variant the subsection is marked final via a '*' at the end +# of the tag name. +[section] + subsection* = { + key = value3 + } diff --git a/src/util/profile/final4.ini b/src/util/profile/final4.ini new file mode 100644 index 0000000000..dcba078459 --- /dev/null +++ b/src/util/profile/final4.ini @@ -0,0 +1,6 @@ +# In this variant the subsection is marked final via a '*' after the +# closing brace. +[section] + subsection = { + key = value4 + }* diff --git a/src/util/profile/final5.ini b/src/util/profile/final5.ini new file mode 100644 index 0000000000..58cd57d3fc --- /dev/null +++ b/src/util/profile/final5.ini @@ -0,0 +1,5 @@ +# In this variant the top-level section is marked final. +[section]* + subsection = { + key = value5 + }