Statistics
| Branch: | Tag: | Revision:

root / htools @ a292b4e0

Name Size
  Ganeti
OLD-NEWS 19 kB
README 4.5 kB
haddock-prologue 360 Bytes
htools.hs 1.8 kB
lint-hints.hs 269 Bytes
live-test.sh 5 kB
test.hs 5.1 kB

Latest revisions

# Date Author Comment
a292b4e0 01/16/2012 02:49 pm Iustin Pop

Add unit-tests for --help/--version as common options

After reorganizing the way we process options, we can finally add a
test that all program personalities accept --help and --version and
that they exit early for these two.

This trivial patch has a higher than expected impact on the coverage,...

9f13be88 01/16/2012 02:49 pm Iustin Pop

Split the list of program personalities into a module

… a mini-module, actually. This is only done for unit-testing, as we
don't want to duplicate the personalities list in the tests.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

21839f47 01/16/2012 02:49 pm Iustin Pop

Parse options in htools.hs, not in each program

This patch moves the call to getArgs/parseOpts into htools.hs, as
opposed to the current situation where htools.hs only calls the main
file of each program, which in turn calls these two functions.

By doing it only once we remove some duplicate code and we also export...

89298c04 01/16/2012 02:49 pm Iustin Pop

Add some very basic options test

Just tests that passing a string argument returns it correctly. We're
not interested in the flags themselves that much just that the
function itself parses some options at least correctly.

Signed-off-by: Iustin Pop <>...

51c3d88f 01/16/2012 02:49 pm Iustin Pop

Split CLI.parseOpts into IO/non-IO parts

This will allow unittesting the CLI options much more easily. The
patch also fixes an inconsistency: usage help was displayed with an
extra new line in the error case (but not in --help).

Signed-off-by: Iustin Pop <>...

a7ea861a 01/16/2012 02:49 pm Iustin Pop

Add test for CLI.parseYesNo

Also fix a tiny typo in the docstring.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

8b5a517a 01/16/2012 02:49 pm Iustin Pop

Fix bug in CLI.parseISpecString and add test

'zip' finishes on the shortest list, so parseISpecString accepted any
string of 3 values or more, which is not good. Fix this and add test
for both successful and failed parsing.

Signed-off-by: Iustin Pop <>...

e1dde6ad 01/16/2012 02:49 pm Iustin Pop

Add a unittest for the 'Simu' backend

This only test successful parsing, but for this case it tests
reasonably well the resulting cluster properties, I think (coverage
is >70% for expressions).

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

59ed268d 01/16/2012 02:49 pm Iustin Pop

Further optimise instance test data generation

Following on the lessons from this week (commit 7806125e), this patch
replaces generation of instances `suchThat` they are smaller than on
node with direct generation of instances with upper bounds on
memory/disk/cpu....

7806125e 01/13/2012 04:58 pm Iustin Pop

Fix very slow unit-test data generation in some cases

Learning, learning. It turns out that for objects with even just five
fields, generating them and filtering can be costly, especially when
the filtering is nested (as it was in this case, arbitrary1 →...

View revisions

Also available in: Atom