]> wimlib.net Git - wimlib/blob - tools/msvc-test-examples.bat
configure.ac: generate version number from git commit and tags
[wimlib] / tools / msvc-test-examples.bat
1 REM
2 REM Try building and running the example programs on Windows with Visual Studio.
3 REM
4
5 @echo off
6 setlocal EnableDelayedExpansion
7
8 copy .libs\libwim.dll.a libwim.lib
9 copy .libs\libwim-15.dll libwim-15.dll
10 for %%a in (examples\*.c) do (
11         cl %%a libwim.lib /Iinclude /link /opt:noref
12         if errorlevel 1 exit /b
13 )
14 call :do_test
15
16
17 cd examples
18 rename *.c *.cc
19 cd ..
20 for %%a in (examples\*.cc) do (
21         cl %%a libwim.lib /Iinclude /link /opt:noref
22         if errorlevel 1 exit /b
23 )
24 call :do_test
25 cd examples
26 rename *.cc *.c
27 cd ..
28
29 del *.exe *.obj *.dll *.lib
30
31 exit /b 0
32
33 :do_test
34 .\applywim.exe j:\test.wim e:\tmp1
35 if errorlevel 1 exit /b
36 .\capturewim.exe e:\tmp1 e:\tmp1.wim
37 if errorlevel 1 exit /b
38 REM Windows likes to give UAC prompts for programs with "update" in their name.
39 move /y updatewim.exe updat3wim.exe
40 .\updat3wim.exe e:\tmp1.wim examples examples
41 if errorlevel 1 exit /b
42
43 .\compressfile.exe j:\testdata e:\testdata.lzx
44 if errorlevel 1 exit /b
45 .\decompressfile.exe e:\testdata.lzx e:\testdata.orig
46 if errorlevel 1 exit /b
47 fc /b j:\testdata e:\testdata.orig
48 if errorlevel 1 exit /b
49
50 .\compressfile.exe j:\testdata e:\testdata.lzx XPRESS 16384
51 if errorlevel 1 exit /b
52 .\decompressfile.exe e:\testdata.lzx e:\testdata.orig
53 if errorlevel 1 exit /b
54 fc /b j:\testdata e:\testdata.orig
55 if errorlevel 1 exit /b
56 goto :eof