donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

test.sh (813B)


      1 #!/bin/bash
      2 set -evu
      3 
      4 apt-get update
      5 apt-get upgrade -yqq
      6 
      7 ./bootstrap
      8 ./configure CFLAGS="-ggdb -O0" \
      9       --prefix=/usr/local \
     10       --libdir=lib \
     11 	    --enable-logging=verbose \
     12 	    --disable-doc
     13 make
     14 make install
     15 
     16 PG_BIN="$(pg_config --bindir)"
     17 PG_ETC="$(pg_config --sharedir | sed 's|/usr/share/postgresql|/etc/postgresql|')"
     18 sudo -u postgres "${PG_BIN}/postgres" -D ${PG_ETC}/main -h localhost -p 5432 &
     19 
     20 sleep 10
     21 sudo -u postgres createuser -p 5432 root
     22 sudo -u postgres createdb -p 5432 -O root donaucheck
     23 
     24 check_command()
     25 {
     26 	# Set LD_LIBRARY_PATH so tests can find the installed libs
     27 	LD_LIBRARY_PATH=/usr/local/lib PGPORT=5432 make check
     28 }
     29 
     30 print_logs()
     31 {
     32     set +e
     33 	log=build/meson-logs/testlog.txt
     34 		echo "Printing ${log}"
     35         cat "$log"
     36 }
     37 
     38 
     39 if ! check_command ; then
     40 	print_logs
     41 	exit 1
     42 fi