# This shell script compile, run and verify Nit program files
# Set lang do default to avoid failed tests because of locale
-export LANG=C
-export LC_ALL=C
+export LANG=C.UTF-8
+export LC_ALL=C.UTF-8
export NIT_TESTING=true
# Use the pid as a collision prevention
export NIT_TESTING_ID=$$
fi
# Detect a working time command
-if env time --quiet -f%e true 2>/dev/null; then
- TIME="env time --quiet -f%e"
-elif env time -f%e true 2>/dev/null; then
- TIME="env time -f%e"
-elif env gtime -f%e true 2>/dev/null; then
- TIME="env gtime -f%e"
+if command time --quiet -f%e true 2>/dev/null; then
+ TIME="command time --quiet -f%e"
+elif command time -f%e true 2>/dev/null; then
+ TIME="command time -f%e"
+elif command gtime -f%e true 2>/dev/null; then
+ TIME="command gtime -f%e"
else
TIME=
fi
echo 0.0 > "$ff.time.out"
elif [ -n "$isinteractive" ]; then
cat > "$ff.bin" <<END
-exec $NITC --no-color --no-prompt $OPT $includes < $(printf '%q' "$i") "\$@"
+exec $NITC --no-color --no-prompt --source-name $(printf '%q' "$i") $OPT $includes < $(printf '%q' "$i") "\$@"
END
chmod +x "$ff.bin"
> "$ff.cmp.err"
if [ -f "$ff.write" ]; then
cat -- "$ff.write" >> "$ff.res"
elif [ -d "$ff.write" ]; then
- LANG=C /bin/ls -F "$ff.write" >> "$ff.res"
+ /bin/ls -F "$ff.write" >> "$ff.res"
fi
cp -- "$ff.res" "$ff.res2"
cat -- "$ff.cmp.err" "$ff.err" "$ff.res2" > "$ff.res"
if [ -f "$fff.write" ]; then
cat -- "$fff.write" >> "$fff.res"
elif [ -d "$fff.write" ]; then
- LANG=C /bin/ls -F -- "$fff.write" >> "$fff.res"
+ /bin/ls -F -- "$fff.write" >> "$fff.res"
fi
if [ -s "$fff.err" ]; then
cp -- "$fff.res" "$fff.res2"