#!/bin/bash

set -e

outdir=${ADT_ARTIFACTS:-/tmp}/ocaml-dune-tests
echo "* Using $outdir"
mkdir -p ${outdir}
cp -a . ${outdir}
cd ${outdir}

# Many tests depend on the "spawn" library which is not packaged in
# Debian at the moment; remove them for now.
rm -rf test/expect-tests
rm -rf test/blackbox-tests/test-cases
rm -rf otherlibs/stdune/test
rm -rf otherlibs/chrome-trace/test
rm -rf src/fiber/test

echo "* Run tests"
dune runtest 2>&1
