@@ -149,10 +149,10 @@ EOM
149149 exit 0
150150fi
151151
152- if test " $NODE " = " " ; then
152+ if test " $JS_RUNTIME " = " " ; then
153153 for candidate in bun nodejs node /usr/local/bin/bun /usr/local/bin/nodejs /usr/local/bin/node; do
154154 if command -v $candidate > /dev/null; then
155- NODE =$candidate
155+ JS_RUNTIME =$candidate
156156 break
157157 fi
158158 done
@@ -162,11 +162,11 @@ if [ "x$BROWSER_TESTS" != "x" ]; then
162162 echo ' Compiling the test suite for web browsers...' &&
163163 emmake make $MAKE_FLAGS CPPFLAGS=" $CPPFLAGS -DBROWSER_TESTS=1" check > /dev/null 2>&1
164164else
165- if test " $NODE " = " " ; then
165+ if test " $JS_RUNTIME " = " " ; then
166166 echo ' Javascript runtime not found - test suite skipped' >&2
167167 exit 1
168168 fi
169- echo " Using [${NODE } ] as a Javascript runtime"
169+ echo " Using [${JS_RUNTIME } ] as a Javascript runtime"
170170 echo ' Compiling the test suite...' &&
171171 emmake make $MAKE_FLAGS check > /dev/null 2>&1
172172fi
@@ -178,7 +178,7 @@ if [ "x$BROWSER_TESTS" != "x" ]; then
178178 mkdir -p browser &&
179179 rm -f browser/tests.txt &&
180180 for file in * .js; do
181- grep -Fv " #! /usr/bin/env ${NODE} " " $ file" > " browser/${file} "
181+ cp " $ file" " browser/${file} "
182182 tname=$( echo " $file " | sed ' s/.js$//' )
183183 cp -f " ${tname} .exp" " browser/${tname} .exp"
184184 sed " s/{{tname}}/${tname} /" index.html.tpl > " browser/${tname} .html"
191191 (
192192 cd test/default &&
193193 for file in * .js; do
194- echo " #! /usr/bin/env ${NODE } " > " ${file} .tmp"
195- grep -Fv " #! /usr/bin/env ${NODE} " " $ file" >> " ${file} .tmp"
194+ echo " #! /usr/bin/env ${JS_RUNTIME } " > " ${file} .tmp"
195+ cat " $ file" >> " ${file} .tmp"
196196 chmod +x " ${file} .tmp"
197197 mv -f " ${file} .tmp" " $file "
198198 done
0 commit comments