diff --git a/.gitignore b/.gitignore index 207b7d3a4505f55ee29a2064fa41cb4971b75426..3885108a1c00d34e9d4944924df7cdaf2eadd934 100644 --- a/.gitignore +++ b/.gitignore @@ -102,11 +102,13 @@ /htools/htools /htools/hconfd +/htools/htools-hpc /htools/test /htools/*.prof* /htools/*.stat /htools/*.tix /.hpc/ +/*.tix /htools/Ganeti/HTools/Version.hs /htools/Ganeti/Constants.hs diff --git a/Makefile.am b/Makefile.am index 65ac038b9a0eb0093df81ed264317147afd7a23c..f57781970a7e7036d3f40fa092e32a1e9afddc4b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -354,7 +354,7 @@ docrst = \ HS_PROGS = htools/htools htools/hconfd HS_BIN_ROLES = hbal hscan hspace hinfo -HS_ALL_PROGS = $(HS_PROGS) htools/test +HS_ALL_PROGS = $(HS_PROGS) htools/test htools/htools-hpc HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS)) # we don't add -Werror by default HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools @@ -538,8 +538,11 @@ htools/test: HEXTRA_INT=-fhpc -Wwarn -fno-warn-missing-signatures \ -fno-warn-monomorphism-restriction -fno-warn-orphans \ -fno-warn-missing-methods -fno-warn-unused-imports +# we compile the htools-hpc binary with the program coverage +htools/htools-hpc: HEXTRA_INT=-fhpc + # test dependency -htools/offline-tests.sh: htools/htools +htools/offline-tests.sh: htools/htools-hpc # rules for building profiling-enabled versions of the haskell # programs: hs-prof does the full two-step build, whereas @@ -1217,10 +1220,10 @@ check-local: check-dirs $(BUILT_SOURCES) done .PHONY: hs-check -hs-check: htools/test htools/htools +hs-check: htools/test htools/htools-hpc @rm -f test.tix ./htools/test - HBINARY="./htools/htools" ./htools/offline-test.sh + HBINARY="./htools/htools-hpc" ./htools/offline-test.sh # E111: indentation is not a multiple of four # E261: at least two spaces before inline comment @@ -1385,11 +1388,12 @@ py-coverage: $(BUILT_SOURCES) $(python_tests) $(python_tests) .PHONY: hs-coverage -hs-coverage: $(haskell_tests) - cd htools && rm -f *.tix *.mix && ./test +hs-coverage: $(haskell_tests) htools/htools-hpc + rm -f *.tix && $(MAKE) hs-check @mkdir_p@ $(COVERAGE_HS_DIR) - hpc markup --destdir=$(COVERAGE_HS_DIR) htools/test $(HPCEXCL) - hpc report htools/test $(HPCEXCL) + hpc combine $(HPCEXCL) test.tix htools-hpc.tix > htools-coverage.tix + hpc markup --destdir=$(COVERAGE_HS_DIR) htools-coverage.tix + hpc report htools-coverage.tix $(LN_S) -f hpc_index.html $(COVERAGE_HS_DIR)/index.html # Special "kind-of-QA" target for htools, needs special setup (all diff --git a/autotools/run-in-tempdir b/autotools/run-in-tempdir index e4f9df261a52c3fb3de432ca8f5cb5f938791a57..b9be3907715b81ff6ae00587e87d6076faa15568 100755 --- a/autotools/run-in-tempdir +++ b/autotools/run-in-tempdir @@ -12,7 +12,7 @@ cp -r autotools daemons scripts lib tools test $tmpdir mv $tmpdir/lib $tmpdir/ganeti ln -T -s $tmpdir/ganeti $tmpdir/lib mkdir -p $tmpdir/htools -for htest in htools test offline-test.sh cli-tests-defs.sh; do +for htest in htools htools-hpc test offline-test.sh cli-tests-defs.sh; do if [ -e htools/$htest ]; then cp -p htools/$htest $tmpdir/htools/ fi diff --git a/htools/cli-tests-defs.sh b/htools/cli-tests-defs.sh index da24b0c1f907a6f10954af8fc2b8fc2620ac5029..89821f8a154e45343a459fb7e598e5a59aace502 100644 --- a/htools/cli-tests-defs.sh +++ b/htools/cli-tests-defs.sh @@ -19,7 +19,7 @@ # This is an shell testing configuration fragment. -HBINARY=${HBINARY:-./htools/htools} +HBINARY=${HBINARY:-./htools/htools-hpc} hbal() { HTOOLS=hbal $HBINARY "$@" diff --git a/htools/htools-hpc.hs b/htools/htools-hpc.hs new file mode 120000 index 0000000000000000000000000000000000000000..487efdc275e4814232f5a3bfe0ea41ff8bd6b23d --- /dev/null +++ b/htools/htools-hpc.hs @@ -0,0 +1 @@ +htools.hs \ No newline at end of file