diff --git a/minetest-worldtest.sh b/minetest-worldtest.sh index ee2d9b4..191a572 100755 --- a/minetest-worldtest.sh +++ b/minetest-worldtest.sh @@ -27,6 +27,18 @@ check_built_minetest () return 1 } +# Collect important results for viewing at the end +result_summary="" +result_note () +{ + echo $1 + if [ "$result_summary" == "" ]; then + result_summary="$1" + else + result_summary="$result_summary\\n$1" + fi +} + build_minetest () { tag=$1 @@ -48,7 +60,7 @@ build_minetest () echo "== Patching $tag with $patchfile" patch -p1 < $patchfile if [ "$?" != "0" ]; then - echo "!! Patch failed" + result_note "EE Patch `basename "$patchfile"` failed for $tag" return 1 fi done @@ -57,7 +69,7 @@ build_minetest () cmake . -DRUN_IN_PLACE=1 -DBUILD_CLIENT=0 make -j2 if [ "$?" == "1" ]; then - echo "!! Error building $tag" + echo "EE Error building $tag" return 1 else echo "-- Built $tag" @@ -67,18 +79,6 @@ build_minetest () return 0 } -# Collect important results for viewing at the end -result_summary="" -result_note () -{ - echo $1 - if [ "$result_summary" == "" ]; then - result_summary="$1" - else - result_summary="$result_summary\\n$1" - fi -} - # Build all the versions, if not already built for ruledir in $rulesdir/*; do tag=`cat "$ruledir/tag"` @@ -102,7 +102,7 @@ for ruledir in $rulesdir/*; do echo "== Building $tag" build_minetest "$tag" "$ruledir" "$pkg" "$mtdir" if ! [ "$?" == "0" ]; then - result_note "!! Failed to build $tag" + result_note "EE Failed to build $tag" fi fi done @@ -121,34 +121,44 @@ for ruledir in $rulesdir/*; do #if [ "$?" != "0" ]; then if [ "`grep -c GOOD: "$resultfile"`" == "0" ]; then result_note "== $tag returns all bad for non-existent world" + elif [ "`grep -c BAD: "$resultfile"`" == "0" ]; then + result_note "EE $tag returns all good for non-existent world" else - result_note "!! $tag returns some good for non-existent world" + result_note "EE $tag returns some good for non-existent world" + result_note "`grep GOOD: "$resultfile"`" fi $dir/minetest-worldtest-check-and-set.sh "$mtdir" "$worlddir" "$resultfile" #if [ "$?" == "0" ]; then if [ "`grep -c BAD: "$resultfile"`" == "0" ]; then result_note "== $tag returns all good for self-generated world" + elif [ "`grep -c GOOD: "$resultfile"`" == "0" ]; then + result_note "EE $tag returns all bad for self-generated world" else - result_note "!! $tag returns some bad for self-generated world" + result_note "EE $tag returns some bad for self-generated world" + result_note "`grep BAD: "$resultfile"`" fi # Check worlds generated by previous versions for rule2dir in $rulesdir/*; do tag2=`cat "$rule2dir/tag"` mt2dir=$builddir/minetest-$tag2 + world2dir=$worldsdir/world-$tag2-to-$tag # If tag2 is our current one, stop checking for this and newer if [ "$tag2" == "$tag" ]; then break fi - echo "== Creating world with version $tag2, loading it with $tag" - - rm -rf "$worlddir" - $dir/minetest-worldtest-check-and-set.sh "$mt2dir" "$worlddir" "$resultfile" - $dir/minetest-worldtest-check-and-set.sh "$mtdir" "$worlddir" "$resultfile" + echo "== Using world created by $tag2, loading it with $tag" + rm -rf "$world2dir" + cp -r "$worldsdir/world-$tag2" "$world2dir" + #$dir/minetest-worldtest-check-and-set.sh "$mt2dir" "$world2dir" "$resultfile" + $dir/minetest-worldtest-check-and-set.sh "$mtdir" "$world2dir" "$resultfile" if [ "`grep -c BAD: "$resultfile"`" == "0" ]; then result_note "== $tag returns all good for world generated by $tag2" + elif [ "`grep -c GOOD: "$resultfile"`" == "0" ]; then + result_note "EE $tag returns all bad for world generated by $tag2" else - result_note "!! $tag returns some bad for world generated by $tag2" + result_note "EE $tag returns some bad for world generated by $tag2" + result_note "`grep BAD: "$resultfile"`" fi done done