X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=tests%2Fwin32-test-imagex-capture_and_apply.bat;h=01e3f32099894b8a8ddeb90774cceecf6b37ef7a;hp=458d2b8a235caaa2ed43e849bb1b29e0313ed9c7;hb=0e861d2430eda7f8b7d5ee4f67b8a582cc0a8cbd;hpb=da14d32decefdb0b7ab11f631fcb56bea47e8ac7 diff --git a/tests/win32-test-imagex-capture_and_apply.bat b/tests/win32-test-imagex-capture_and_apply.bat index 458d2b8a..01e3f320 100644 --- a/tests/win32-test-imagex-capture_and_apply.bat +++ b/tests/win32-test-imagex-capture_and_apply.bat @@ -6,10 +6,12 @@ REM REM Run some tests on the Windows version of wimlib-imagex. REM REM This must be run on Windows Vista or later in a clean directory, with -REM Administrator privileges. wimlib-imagex and win32-tree-cmp must be callable -REM (on PATH or in same directory). +REM Administrator privileges. wimlib-imagex and win32-tree-cmp must be +REM executable using the paths set below. setlocal EnableDelayedExpansion +set WIN32_TREE_CMP=win32-tree-cmp +set WIMLIB_IMAGEX=wimlib-imagex if exist in.dir rd /S /Q in.dir if exist out.dir rd /S /Q out.dir @@ -20,6 +22,8 @@ REM REM BEGIN TESTS REM +REM goto :rpfix_tests + call :msg "empty directory" call :do_test if %errorlevel% neq 0 exit /b %errorlevel% @@ -307,19 +311,64 @@ mklink /h link file > nul call :do_test if %errorlevel% neq 0 exit /b %errorlevel% +:rpfix_tests + +echo Testing rpfix junction +md subdir +echo 1 > subdir\file +mklink /j junction subdir > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +rd /s /q in.dir +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +echo 1 > tmp1 +type out.dir\junction\file > tmp2 +fc tmp1 tmp2 > nul +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q out.dir +del tmp1 tmp2 +md in.dir +cd in.dir + +echo Testing rpfix exclude +mklink otherlink c:\some\other\directory > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +rd out.dir +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q in.dir +md in.dir +cd in.dir + +echo Testing rpfix relative +echo 1 > file +mklink relink file > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +fc in.dir\file out.dir\relink > nul +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q in.dir out.dir +md in.dir +cd in.dir + REM REM END OF TESTS REM +cd .. +del test.wim +rd /s /q in.dir exit /b 0 :do_test cd .. -wimlib-imagex capture in.dir test.wim --norpfix > NUL +%WIMLIB_IMAGEX% capture in.dir test.wim --norpfix > NUL if %errorlevel% neq 0 exit /b %errorlevel% -wimlib-imagex apply test.wim out.dir > NUL +%WIMLIB_IMAGEX% apply test.wim out.dir > NUL if %errorlevel% neq 0 exit /b %errorlevel% -win32-tree-cmp in.dir out.dir +%WIN32_TREE_CMP% in.dir out.dir if %errorlevel% neq 0 ( echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ echo TEST FAILED!!!!!!! @@ -336,7 +385,7 @@ REM imagex /capture in.dir test.wim "test" /norpfix > nul REM if %errorlevel% neq 0 exit /b %errorlevel% REM imagex /apply test.wim 1 out.dir > nul REM if %errorlevel% neq 0 exit /b %errorlevel% -REM win32-tree-cmp in.dir out.dir +REM %WIN32_TREE_CMP% in.dir out.dir REM if %errorlevel% neq 0 ( REM echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ REM echo TEST FAILED!!!!!!! ^(imagex^)