[CMake] Adding actions on test succes/failure

Theodore Papadopoulo Theodore.Papadopoulo at inria.fr
Tue Apr 3 01:48:26 EDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

	Hello,

is there a way to add actions depending on test/succes failure. I have
the following use case.

A first test generates a file.
Then this file is tested with various other tests.
Each read test verifies the output and then remove the files ir generated.

Now I would like to clean generated by the first test if all read
tests passed, so that the test directory at the end pf a full test
contains only the generated files that correspond to test failures
(there are hundreds of such group of tests). In this way, checking
what went wrong is much easier.

I know I can group the tests in one cmake script that will do the job,
but that:

1) that would mean passing a lot of parameters to this cmake script
(the parameters for all the individual tests).
2) thet severely destroys the modularity of tests and will make
analyzing a failure much more complicated.

Thus the question, is there a way to insert an action (eventually a
dummy test but ideally just a cleanup that would not appear as a test)
depending on the result of a group of test (eg in my case if all the
tests of that group succeeded then clean the files they generated).

Currently I do not see any way of doing this, but I may be missing sthg.

Thank's for any insight with this problem.

	Theo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk96jyIACgkQEr8WrU8nPV1Z0wCfbBEY1JM2b2SgxUTzflly056M
SsYAoIVnFTDXh5PomklhbCmjGH08gII8
=Ie4b
-----END PGP SIGNATURE-----


More information about the CMake mailing list