#!/bin/sh

export COMPILER_ROOT=../../..

. $COMPILER_ROOT/scripts/test-utils.sh

fpp_filenames=$COMPILER_ROOT/bin/fpp-filenames

update()
{
  args=$1
  infile=$2
  if test -n "$3"
  then
    outfile=$3
  else
    outfile=$infile
  fi
  echo "updating $outfile.ref.txt"
  $fpp_filenames $args $infile.fpp 2>&1 | remove_path_prefix > $outfile.ref.txt
}

for file in `find . -name '*.ref.txt'`
do
  rm $file
done

update "" include
update "" ok
