Commit 3096524e authored by Iustin Pop's avatar Iustin Pop

Build test helpers that point to hpc-htools

Instead of using just shell constructs to run hpc-htools correctly
(i.e. HTOOLS=role htools/hpc-htools …), let's add some shell fragments
that do this for us.

This will ease the running of tests directly.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent f183de56
......@@ -156,6 +156,7 @@ CLEANFILES = \
stamp-srclinks \
$(nodist_pkgpython_PYTHON) \
$(HS_ALL_PROGS) $(HS_BUILT_SRCS) \
$(HS_BUILT_TEST_HELPERS) \
.hpc/*.mix htools/*.tix \
doc/hs-lint.html
......@@ -358,6 +359,8 @@ HS_BIN_ROLES = hbal hscan hspace hinfo
HS_ALL_PROGS = $(HS_PROGS) htools/test htools/hpc-htools
HS_PROG_SRCS = $(patsubst %,%.hs,$(HS_ALL_PROGS))
HS_BUILT_TEST_HELPERS = $(HS_BIN_ROLES:%=test/%) test/hail
# we don't add -Werror by default
HFLAGS = -O -Wall -fwarn-monomorphism-restriction -fwarn-tabs -ihtools
# extra flags that can be overriden on the command line
......@@ -840,7 +843,7 @@ check_SCRIPTS =
if WANT_HTOOLSTESTS
nodist_TESTS += $(haskell_tests)
dist_TESTS += htools/offline-test.sh
check_SCRIPTS += htools/hpc-htools
check_SCRIPTS += htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
endif
TESTS = $(dist_TESTS) $(nodist_TESTS)
......@@ -1150,6 +1153,7 @@ daemons/ganeti-%: MODULE = ganeti.server.$(patsubst ganeti-%,%,$(notdir $@))
daemons/ganeti-watcher: MODULE = ganeti.watcher
scripts/%: MODULE = ganeti.client.$(subst -,_,$(notdir $@))
tools/ensure-dirs: MODULE = ganeti.tools.ensure_dirs
$(HS_BUILT_TEST_HELPERS): TESTROLE = $(patsubst test/%,%,$@)
$(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
test -n "$(MODULE)" || { echo Missing module; exit 1; }
......@@ -1178,6 +1182,17 @@ $(PYTHON_BOOTSTRAP): Makefile | $(all_dirfiles)
} > $@
chmod u+x $@
$(HS_BUILT_TEST_HELPERS): Makefile
@test -n "$(TESTROLE)" || { echo Missing TESTROLE; exit 1; }
set -e; \
{ echo '#!/bin/sh'; \
echo '# This file is automatically generated, do not edit!'; \
echo "# Edit Makefile.am instead."; \
echo; \
echo "HTOOLS=$(TESTROLE) exec ./htools/hpc-htools \"\$$@\""; \
} > $@
chmod u+x $@
# We need to create symlinks because "make distcheck" will not install Python
# files when building.
stamp-srclinks: Makefile | $(all_dirfiles)
......@@ -1237,7 +1252,7 @@ check-local: check-dirs $(BUILT_SOURCES)
done
.PHONY: hs-check
hs-check: htools/test htools/hpc-htools
hs-check: htools/test htools/hpc-htools $(HS_BUILT_TEST_HELPERS)
@rm -f test.tix
./htools/test
HBINARY="./htools/hpc-htools" ./htools/offline-test.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment