Adapt filecheck.py and CMakeLists.txt for ctest

Added a return code(num_of_failed_tests) to filecheck.py so ctest knows
if the test was successfully or not.
Changed runvalidator.py because of downward compatibility. The including
function a_string.endswith() does not accept tupels before Python 2.5.