fixed bug in calculating TEST_DIR for relative paths