#!/bin/sh
export CARGO_MANIFEST_DIR="$(cd "$(dirname "$0")" && pwd)"
cd $CARGO_MANIFEST_DIR

ln -sf `which rsvg-convert` ./rsvg-convert

./api_test/bin/api

if [ $? = 0 ]; then
  echo PASS: /usr/lib/librsvg/ptest/api_test/bin/api
  rc=0
else
  echo FAIL: /usr/lib/librsvg/ptest/api_test/bin/api
  rc=1
fi

# rust tests are appended here by ptest-cargo class

echo ""
echo "## starting to run rust tests ##"
if [ -z "$rc" ]; then rc=0; fi
if ! /usr/lib/librsvg/ptest/api-b158b11938f9b68f 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/api-b158b11938f9b68f"
else
    echo "PASS: /usr/lib/librsvg/ptest/api-b158b11938f9b68f"
fi
if ! /usr/lib/librsvg/ptest/bugs-a7c1173c21c93748 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/bugs-a7c1173c21c93748"
else
    echo "PASS: /usr/lib/librsvg/ptest/bugs-a7c1173c21c93748"
fi
if ! /usr/lib/librsvg/ptest/errors-1614adba8b2bbe49 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/errors-1614adba8b2bbe49"
else
    echo "PASS: /usr/lib/librsvg/ptest/errors-1614adba8b2bbe49"
fi
if ! /usr/lib/librsvg/ptest/filters-d3ce7faa2b6c46cb 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/filters-d3ce7faa2b6c46cb"
else
    echo "PASS: /usr/lib/librsvg/ptest/filters-d3ce7faa2b6c46cb"
fi
if ! /usr/lib/librsvg/ptest/geometries-58697174d1f7e461 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/geometries-58697174d1f7e461"
else
    echo "PASS: /usr/lib/librsvg/ptest/geometries-58697174d1f7e461"
fi
if ! /usr/lib/librsvg/ptest/intrinsic_dimensions-7f18f36346ab020f 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/intrinsic_dimensions-7f18f36346ab020f"
else
    echo "PASS: /usr/lib/librsvg/ptest/intrinsic_dimensions-7f18f36346ab020f"
fi
if ! /usr/lib/librsvg/ptest/loading_crash-0d5d9735101b74de 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/loading_crash-0d5d9735101b74de"
else
    echo "PASS: /usr/lib/librsvg/ptest/loading_crash-0d5d9735101b74de"
fi
if ! /usr/lib/librsvg/ptest/loading_disallowed-3b9dd15a1678868a 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/loading_disallowed-3b9dd15a1678868a"
else
    echo "PASS: /usr/lib/librsvg/ptest/loading_disallowed-3b9dd15a1678868a"
fi
if ! /usr/lib/librsvg/ptest/primitive_geometries-37e28bf9c31fd0d0 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/primitive_geometries-37e28bf9c31fd0d0"
else
    echo "PASS: /usr/lib/librsvg/ptest/primitive_geometries-37e28bf9c31fd0d0"
fi
if ! /usr/lib/librsvg/ptest/primitives-3145a8bf14df2ea6 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/primitives-3145a8bf14df2ea6"
else
    echo "PASS: /usr/lib/librsvg/ptest/primitives-3145a8bf14df2ea6"
fi
if ! /usr/lib/librsvg/ptest/reference-4bfe9b9a6e223b5e 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/reference-4bfe9b9a6e223b5e"
else
    echo "PASS: /usr/lib/librsvg/ptest/reference-4bfe9b9a6e223b5e"
fi
if ! /usr/lib/librsvg/ptest/render_crash-f0a4a66287b2dfce 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/render_crash-f0a4a66287b2dfce"
else
    echo "PASS: /usr/lib/librsvg/ptest/render_crash-f0a4a66287b2dfce"
fi
if ! /usr/lib/librsvg/ptest/rsvg-3204aaf07f0bd303 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/rsvg-3204aaf07f0bd303"
else
    echo "PASS: /usr/lib/librsvg/ptest/rsvg-3204aaf07f0bd303"
fi
if ! /usr/lib/librsvg/ptest/rsvg_convert-07d278cf47b17aee 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/rsvg_convert-07d278cf47b17aee"
else
    echo "PASS: /usr/lib/librsvg/ptest/rsvg_convert-07d278cf47b17aee"
fi
if ! /usr/lib/librsvg/ptest/rsvg_convert-5273dfe6a456ce4e 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/rsvg_convert-5273dfe6a456ce4e"
else
    echo "PASS: /usr/lib/librsvg/ptest/rsvg_convert-5273dfe6a456ce4e"
fi
if ! /usr/lib/librsvg/ptest/rsvg_convert-be7b0b15d7e6d168 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/rsvg_convert-be7b0b15d7e6d168"
else
    echo "PASS: /usr/lib/librsvg/ptest/rsvg_convert-be7b0b15d7e6d168"
fi
if ! /usr/lib/librsvg/ptest/shapes-d9d729a166c9f40a 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/shapes-d9d729a166c9f40a"
else
    echo "PASS: /usr/lib/librsvg/ptest/shapes-d9d729a166c9f40a"
fi
if ! /usr/lib/librsvg/ptest/text-e4babbe855e1ee95 
then
    rc=1
    echo "FAIL: /usr/lib/librsvg/ptest/text-e4babbe855e1ee95"
else
    echo "PASS: /usr/lib/librsvg/ptest/text-e4babbe855e1ee95"
fi
exit $rc
