xrforge/manyfold/test/300-package_janusxr.sh

36 lines
701 B
Bash
Executable file

#!/bin/sh
id=janusxr
dir=/tmp/hook-package_$id
xrfdir=$dir/.xrforge
mkdir -p $xrfdir
testjml(){
/root/hook.d/experience_updated/*-package_$id.rb $dir/datapackage.json
test -f $xrfdir/scene.jml || {
echo "❌ scene.jml was not created";
exit 1;
}
test -f $xrfdir/janusxr.html || {
echo "❌ janusxr.html was not created";
exit 1;
}
}
echo "### test xrfragment heuristic"
touch $dir/foo.png
touch $dir/foo.glb
echo '{
"image":"foo.png",
"resources": [{"path":"foo.glb"}]
}' > $dir/datapackage.json
testjml
echo "### test first-suitable-3d-file heuristic"
rm $dir/foo.png
echo '{
"resources": [{"path":"foo.glb"}]
}' > $dir/datapackage.json
testjml
rm -rf $dir
exit 0