daml/daml-lf/tests/daml-lf-test.sh
moritzkiefer-da dff9f17ac6 Remove damli completely (#481)
The only command that we still had in damli which afaik isn’t
something anyone uses (and if it is, we should move it do damlc).
2019-04-15 14:47:59 +02:00

30 lines
529 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -eu
DAML_LF_REPL=$1
DAMLC=$2
MAIN=$3
TMPDIR=$(mktemp -d)
cleanup() {
rm -rf "$TMPDIR"
}
trap cleanup EXIT
case "${MAIN##*.}" in
dalf)
$DAML_LF_REPL testAll "$MAIN"
;;
daml)
$DAMLC export-lf-v1 "$MAIN" -o $TMPDIR/out.dalf
$DAML_LF_REPL testAll $TMPDIR/out.dalf
;;
*)
echo "Unknown file extension on $MAIN" 1>&2
exit 1
;;
esac