tests: tests.sh detects directories before trying to execute them