Files
mgmt/test/shell/env0.sh
James Shubin 43839d1090 all: Switch the --lang syntax to use argv instead
It was a bit awkward using `mgmt run lang --lang <input>` so instead, we
now drop the --lang, and read the positional argv for the input.

This also does the same for the --yaml frontend.
2019-05-05 11:10:47 -04:00

30 lines
736 B
Bash
Executable File

#!/bin/bash -e
. "$(dirname "$0")/../util.sh"
set -o errexit
set -o pipefail
# these values represent environment variable values below or defaults set in test/shell/env0.mcl
regex="123,,:123,321,:true,false:123"
tmpdir="$($mktemp --tmpdir -d tmp.XXX)"
if [[ ! "$tmpdir" =~ "/tmp" ]]; then
echo "unexpected tmpdir in: ${tmpdir}"
exit 99
fi
env TMPDIR="${tmpdir}" TEST=123 EMPTY="" $TIMEOUT "$MGMT" run --tmp-prefix --converged-timeout=5 lang env0.mcl
e=$?
egrep "$regex" "$tmpdir/environ" || fail_test "Could not match '$(cat "$tmpdir/environ")' in '$tmpdir/environ' to '$regex'."
if [ "$tmpdir" = "" ]; then
echo "BUG, tried to delete empty string path"
exit 99
fi
# cleanup if everything went well
rm -r "$tmpdir"
exit $e