dmd/test/compilable/testclidflags.sh
The Dlang Bot 7b17c9f673
Merge pull request #7937 from JinShil/dflags2
Add [Environment{arch}] DFLAGS to -v output
merged-on-behalf-of: Rainer Schuetze <rainers@users.noreply.github.com>
2018-03-02 22:25:08 +01:00

16 lines
591 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
dir=${RESULTS_DIR}${SEP}compilable
unset DFLAGS
# Force DMD to print the -v menu by passing an invalid object file
# It will fail with "no object files to link", but print the log
# On OSX DMD terminates with a successful exit code, so `|| true` is used.
( "$DMD" -conf= -v foo.d 2> /dev/null || true) | grep -q "DFLAGS (none)"
( DFLAGS="-O -D" "$DMD" -conf= -v foo.d 2> /dev/null || true) | grep -q "DFLAGS -O -D"
( DFLAGS="-O '-Ifoo bar' -c" "$DMD" -conf= -v foo.d 2> /dev/null || true) | grep -q "DFLAGS -O '-Ifoo bar' -c"
echo Success