This script below lets you test changes while continuing to work on code. Let’s say that your test suite takes quite a while to run (hello, libguestfs). You can do:
$ test-change make check
The script copies the whole current directory into a temporary directory and runs the check in there. You still have to open a new terminal to run the tests, but the tests can go ahead while you continue working.
#!/bin/bash - # Copy current directory to a temporary, # then run the test command on that copy, # and report the results. # by Richard W.M. Jones <firstname.lastname@example.org> # # Usage (from current directory): # test-change command [args ...] # eg: # test-change make check echo "Copying original directory; wait a moment ..." d=`mktemp -d` trap "rm -rf $d" EXIT INT TERM QUIT cp -a . $d cd $d echo "Original directory copied, starting test." echo "You can carry on working now." sleep 1 # Run the test command. "$@"