@@ -131,21 +131,7 @@ get_bin_path() {
131131 local path=" "
132132 local candidate=" $name "
133133
134- if ! path=$( cabal list-bin " $candidate " 2> /dev/null) ; then
135- if [[ " $candidate " != test:* ]]; then
136- if path=$( cabal list-bin " test:${name} " 2> /dev/null) ; then
137- candidate=" test:${name} "
138- elif path=$( cabal list-bin " exe:${name} " 2> /dev/null) ; then
139- candidate=" exe:${name} "
140- else
141- path=" "
142- fi
143- else
144- path=" "
145- fi
146- fi
147-
148- path=$( printf ' %s\n' " $path " | head -n1)
134+ path=$( cabal list-bin " $candidate " --verbose=0 2> /dev/null)
149135
150136 if [[ -z " $path " ]]; then
151137 echo " [loop][error] Unable to locate binary for '${name} ' via 'cabal list-bin'." >&2
@@ -154,7 +140,7 @@ get_bin_path() {
154140 fi
155141
156142 BIN_NAMES+=(" $name " ); BIN_PATHS+=(" $path " )
157- # echo "$path" >&2
143+ echo " $path "
158144}
159145
160146while true ; do
@@ -176,14 +162,16 @@ while true; do
176162 echo " [loop] Iteration ${iter} (${ts} ) pattern='${pattern} ' -> ${log} " | tee -a " ${log} " >&2
177163 fi
178164
165+ testBinPath=$( get_bin_path " ${bin_name} " )
166+ # echo "[loop] Using binary path: ${testBinPath}"
179167 # We don't fail the loop on non-zero exit (capture output then decide).
180168 set +e
181169 # HLS_TEST_HARNESS_NO_TESTDIR_CLEANUP=1 \
182170 HLS_TEST_LOG_STDERR=" ${LOG_STDERR} " \
183171 HLS_TEST_HARNESS_STDERR=" ${LOG_STDERR} " \
184172 TASTY_NUM_THREADS=1 \
185173 TASTY_PATTERN=" ${pattern} " \
186- " $( get_bin_path " ${bin_name} " ) " +RTS -l -olhlint.eventlog -RTS > " ${log} " 2>&1
174+ $testBinPath +RTS -l -olhlint.eventlog -RTS > " ${log} " 2>&1
187175 set -e
188176
189177 if grep -aFiq -- " ${BROKEN_PIPE_RE} " " ${log} " ; then
0 commit comments