]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/make.cmd
Add Windows port of the regression tests.
[bacula/bacula] / regress / win32 / make.cmd
1 @ECHO off
2 REM
3 REM Makefile for Bacula regression testing
4 REM
5 REM  Note, Makefile is built from Makefile.in, which you should not really 
6 REM    need to change, by invoking:
7 REM
8 REM  config <user's configuration>
9 REM
10 REM e.g.
11 REM  config kern.conf
12 REM
13
14 SETLOCAL
15
16 IF EXIST config_var.cmd GOTO :already_configured
17 ECHO You must run config first and supply the name of your conf file.
18 ECHO Use prototype.conf as a template.
19 EXIT /B 1
20
21 :already_configured
22
23 SET PATH=%PATH%;%CD%\bin;%CD%\tools
24
25 REM suck in user's configuration
26 CALL config_var.cmd
27
28 IF EXIST "%BACULA_SOURCE%\configure" GOTO :source_ok
29 ECHO Unable to access the Bacula source in %BACULA_SOURCE%.  Update 
30 ECHO BACULA_SOURCE in your configuration file and rerun config.
31 EXIT /B 1
32
33 :source_ok
34 IF "%1" == "setup" GOTO :setup
35 IF "%1" == "bacula" GOTO :bacula
36 IF "%1" == "sed" GOTO :sed
37 IF "%1" == "test" GOTO :test
38 IF "%1" == "full_test" GOTO :full_test
39 IF "%1" == "root_test" GOTO :root_test
40 IF "%1" == "clean" GOTO :clean
41 IF "%1" == "reset" GOTO :reset
42 IF "%1" == "distclean" GOTO :distclean
43
44 IF EXIST "%1" (
45    %1
46 ) ELSE IF EXIST "%1.cmd" (
47    %1
48 ) ELSE IF EXIST tests\%1 (
49    tests\%1
50 ) ELSE IF EXIST tests\%1.cmd (
51    tests\%1
52 ) ELSE (
53    ECHO Unsupported option: %1
54    ECHO Valid options are: 
55    ECHO    setup, bacula, sed, test, full_test, root_test, clean, reset, distclean
56    EXIT /b 1
57 )
58
59 :setup
60 CALL :bacula %2
61 CALL :sed
62 GOTO :EOF
63
64 :bacula
65 RD /s /q build bin weird-files tmp working 2>nul
66 MKDIR tmp working
67 SET BUILD_TYPE=%1
68 IF "%BUILD_TYPE%"=="" SET BUILD_TYPE=release
69 ECHO Doing: scripts\setup "%BACULA_SOURCE%" %BUILD_TYPE% %EMAIL% %SMTP_HOST% %TAPE_DRIVE% %AUTOCHANGER% %AUTOCHANGER_PATH% %TAPE_DRIVE1%
70 CALL scripts\setup "%BACULA_SOURCE%" %BUILD_TYPE% %EMAIL% %SMTP_HOST% %TAPE_DRIVE% %AUTOCHANGER% %AUTOCHANGER_PATH% %TAPE_DRIVE1%
71 GOTO :EOF
72
73 :sed
74 ECHO Doing: scripts\do_sed %EMAIL% %SMTP_HOST% %TAPE_DRIVE% %AUTOCHANGER% %AUTOCHANGER_PATH% %TAPE_DRIVE1%
75 CALL scripts\do_sed %EMAIL% %SMTP_HOST% %TAPE_DRIVE% %AUTOCHANGER% %AUTOCHANGER_PATH% %TAPE_DRIVE1%
76 GOTO :EOF
77
78 :test
79 REM Run all non-root userid tests
80 CALL all-non-root-tests
81 GOTO :EOF
82
83 :full_test
84 REM run all file and tape tests
85 CALL all-tape-and-file-tests
86 GOTO :EOF
87
88 :root_test
89 REM These tests require you to run as root
90 CALL all-root-tests
91 GOTO :EOF
92
93 :clean
94 CALL scripts\cleanup
95 DEL \tmp\file-list tmp\* working\* test.out diff >nul 2>&1
96 DEL 1 2 3 scripts\1 scripts\2 scripts\3 tests\1 tests\2 tests\3 >nul 2>&1
97 DEL .#* /s >nul 2>&1
98 GOTO :EOF
99
100 :reset
101 REM Reset our userid after running as root
102 CALL scripts\cleanup
103 DEL \tmp\file-list tmp\file-list
104 DEL tmp\* working\*
105 GOTO :EOF
106
107 :distclean
108 RD /s /q bin build weird-files weird-files weird-files2 tmp working 2>nul
109 DEL scripts\*.conf
110 CALL :clean
111 GOTO :EOF