Skip to content

Commit

Permalink
Add profile tests for final nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
greghudson committed Jul 23, 2019
1 parent 37ab7ea commit 63fe290
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/util/profile/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand All @@ -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 "+++"
Expand Down
12 changes: 12 additions & 0 deletions src/util/profile/final.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

value1
value1

value2
value1

value3

value4

value5
6 changes: 6 additions & 0 deletions src/util/profile/final1.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# A basic profile setting a single relation in a subsection, with
# nothing marked final.
[section]
subsection = {
key = value1
}
7 changes: 7 additions & 0 deletions src/util/profile/final2.ini
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 6 additions & 0 deletions src/util/profile/final3.ini
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 6 additions & 0 deletions src/util/profile/final4.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# In this variant the subsection is marked final via a '*' after the
# closing brace.
[section]
subsection = {
key = value4
}*
5 changes: 5 additions & 0 deletions src/util/profile/final5.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# In this variant the top-level section is marked final.
[section]*
subsection = {
key = value5
}

0 comments on commit 63fe290

Please sign in to comment.