Getting to 100 % succedding tests (for 2.9), or, simply dropping them all?

Friedrich W. H. Kossebau kossebau at kde.org
Fri Feb 6 13:34:19 GMT 2015


Am Freitag, 6. Februar 2015, 08:08:53 schrieb Elvis Stansvik:
> But, re. running certain only certain sets of test, perhaps we could label
> tests using
> 
>    set_tests_properties(SomeTest SomeOtherTest PROPERTIES LABELS "stress")
>    set_tests_properties(FooTest BarTest PROPERTIES LABELS "integration")

Nice, did not know, that indeed might help us to get somewhere.

> and then pass -L / -LE to ctest using e.g.
> 
>   make test ARGS="-LE integration"

Oh, something new I could learn here, Makefile macro definition by arguments 
to make, interesting :)
Just, that "ARGS" cmake macro is not really defined somewhere, or? Found it in 
the generated Makefile for the "test" target. Possibly some legacy thing and 
only traded in secret circles :)

Played a little with that locally, and think this is worth to investigate more 
into.

Assuming the properties "stress", "integration" and "unit" are mutual 
exclusive, I guess having some convenience wrappers might make sense, e.g. 
having these dedicated macros

	calligra_add_unittest
	calligra_add_integrationtest
	calligra_add_stresstest

defined like e.g.

	macro(calligra_add_unittest _test_NAME)
		set(_targetName ${_test_NAME})
		if( ${ARGV1} STREQUAL "TESTNAME" )
			set(_targetName ${ARGV2})
		endif()
		kde4_add_unit_test(${_test_NAME} ${ARGN})
		set_tests_properties(${_targetName} PROPERTIES LABELS "UNITTEST")
	endmacro()

This should protect against typos and keep the code simple.

And invoking them might be doable by separate targets, e.g.

	add_custom_target(unittest
	                  COMMAND ctest --force-new-ctest-process -L \"UNITTEST\")

so on the command-line
	make unittest
will result in the test run, but just of all unittests.

Have just pinged also sysadmin by a ticket for their experience and proposals, 
how our requirements could be solved on CI side, i.e. everything built but 
only env-independent tests run there.

Cheers
Friedrich



More information about the calligra-devel mailing list