| 12345678910111213141516171819202122232425262728293031323334353637383940414243 | #!/bin/bashif test -f "./unittest/build_and_test_default.sh" ; then  echo "Unit test (default settings) will run on a local Debian system."  rm -rf outputelse  echo "This script must be started from the civetweb root directory using ./unittest/build_and_test_default.sh"  exitfi# Exit with an error message when any command fails.set -etrap 'lastline=$thisline; thisline=$BASH_COMMAND' DEBUGtrap 'echo "ERROR: \"${lastline}\" command failed (error $?)"' EXIT# Create a test directory and add the CGI test executableif test -f "./output/" ; then  echo "Removing old \"output\" folder."  rm -rf outputfimkdir outputgcc unittest/cgi_test.c -o output/cgi_test.cgicd output# Perform build and test steps in "output" directory.echo "Starting unit test. Write protocol to \"unittest.log\" file."echo "Starting unit test" > unittest.loggit log -1 >> unittest.logcmake .. &>> unittest.logmake all &>> unittest.logmake test &>> unittest.logecho "Unit test completed. See \"unittest.log\" file."tail -10 unittest.log | grep " tests passed"cd ..# Exit with successtrap '' EXITexit 0
 |