Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions libs/wire-api/test/golden/gentests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
set -e
set -o pipefail

export GOLDEN_TMPDIR=$(mktemp -d)
GOLDEN_TMPDIR=$(mktemp -d)
export GOLDEN_TMPDIR
export GOLDEN_TESTDIR="test/unit/Test/Wire/API/Golden/Generated"

# trap cleanup EXIT
Expand Down Expand Up @@ -149,7 +150,7 @@ mkdir -p "$GOLDEN_TESTDIR"
mkdir -p "$GOLDEN_TMPDIR/dump"

stack build --fast --test --bench --no-run-benchmarks wire-api |
while read module section; do
while read -r module section; do
echo -ne "\033[KProcessing module $module...\r"
{
echo "{-# OPTIONS_GHC -Wno-unused-imports #-}"
Expand Down Expand Up @@ -194,10 +195,10 @@ for module in "$GOLDEN_TESTDIR"/*; do
-e '/^import/d' \
-e "/^module/ r $dump" \
"$module"
ormolu -m inplace -c ${EXTS[@]/#/'-o '} "$module"
ormolu -m inplace -c "${EXTS[@]/#/'-o '}" "$module"
done

ormolu -m inplace -c ${EXTS[@]/#/'-o '} "$GOLDEN_TESTDIR.hs"
ormolu -m inplace -c "${EXTS[@]/#/'-o '}" "$GOLDEN_TESTDIR.hs"
( cd ../.. && headroom run -a -s libs/wire-api/test/unit/Test/Wire/API/Golden/ )

# build one final time
Expand Down