#!/bin/bash
set -euo pipefail

here=$(dirname "${BASH_SOURCE[0]}")

set -x
"$here"/test-non-existent
"$here"/test-bad-create-table
"$here"/test-unsupported
"$here"/test-supported
"$here"/test-queries
"$here"/test-random

if [ -v COVERAGE ]; then
  # Do at most 10 seconds of failmalloc testing
  "$here"/test-failmalloc || true
  now=$(date +%s)
  in_10s=$((now+10))
  while [ $(date +%s) -lt $in_10s ]; do
    "$here"/test-failmalloc || true
  done
fi