Pass path information to test scripts by a sh script instead of make targets

It is for supporting testing on CMake build.