]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/scripts/setup.cmd
Add Windows port of the regression tests.
[bacula/bacula] / regress / win32 / scripts / setup.cmd
1 REM
2 REM Script to setup running Bacula regression tests
3 REM
4
5 IF "%1" == "" GOTO :usage
6 IF "%2" == "" GOTO :usage
7 IF "%3" == "" GOTO :usage
8 IF "%4" == "" GOTO :usage
9 IF "%5" == "" GOTO :usage
10 IF "%6" == "" GOTO :usage
11 IF "%7" == "" GOTO :usage
12 GOTO :param_count_ok
13
14 :usage
15 ECHO Incorrect number of arguments.
16 ECHO setup bacula-src build-type email-address smtp-host tape-device changer-device tape1-device
17 ECHO.
18 EXIT /b 1
19
20 :param_count_ok
21 RD /s /q build bin tmp working >nul 2>&1
22 MKDIR tmp
23
24 REM Copy new source
25 ECHO Copying source from %1
26 SET SRC=%1
27 FOR /r %1 %%i in ( debug release ) do IF EXIST %%i ECHO %%i | sed -e "s;%SRC:\=\\%\\;;" -e "/installer\\%2/d" -e "/win32\\%2/d" >>tmp\exclude_list
28 ECHO .bsc >>tmp\exclude_list
29 ECHO .ncb >>tmp\exclude_list
30
31 XCOPY %1 build\ /EXCLUDE:tmp\exclude_list /e /q
32
33 DEL build\src\win32\%2\winbacula*.exe
34
35 CALL scripts\install_bacula %2 %3 %4 %5 %6 %7
36
37 CALL scripts\bacula stop >nul 2>&1
38
39 IF NOT EXIST working MKDIR working
40 ECHO Running database creation scripts
41 CALL bin\create_bacula_database
42 CALL bin\drop_bacula_tables
43 CALL bin\make_bacula_tables
44 CALL bin\grant_bacula_privileges
45
46 REM Start and stop Bacula to ensure conf files are OK
47
48 CALL scripts\bacula start
49 CALL scripts\bacula stop >nul 2>&1
50
51 REM
52 REM Save Bacula default conf files for later use
53 REM
54 COPY bin\*.conf scripts >nul
55 GOTO :EOF