Commit 1b8e6a0e authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Allow to launch test locally.

parent b3e8acec
#test
module="blc_core"
log="/tmp/${module}_test.log"
cd `dirname $0`
project=`basename $PWD`
echo "=== Testing ${module} ==="
log="/tmp/${project}_test.log"
echo
echo "Testing blc_core"
echo "================"
echo
echo "log in $log"
echo "$module" > $log #We erase previous logs
echo "$project" > $log #We erase previous logs
test="t_array"
./compile.sh $module/$test >> $log 2>&1 || { echo "ERROR: Fail compiling $test"; exit 1; } # 2>&1 : stderr is redirected like stdout
bin/$test >> $log 2>&1 || { echo "ERROR: Fail executing bin/$test"; exit 2; } # 2>&1 : stderr is redirected like stdout
( cd $module && git diff --exit-code $test/array.tsv >> $log 2>&1) || { echo "ERROR: The result of t_array/array.tsv is not the one expected"; exit 3; }
( cd $module && git diff --exit-code $test/array.blc >> $log 2>&1) || { echo "ERROR: The result of t_array/array.blc is not the one expected"; exit 3; }
echo "t_array succesfuly compiled, executed with the right output."
../compile.sh $test >> $log 2>&1 || { echo "ERROR: Fail compiling $test"; exit 1; } # 2>&1 : stderr is redirected like stdout
( cd .. && bin/$test >> $log 2>&1 ) || { echo "ERROR: Fail executing bin/$test"; exit 2; } # 2>&1 : stderr is redirected like stdout
git diff --exit-code $test/array.tsv >> $log 2>&1 || { echo "ERROR: The result of t_array/array.tsv is not the one expected"; exit 3; }
git diff --exit-code $test/array.blc >> $log 2>&1 || { echo "ERROR: The result of t_array/array.blc is not the one expected"; exit 3; }
echo
echo "- t_array: compilation:OK, execution:OK and result:OK."
echo
#Need a comparaison of the output
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment