Skip to content

Commit

Permalink
Add some more document checking to the end of make
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
  • Loading branch information
jjhursey committed Nov 3, 2020
1 parent b436c5c commit 440e31b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
16 changes: 11 additions & 5 deletions Makefile
Expand Up @@ -72,19 +72,25 @@ pmix-standard.pdf: $(CHAPTERS) $(SOURCES) pmix.sty pmix-standard.tex figs/pmix-l

FORCECHECK:

check: check-attr-ref check-openpmix check-decl
check: check-doc check-openpmix

# Includes
# - make check-decl
# - make check-attr-ref
check-doc: pmix-standard.pdf FORCECHECK
@./bin/check-doc.sh

check-attr-ref: pmix-standard.pdf FORCECHECK
@echo "====> Checking for Attributes Declared, but not referenced"
@./bin/check-attr-refs.py

check-openpmix: pmix-standard.pdf FORCECHECK
@echo "====> Checking cross-reference with OpenPMIx"
@./bin/check-openpmix.py

check-decl: pmix-standard.pdf FORCECHECK
@echo "====> Checking for Multi-declared items"
@./bin/check-multi-declare.py

check-openpmix: pmix-standard.pdf FORCECHECK
@echo "====> Checking cross-reference with OpenPMIx"
@./bin/check-openpmix.py

clean:
rm -f $(INTERMEDIATE_FILES) pmix-standard-*.pdf
27 changes: 26 additions & 1 deletion bin/check-doc.sh
Expand Up @@ -18,7 +18,7 @@ else
fi

#
# Check for Acronym used but not defined
# Check for missing cross references
#
echo "====> Checking Cross References"
grep "Warning: Reference" pmix-standard.log | grep "undefined"
Expand All @@ -41,6 +41,31 @@ else
echo "====> Passed"
fi

#
# Check for multiple declarations
#
echo "====> Checking Multiple Declarations"
./bin/check-multi-declare.py 2>/dev/null 1>/dev/null
if [ $? == 0 ] ; then
echo "====> Passed"
else
./bin/check-multi-declare.py
echo "====> Error check references (above)"
FINAL_STATUS=$((FINAL_STATUS+1))
fi

#
# Check for attribute references
#
echo "====> Checking Attributes are both declared and referenced"
./bin/check-attr-refs.py 2>/dev/null 1>/dev/null
if [ $? == 0 ] ; then
echo "====> Passed"
else
./bin/check-attr-refs.py
echo "====> Error check references (above)"
FINAL_STATUS=$((FINAL_STATUS+1))
fi

#
# All done
Expand Down
8 changes: 4 additions & 4 deletions bin/check-multi-declare.py
Expand Up @@ -34,9 +34,9 @@
all_ref_strs = ["attr", "const", "struct", "macro", "apifn"]
for ref_str in all_ref_strs:
if args.verbose is True:
print "-"*50
print "Extracting Standard: \""+ref_str+"\""
print "-"*50
print("-"*50)
print("Extracting Standard: \""+ref_str+"\"")
print("-"*50)

# subsection.A is Appendix A: Python Bindings
p = subprocess.Popen("grep \"newlabel{"+ref_str+"\" pmix-standard.aux | grep -v subsection.A",
Expand Down Expand Up @@ -133,8 +133,8 @@
print("Error: " + val + " declared " + str(std_apis[val]) + " times")
return_count += 1

print("-"*50)
if return_count > 0:
print("-"*50)
print("Found %d number of multiple declares" % (return_count))
else:
print("Success. No multiple declares detected!")
Expand Down

0 comments on commit 440e31b

Please sign in to comment.