Commit Graph

6 Commits

Author SHA1 Message Date
Neil Roberts
bcd4385a0e test-conform: Delay initializing Clutter until a test is run
Instead of calling clutter_init immediately, test-conformance now only
calls it as part of test_conform_simple_fixture_setup. The conformance
tests assert that only one test is run per instance of
test-conformance so it should never end up calling clutter_init
twice. Delaying clutter_init has the advantage that calling
"test-conformance -l" will still work even on systems with no X
server. This could be useful for automated build systems.
2010-09-21 14:10:19 +01:00
Robert Bragg
551945ce6c tests: Force X synchronization so the stage size is reliable
Normally the asynchronous nature of X means that setting the clutter
stage size may really happen an indefinite amount of time later but
since the tests are so short lived and may only render a single frame
this is not an acceptable semantic.

This way we should be able to remove all the hacky sleeps and frame
count delays from our tests.
2010-07-07 14:07:22 +01:00
Robert Bragg
b24c96189d tests: no longer clean up state between tests
Since we now run every test in a separate process there is no need to
try and avoid state leakage between tests. This removes the code to
cleanup all children of the stage and disconnect handlers from the
stage paint signal. We now explicitly print a warning if the users tries
to run multiple tests in one process.
2010-07-07 14:07:17 +01:00
Neil Roberts
21117bb7a9 test-conform-common: Disconnect all paint handlers on the stage
A few of the tests connected to the paint signal but never
disconnected it. Most of these handlers had a call to g_main_quit in
them which meant that it could sometimes cause subsequent tests to
exit after the first frame is painted. Most of the tests don't
validate any of the results until after a couple of frames have been
rendered so this ended up skipping out the test entirely.

To workaround this the test setup function now disconnects all
handlers for the paint signal on the default stage before the test is
run.
2010-05-06 14:21:53 +01:00
Robert Bragg
acff6d8196 * tests/conform/ADDING_NEW_TESTS
* tests/conform/test-conform-common.c
	* tests/conform/test-pick.c:
	Instead of using clutter_stage_new /clutter_actor_destroy as a way to
	avoid cascading side effects between unit tests, due to left over
	actors, we now destroy all children of the default stage between
	tests instead.

	* tests/conform/wrapper.sh:
	Adds a convenience note about how to run valgrind for an individual
	unit test
2008-11-10 18:52:50 +00:00
Robert Bragg
603f936745 Bug 1162 - Re-works the tests/ to use the glib-2.16 unit testing
framework

	* configure.ac:
	* tests/*:
	The tests have been reorganised into different categories: conformance,
	interactive and micro benchmarks.
	- conformance tests can be run as part of automated tests
	- interactive tests are basically all the existing tests
	- micro benchmarks focus on a single performance metric

	I converted the timeline tests to conformance tests and also added some
	tests from Neil Roberts and Ebassi.

	Note: currently only the conformance tests use the glib test APIs,
	though the micro benchmarks should too.

	The other change is to make the unit tests link into monolithic binaries
	which makes the build time for unit tests considerably faster. To deal
	with the extra complexity this adds to debugging individual tests I
	have added some sugar to the makefiles so all the tests can be run
	directly via a symlink and when an individual test is run this way,
	then a note is printed to the terminal explaining exactly how that test
	may be debugged using GDB.

	There is a convenience make rule: 'make test-report', that will run all
	the conformance tests and hopefully even open the results in your web
	browser. It skips some of the slower timeline tests, but you can run
	those using 'make full-report'
2008-11-07 19:32:28 +00:00