]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani-tests.mdc
oceani: mark code that doesn't need testing.
[ocean] / csrc / oceani-tests.mdc
index bba5156a16b05f1c084afbc7404b975ffacc73ca..9850f2563d611b17cf4856bbe052385c44d5f452 100644 (file)
@@ -50,9 +50,13 @@ arguments separated from the name by commas.  For each test, there is a section
                    if ! cmp -s .tmp.want .tmp.have; then \
                       echo "FAILED"; diff -u .tmp.want .tmp.have ; exit 1; fi ;\
                    echo -n "passed ... "; \
-                   if ! valgrind ./oceani --section "test: $$t" oceani-tests.mdc $${1+"$$@"} \
-                        > /dev/null 2> .tmp.valg; then \
+                   if ! valgrind --error-exitcode=1 --log-file=.tmp.valg ./oceani --section "test: $$t" oceani-tests.mdc $${1+"$$@"} \
+                        > /dev/null 2>&1 ; then \
                       echo "valgrind FAILED"; cat .tmp.valg; exit 1; fi ; \
+                   if grep 'LEAK SUMMARY' .tmp.valg > /dev/null; then \
+                      echo "valgrind found LEAKS"; cat .tmp.valg ; exit 1 ; fi; \
+                   if grep 'in use at exit [1-9]' .tmp.valg > /dev/null; then \
+                      echo "valgrind found memory in use at exit"; cat .tmp.valg ; exit 1 ; fi; \
                    echo -n "valgrind passed ... "; \
                    echo '``````' > .tmp.code1; echo '``````' > .tmp.code2 ;\
                    ./oceani --noexec --print --section "test: $$t" oceani-tests.mdc >> .tmp.code1; \
@@ -68,9 +72,9 @@ arguments separated from the name by commas.  For each test, there is a section
 
                @gcov -o coverage oceani.mdc > /dev/null 2> /dev/null
                @mv *.gcov coverage ; [ -f .gcov ] && mv .gcov coverage
-               @ awk '/^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
+               @ awk '/NOTEST/ { next } /^ *[1-9]/ {ran+=1} /^ *###/ {skip+=1} \
                    END {printf "coverage: %6.2f%%\n", ran * 100 / (ran + skip); \
-                        if (ran < (ran + skip) *0.90) exit(1) }' \
+                        if (ran < (ran + skip) *0.93) exit(1) }' \
                        coverage/oceani.mdc.gcov
                @rm -f .tmp*