#!/bin/bash

# note that the debug build must be used with the -t option to get the beams right in the .mscx files

MSCORE=../../../build.debug/mscore/mscore
capfiles=`cat tst_capella_io.cpp | grep "{ capReadTest" | awk -F\" '{print $2}' | sort`
capxfiles=`cat tst_capella_io.cpp | grep "{ capxReadTest" | awk -F\" '{print $2}' | sort`

echo "updating Capella files ..."
for f in $capfiles; do
      echo "${f}.cap -> ${f}.cap-ref.mscx"
      $MSCORE -t ${f}.cap -o ${f}.cap-ref.mscx &> /dev/null
done

echo "updating CapellaXML files ..."
for f in $capxfiles; do
      echo "${f}.capx -> ${f}.capx-ref.mscx"
      $MSCORE -t ${f}.capx -o ${f}.capx-ref.mscx &> /dev/null
done
