diff options
author | Micah Anderson <micah@riseup.net> | 2014-08-11 13:49:21 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2014-08-11 13:49:21 -0400 |
commit | 2e59f9740a29439df7c7a56cf0ae83dec3081d31 (patch) | |
tree | d5e7c4e74c9a0f1ea999327d2e68b1dd27be00e0 /test/default/wintest.bat |
initial import of debian version from mentors0.6.1
Diffstat (limited to 'test/default/wintest.bat')
-rwxr-xr-x | test/default/wintest.bat | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/default/wintest.bat b/test/default/wintest.bat new file mode 100755 index 0000000..e50fb49 --- /dev/null +++ b/test/default/wintest.bat @@ -0,0 +1,56 @@ +@ECHO OFF + +if "%1" == "" ( + echo "Usage: wintest.bat <Release | ReleaseDLL | Debug | DebugDLL" + goto :END +) + +if not exist sodium_version.c ( + CD test\default + if not exist sodium_version.c ( + echo "Are you on the right path?" %CD% + goto :END + ) +) + +if "%2" == "x64" (SET ARCH=x64) else (SET ARCH=Win32) +SET CFLAGS=/nologo /DTEST_SRCDIR=\".\" /I..\..\src\libsodium\include\sodium /I..\..\src\libsodium\include /I..\quirks +SET LDFLAGS=/link /LTCG advapi32.lib ..\..\Build\%1\%ARCH%\libsodium.lib +if "%1" == "ReleaseDLL" ( goto :ReleaseDLL ) +if "%1" == "DebugDLL" ( goto :DebugDLL ) +if "%1" == "Release" ( goto :Release ) +if "%1" == "Debug" ( goto :Debug ) +echo "Invalid build type" +goto :END +:ReleaseDLL + SET CFLAGS=%CFLAGS% /MD /Ox + SET PATH=..\..\Build\%1\%ARCH%;%PATH% + goto :COMPILE +:Release + SET CFLAGS=%CFLAGS% /MT /Ox /DSODIUM_STATIC /DSODIUM_EXPORT= + goto :COMPILE +:DebugDLL + SET CFLAGS=%CFLAGS% /GS /MDd /Od + SET PATH=..\..\Build\%1\%ARCH%;%PATH% + goto :COMPILE +:Debug + SET CFLAGS=%CFLAGS% /GS /MTd /Od /DSODIUM_STATIC /DSODIUM_EXPORT= + goto :COMPILE +:COMPILE +echo Running the test suite: +FOR %%f in (*.c) DO ( + cl %CFLAGS% %%f %LDFLAGS% /OUT:%%f.exe > NUL 2>&1 + if not exist %%f.exe ( + echo %%f compile failed + goto :END + ) + %%f.exe + if errorlevel 1 ( + echo %%f failed + ) else ( + echo %%f ok + ) +) +REM Remove temporary files +del *.exe *.obj *.res +:END |