]> wimlib.net Git - wimlib/blobdiff - tests/tests-common.sh
Isolate test cases; allow concurrent execution
[wimlib] / tests / tests-common.sh
index 4f33f6c1d2844ce131266fb7cb4d3f24fa6ce20a..79a4a2f9ea4819178ba08523e2ad94ae7906d390 100644 (file)
@@ -30,3 +30,32 @@ get_file_size()
                stat -c %s "$1"
        fi
 }
+
+imagex()
+{
+       echo "imagex $@"
+       if [[ $1 == info || $1 == mountrw ]]; then
+               ../../imagex "$@"
+       else
+               ../../imagex "$@" > /dev/null
+       fi
+}
+
+wim_ctype()
+{
+       imagex info $1 | grep Compression | awk '{print $2}'
+}
+
+default_cleanup()
+{
+       rm -rf $TEST_SUBDIR
+}
+
+error()
+{
+       echo "****************************************************************"
+       echo "                         Test failure                           "
+       echo $*
+       echo "****************************************************************"
+       exit 1
+}