rewrite of tests/run.sh