test.sh (728B)
1 #!/bin/bash 2 set -evu 3 4 ./bootstrap 5 ./configure CFLAGS="-ggdb -O0" \ 6 --enable-logging=verbose \ 7 --disable-doc 8 make 9 make install 10 11 sudo -u postgres /usr/lib/postgresql/15/bin/postgres -D /etc/postgresql/15/main -h localhost -p 5432 & 12 sleep 10 13 sudo -u postgres createuser -p 5432 root 14 sudo -u postgres createdb -p 5432 -O root donaucheck 15 16 check_command() 17 { 18 # Set LD_LIBRARY_PATH so tests can find the installed libs 19 LD_LIBRARY_PATH=/usr/local/lib PGPORT=5432 make check 20 } 21 22 print_logs() 23 { 24 for i in src/*/test-suite.log 25 do 26 for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2) 27 do 28 echo "Printing ${FAILURE}.log" 29 tail "$(dirname $i)/${FAILURE}.log" 30 done 31 done 32 } 33 34 if ! check_command ; then 35 print_logs 36 exit 1 37 fi