summaryrefslogtreecommitdiff
path: root/contrib/ci/jobs/2-test/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ci/jobs/2-test/test.sh')
-rwxr-xr-xcontrib/ci/jobs/2-test/test.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/ci/jobs/2-test/test.sh b/contrib/ci/jobs/2-test/test.sh
new file mode 100755
index 000000000..39fca5c16
--- /dev/null
+++ b/contrib/ci/jobs/2-test/test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -evu
+
+./bootstrap
+./configure CFLAGS="-ggdb -O0" \
+ --enable-logging=verbose \
+ --disable-doc
+make
+make install
+
+sudo -u postgres /usr/lib/postgresql/15/bin/postgres -D /etc/postgresql/15/main -h localhost -p 5432 &
+sleep 10
+sudo -u postgres createuser -p 5432 root
+sudo -u postgres createdb -p 5432 -O root talercheck
+
+check_command()
+{
+ # Set LD_LIBRARY_PATH so tests can find the installed libs
+ LD_LIBRARY_PATH=/usr/local/lib PGPORT=5432 make check
+}
+
+print_logs()
+{
+ for i in src/*/test-suite.log
+ do
+ for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2)
+ do
+ echo "Printing ${FAILURE}.log"
+ tail "$(dirname $i)/${FAILURE}.log"
+ done
+ done
+}
+
+if ! check_command ; then
+ print_logs
+ exit 1
+fi