forked from rizonesoft/Notepad3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestAhkNotepad3.cmd
54 lines (48 loc) · 2.01 KB
/
TestAhkNotepad3.cmd
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
@echo off
setlocal enableextensions
set SCRIPTDRV=%~d0
set SCRIPTDIR=%~dp0
set CWD=%CD%
set TEST_DIR=%SCRIPTDIR%_TESTDIR\
set TEST_LOG=test.log
set NP3_CONFIG_DIR=%SCRIPT_DIR%config\
set NP3_WIN32_DIR=%SCRIPT_DIR%..\Bin\Release_x86_v142\
set NP3_X64_DIR=%SCRIPT_DIR%..\Bin\Release_x64_v142\
set AHK_EXE=%ProgramW6432%/AutoHotkey/AutoHotkeyU32.exe
set AHK_EXE32=%ProgramFiles(x86)%/AutoHotkey/AutoHotkeyU32.exe
set AHK_EXE64=%ProgramFiles%/AutoHotkey/AutoHotkeyU32.exe
if not exist "%AHK_EXE%" set AHK_EXE=%AHK_EXE32%
if not exist "%AHK_EXE%" set AHK_EXE=%AHK_EXE64%
:: --------------------------------------------------------------------------------------------------------------------
:: prepare tests
if not exist "%TEST_DIR%" mkdir "%TEST_DIR%"
if not exist "%TEST_DIR%Favorites\" mkdir "%TEST_DIR%Favorites\"
copy "%NP3_CONFIG_DIR%Notepad3_distrib.ini" "%TEST_DIR%Notepad3.ini" /Y /V
if exist "%NP3_WIN32_DIR%Notepad3.exe" copy /B "%NP3_WIN32_DIR%Notepad3.exe" /B "%TEST_DIR%Notepad3.exe" /Y /V
if exist "%NP3_X64_DIR%Notepad3.exe" copy /B "%NP3_X64_DIR%Notepad3.exe" /B "%TEST_DIR%Notepad3.exe" /Y /V
::Loop over all ahk files in tests directory
echo. > "%TEST_LOG%"
set EXITCODE=0
::for /r %%i in (*.ahk) do (
for %%i in (*.ahk) do (
echo - Run Testsuite %%~nxi
echo +++ Run Testsuite %%~nxi +++ >> "%TEST_LOG%"
start "testing" /B /Wait "%AHK_EXE%" /ErrorStdOut "%%~nxi" >> "%TEST_LOG%" 2>&1
if errorlevel 1 (
set EXITCODE=1
echo *** Testsuite %%~nxi failed! ***
echo *** ERROR: Testsuite %%~nxi failed! *** >> "%TEST_LOG%"
) else (
echo +++ Testsuite %%~nxi succeeded. +++ >> "%TEST_LOG%"
)
echo. >> "%TEST_LOG%"
)
:: --------------------------------------------------------------------------------------------------------------------
:END
type "%TEST_LOG%"
:: - make EXITCODE survive 'endlocal'
endlocal & set EXITCODE=%EXITCODE%
::echo.EXITCODE=%EXITCODE%
::pause
if [%EXITCODE%] NEQ [0] exit /B %EXITCODE%
:: ====================================================================================================================