-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild_tests.bat
57 lines (46 loc) · 1.35 KB
/
build_tests.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
setlocal
set params=xp_credui xp_LoadLibrarydll
set params=%params% vista_comFileDlg vista_credui vista_getfinalpathnamebyhandle
set params=%params% both_SHGetKnownFolderPath both_SHParseDisplayName
::set params=both_SHParseDisplayName
set settfile=compile.ini
set libpath=bin\lib
set binpath=bin\test
set srcpath=src\test
set logpath=logs
for /f "delims== tokens=1,2" %%G in (%settfile%) do set %%G=%%H
set gcc=%dllc_gccpath%\gcc.exe
path=%path%;%dllc_fbcpath%;%dllc_gccpath%
IF NOT EXIST %binpath% mkdir %binpath%
IF NOT EXIST %logpath% mkdir %logpath%
call :compile_all %params%
call :cleanup
IF DEFINED compilehasfailed pause
endlocal
exit /B 0
::------------------------------
:compile_all
if "%1" EQU "" exit /B 0
echo Compiling %1
pushd .\%srcpath%
set complog=..\..\%logpath%\test_%1.log
IF EXIST res\%1.rc set res=-s gui res\%1.rc
IF NOT EXIST res\%1.rc set res=
fbc %1.bas %res% -i ..\..\src -d _WIN32_WINNT=^&h0601 -Wl "-L ..\..\%libpath%" -x ..\..\%binpath%\%1.exe -i ..\..\src > %complog%
set err=%errorlevel%
for %%R in (%complog%) do if %%~zR lss 1 del %complog%
popd
if not %err% gtr 0 goto :l_nocomperr
set compilehasfailed=yes
echo Failed compiling %1
:l_nocomperr
shift /1
goto compile_all
::------------------------------
:cleanup
echo Cleaning compile residue
del %binpath%\*.exe.a /Q
del %binpath%\*.o /Q
del %binpath%\*.s /Q
exit /B 0