Use mktemp -d rather than --directory to fix the test script on osx