Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
McMule
handyG
Commits
ce0d82a3
Commit
ce0d82a3
authored
Aug 19, 2019
by
ulrich_y
Browse files
Added coverage testing to configure
parent
babbf4e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
.gitignore
.gitignore
+1
-0
configure
configure
+61
-1
No files found.
.gitignore
View file @
ce0d82a3
...
...
@@ -7,6 +7,7 @@ makefile
*.gcno
*.gcda
*.gcov
report/
checks/*.f90
checks/stats.txt
### Vim ###
...
...
configure
View file @
ce0d82a3
...
...
@@ -572,6 +572,26 @@ EOF
fi
if
$COVERAGE
;
then
findprog gcov GCOV gcov gcov-7 gcov-6 gcov-5 gcov-34
||
exit
1
if
!
findlib gcov LGCOV
;
then
echo
"can't perform coverage tests without libgcov. Please specify using
\$
LFLAGS"
1>&3
exit
1
fi
if
!
findprog lcov LCOV lcov
;
then
echo
"graphical coverage report won't be supported"
1>&3
HAVE_LCOV
=
false
else
if
!
findprog genhtml GENHTML genhtml
;
then
echo
"graphical coverage report won't be supported"
1>&3
HAVE_LCOV
=
false
else
HAVE_LCOV
=
true
fi
fi
fi
echo
"creating makefile"
1>&3
...
...
@@ -585,6 +605,9 @@ CXX=$CONF_CXX
LD=
$CONF_LD
MPREP=
$CONF_MPREP
MATH=
$CONF_MATH
GCOV=
$CONF_GCOV
LCOV=
$CONF_LCOV
GENHTML=
$CONF_GENHTML
FFLAGS=
$CONF_FFLAGS
CFLAGS=
$CONF_CFLAGS
...
...
@@ -717,15 +740,52 @@ cat >> makefile <<EOF
check: test
./
$<
EOF
if
$COVERAGE
;
then
cat
>>
makefile
<<
EOF
report/report.txt: test
mkdir -p report
./test -verb 1000 > /dev/null
echo "Report generated on
\`
date
\`
by `whoami`." >
\$
@
EOF
for
i
in
gpl_module ieps maths_functions mpl_module shuffle utils
test
do
echo
-e
"
\t\t\$
(GCOV) build/
$i
.gcno >>
\$
@"
>>
makefile
echo
-e
"
\t\t
mv
$i
.f90.gcov report/"
>>
makefile
done
$HAVE_LCOV
&&
cat
>>
makefile
<<
EOF
report/coverage.info: report/report.txt
\$
(LCOV) --capture --directory build/ --output-file
\$
@
report/lcov.report: report/coverage.info
\$
(LCOV) --list
\$
< >
\$
@
cat
\$
@
report/index.html: report/coverage.info
\$
(GENHTML)
\$
< --output-directory report
EOF
#cat \$@ | perl -nle "print \\\$\$1 if /Total:\\|(\\d+\\.?\\d+\\%)/"
echo
-n
"coverage: report/report.txt"
>>
makefile
$HAVE_LCOV
&&
echo
-n
" report/coverage.info report/lcov.report report/index.html"
>>
makefile
echo
>>
makefile
fi
cat
>>
makefile
<<
EOF
clean:
@rm -f build/*.gcda build/*.gcno build/*.gcov
@rm -rf report/
@rm -f build/*.o build/*.mod build/*.c build/mcc.internals*
@rm -f test geval libhandyg.a handy
g
@rm -f test geval libhandyg.a handy
G handyg.mod
@rm -f checks/test-chen.f90 checks/test-muone.f90 checks/test-muoneNP.f90
distclean:
@rm -f build/*.gcda build/*.gcno build/*.gcov
@rm -rf report/
@rm -f build/*.o build/*.mod build/*.c build/mcc.internals*
@rm -f test geval libhandyg.a handyg
@rm -f checks/test-chen.f90 checks/test-muone.f90 checks/test-muoneNP.f90
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment