Revision 5f7d4181

b/Makefile.am
20 20
# Use bash in order to be able to use pipefail
21 21
SHELL=/bin/bash
22 22

  
23
# Enable colors in shelltest
24
SHELLTESTARGS = "-c"
25

  
23 26
ACLOCAL_AMFLAGS = -I autotools
24 27
BUILD_BASH_COMPLETION = $(top_srcdir)/autotools/build-bash-completion
25 28
RUN_IN_TEMPDIR = $(top_srcdir)/autotools/run-in-tempdir
......
1827 1830
	done; \
1828 1831
	test -z "$$error"
1829 1832

  
1833
.PHONY: hs-test-%
1834
hs-test-%: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1835
	@rm -f htest.tix
1836
	test/hs/htest -t $*
1837

  
1830 1838
.PHONY: hs-tests
1831 1839
hs-tests: test/hs/htest | $(BUILT_PYTHON_SOURCES)
1832 1840
	@rm -f htest.tix
1833 1841
	./test/hs/htest
1834 1842

  
1843
.PHONY: hs-shell-%
1844
hs-shell-%: test/hs/hpc-htools test/hs/hpc-mon-collector \
1845
            $(HS_BUILT_TEST_HELPERS)
1846
	@rm -f hpc-htools.tix hpc-mon-collector.tix
1847
	HBINARY="./test/hs/hpc-htools" \
1848
	SHELLTESTARGS=$(SHELLTESTARGS) \
1849
	./test/hs/offline-test.sh $*
1850

  
1835 1851
.PHONY: hs-shell
1836 1852
hs-shell: test/hs/hpc-htools test/hs/hpc-mon-collector $(HS_BUILT_TEST_HELPERS)
1837 1853
	@rm -f hpc-htools.tix hpc-mon-collector.tix
1838
	HBINARY="./test/hs/hpc-htools" ./test/hs/offline-test.sh
1854
	HBINARY="./test/hs/hpc-htools" \
1855
	SHELLTESTARGS=$(SHELLTESTARGS) \
1856
	./test/hs/offline-test.sh
1839 1857

  
1840 1858
.PHONY: hs-check
1841 1859
hs-check: hs-tests hs-shell
b/doc/devnotes.rst
24 24
- `pep8 <https://github.com/jcrocholl/pep8/>`_
25 25
- `PyYAML <http://pyyaml.org/>`_
26 26

  
27
For older developement (Ganeti < 2.4) ``docbook`` was used instead
27
For older developement (Ganeti < 2.4) ``docbook`` was used instead of
28 28
``pandoc``.
29 29

  
30 30
Note that for pylint, at the current moment the following versions
......
175 175
~~~~~~~~~~~~~~~~~~~~~~~~
176 176

  
177 177
When developing code, running the entire test suite can be
178
slow. Running individual tests is possible easily for unit-tests, less
179
so for shell-tests (but these are faster, so it shouldn't be needed).
178
slow. Running individual tests is possible. There are different
179
Makefile targets for running individual Python and Haskell tests.
180 180

  
181 181
For Python tests::
182 182

  
......
185 185

  
186 186
For Haskell tests::
187 187

  
188
  $ make test/hs/htest && ./test/hs/htest -t %pattern%
188
  $ make hs-test-%pattern%
189 189

  
190 190
Where ``pattern`` can be a simple test pattern (e.g. ``comma``,
191 191
matching any test whose name contains ``comma``), a test pattern
192 192
denoting a group (ending with a slash, e.g. ``Utils/``), or more
193
complex glob pattern. For more details, see the documentation (on the
194
`test-framework homepage
193
complex glob pattern. For more details, search for glob patterns in
194
the documentation of `test-framework
195 195
<http://batterseapower.github.com/test-framework/>`_).
196 196

  
197
For individual Haskell shelltests::
198

  
199
  $ make hs-shell-%name%
200

  
201
which runs the test ``test/hs/shelltests/htools-%name%.test``. For
202
example, to run the test ``test/hs/shelltests/htools-balancing.test``,
203
use::
204

  
205
  $ make hs-shell-balancing
206

  
207
For combined Haskell shelltests::
208

  
209
  $ make hs-shell-{%name1%,%name2%,...}
210

  
211
for example::
212

  
213
  $ make hs-shell-{balancing,basic}
214

  
197 215
Packaging notes
198 216
===============
199 217

  
b/test/hs/offline-test.sh
20 20
# This is an offline testing script for most/all of the htools
21 21
# programs, checking basic command line functionality.
22 22

  
23
# Optional argument that specifies the test files to run. If not
24
# specified, then all tests are run.
25
#
26
# For example, a value of 'balancing' runs the file
27
# 'shelltests/htools-balancing.test'.  Multiple files can be specified
28
# using shell notation, for example, '{balancing,basic}'.
29
TESTS=${1:-*}
30

  
23 31
set -e
24 32
set -o pipefail
25 33

  
......
97 105
echo Running shelltest...
98 106

  
99 107
shelltest $SHELLTESTARGS \
100
  ${TOP_SRCDIR:-.}/test/hs/shelltests/htools-*.test \
101
  -- --hide-successes
102

  
103
echo All OK
108
  ${TOP_SRCDIR:-.}/test/hs/shelltests/htools-$TESTS.test

Also available in: Unified diff