From: <tj...@us...> - 2010-08-25 11:07:43
|
Revision: 13630 http://alleg.svn.sourceforge.net/alleg/?rev=13630&view=rev Author: tjaden Date: 2010-08-25 11:07:36 +0000 (Wed, 25 Aug 2010) Log Message: ----------- Add run_tests target to run all tests. Modified Paths: -------------- allegro/branches/4.9/tests/CMakeLists.txt allegro/branches/4.9/tests/test_driver.c allegro/branches/4.9/tests/test_driver.txt Modified: allegro/branches/4.9/tests/CMakeLists.txt =================================================================== --- allegro/branches/4.9/tests/CMakeLists.txt 2010-08-25 11:07:06 UTC (rev 13629) +++ allegro/branches/4.9/tests/CMakeLists.txt 2010-08-25 11:07:36 UTC (rev 13630) @@ -30,34 +30,15 @@ ${PRIMITIVES_LINK_WITH} ) -add_custom_target(test_bitmaps +add_custom_target(run_tests DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_bitmaps.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_bitmaps.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_locking.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_locking2.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_backbuffer.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_image.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_fonts.ini + COMMAND test_driver -x ${CMAKE_CURRENT_SOURCE_DIR}/test_prim.ini ) -add_custom_target(test_locking - DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_locking.ini - ) - -add_custom_target(test_locking2 - DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_locking2.ini - ) - -add_custom_target(test_image - DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_image.ini - ) - -add_custom_target(test_fonts - DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_fonts.ini - ) - -add_custom_target(test_prim - DEPENDS test_driver - COMMAND test_driver ${CMAKE_CURRENT_SOURCE_DIR}/test_prim.ini - ) - # vim: set sts=4 sw=4 et: Modified: allegro/branches/4.9/tests/test_driver.c =================================================================== --- allegro/branches/4.9/tests/test_driver.c 2010-08-25 11:07:06 UTC (rev 13629) +++ allegro/branches/4.9/tests/test_driver.c 2010-08-25 11:07:36 UTC (rev 13630) @@ -52,6 +52,7 @@ bool save_outputs = false; bool quiet = false; bool verbose = false; +bool no_exit_code = false; int total_tests = 0; int passed_tests = 0; int failed_tests = 0; @@ -1126,6 +1127,9 @@ else if (streq(opt, "-v") || streq(opt, "--verbose")) { verbose = true; } + else if (streq(opt, "-x") || streq(opt, "--no-exit-code")) { + no_exit_code = true; + } else { break; } @@ -1164,7 +1168,10 @@ printf("passed tests: %d\n", passed_tests); printf("failed tests: %d\n", failed_tests); - return !!failed_tests; + if (no_exit_code) + return 0; + else + return !!failed_tests; } /* vim: set sts=3 sw=3 et: */ Modified: allegro/branches/4.9/tests/test_driver.txt =================================================================== --- allegro/branches/4.9/tests/test_driver.txt 2010-08-25 11:07:06 UTC (rev 13629) +++ allegro/branches/4.9/tests/test_driver.txt 2010-08-25 11:07:36 UTC (rev 13630) @@ -17,6 +17,9 @@ -v, --verbose print extra output + -x, --no-exit-code + return exit code 0 regardless of failures + If the list of tests is omitted then every test in the config file will be run. Otherwise each test named on the command line is run. For convenience, you may drop the "test " prefix on test names. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |