fixed some tests to respect RUN_TESTS (this allows compilation and linking of
test binaries without running them, handy for cross-compilation)