summaryrefslogtreecommitdiff
path: root/windows/gentest.bat
diff options
context:
space:
mode:
Diffstat (limited to 'windows/gentest.bat')
-rw-r--r--windows/gentest.bat31
1 files changed, 31 insertions, 0 deletions
diff --git a/windows/gentest.bat b/windows/gentest.bat
new file mode 100644
index 0000000..da3b123
--- /dev/null
+++ b/windows/gentest.bat
@@ -0,0 +1,31 @@
+SETLOCAL ENABLEDELAYEDEXPANSION
+@echo off
+set testsdir=%~1
+set builddir=%~2
+set CFLAGS=%~3
+set LDFLAGS=%~4
+set CC=%~5
+set LD=%~6
+set TESTMK=%~7
+
+echo %*
+echo recieved !testsdir! !builddir! !CFLAGS! !LDFLAGS! !CC!
+copy NUL $(TEST_MK) > nul
+for /D %%d in (!testsdir!/*) do (
+ for %%f in (!testsdir!/%%d/*.c) do (
+ echo TEST_EXES=!builddir!\tests\%%d_%%~nf.exe ^$^(TEST_EXES^) >> !TESTMK!
+ )
+)
+
+for /D %%d in (!testsdir!/*) do (
+ for %%f in (!testsdir!/%%d/*.c) do (
+ echo !builddir!\%%d_%%~nf.obj: !testsdir!\%%d\%%f; ^$^(CC^) ^$^(TEST_CFLAGS^) /c ^$** /Fo:$@ >> !TESTMK!
+ )
+)
+
+for /D %%d in (!testsdir!/*) do (
+ for %%f in (!testsdir!/%%d/*.c) do (
+ echo !builddir!\tests\%%d_%%~nf.exe: !builddir!\%%d_%%~nf.obj; !LD! !LDFLAGS! $** /out:$@ >> !TESTMK!
+ )
+)
+ENDLOCAL \ No newline at end of file