aboutsummaryrefslogtreecommitdiff
path: root/tools/run.bat
blob: 1a79ef4038cb466ac4554b316668c1df490011bf (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@echo off
:: Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
:: reserved. Use of this source code is governed by a BSD-style license
:: that can be found in the LICENSE file.

set RETURNCODE=
setlocal

cd ..

if "%1" == "" (
echo ERROR: Please specify a target platform: win32 or win64
set ERRORLEVEL=1
goto end
)

if "%2" == "" (
echo ERROR: Please specify a build type: Debug or Release
set ERRORLEVEL=1
goto end
)

if "%3" == "" (
echo ERROR: Please specify a run type: detailed or simple
set ERRORLEVEL=1
goto end
)

echo TEST_JAVA_HOME=%TEST_JAVA_HOME%

if "%TEST_JAVA_HOME%" == "" (
echo ERROR: Please set the TEST_JAVA_HOME environment variable
set ERRORLEVEL=1
goto end
)

if not exist %TEST_JAVA_HOME% (
echo ERROR: TEST_JAVA_HOME path does not exist
set ERRORLEVEL=1
goto end
)

set OUT_PATH=.\out\%~1

set LIB_PATH=.\jcef_build\native\%~2
if not exist %LIB_PATH% (
echo ERROR: Native build output path does not exist
goto end
)

set CLS_PATH=.\third_party\jogamp\jar\*;%OUT_PATH%
set RUN_TYPE=%~3

:: Remove the first three params (%1, %2 and %3) and pass the rest to java.
set RESTVAR=
shift
shift
shift
:loop1
if "%1"=="" goto after_loop
set RESTVAR=%RESTVAR% %1
shift
goto loop1
:after_loop

::%JAVA_HOME%\bin\java -cp %CLS_PATH% -Djava.library.path=%LIB_PATH% tests.%RUN_TYPE%.MainFrame %RESTVAR%
%TEST_JAVA_HOME%\bin\java -cp %OUT_PATH%\jcef-tests.jar tests.%RUN_TYPE%.MainFrame %RESTVAR%

:end
endlocal & set RETURNCODE=%ERRORLEVEL%
goto omega

:returncode
exit /B %RETURNCODE%

:omega
call :returncode %RETURNCODE%