tests: factor HOME=$(pwd) in test-lib.sh