Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2e7155ccea
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (27 sloc) 0.576 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/bin/bash

 e=test."$( date +'%Y%m%dT%H%M%S' )".out
ok=y

for x in examples/*.fnjs; do
  b="$( basename "$x" .fnjs )"

  [[ "$b" == *NORUN* ]] && continue

  echo "running $x ..." >&2
  ./bin/fnjs "$x" | ./_scripts/run-js > output/"$b.$e"

  for x in "${PIPESTATUS[@]}"; do
    if [ "$x" -ne 0 ]; then
      echo ERROR
      exit 1
    fi
  done

  if [ "$1" == -q ]; then
    if diff -q output/"$b".{good.out,"$e"}; then
      echo OK
    else
      ok=n
      echo DIFFERS
    fi
  else
    diff -Naur output/"$b".{good.out,"$e"}
  fi
done

[ "$ok" == y ] || exit 1

# --
Something went wrong with that request. Please try again.