-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests_windows.bat
More file actions
38 lines (38 loc) · 1.14 KB
/
run_tests_windows.bat
File metadata and controls
38 lines (38 loc) · 1.14 KB
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
@echo off
echo Compiling program...
g++ {{SOLUTION_NAME}} -o output.exe
echo Compilation finished.
if "{{SAMPLE_LEN}}"=="0" (
output < {{SAMPLE_DIR_NAME}}\input0.txt > output0.txt
fc output0.txt {{SAMPLE_DIR_NAME}}\output0.txt > nul
if errorlevel 1 (
echo Failed test 0 :^^O
echo Expected output:
type {{SAMPLE_DIR_NAME}}\output0.txt
echo.
echo Recieved:
type output0.txt
echo.
) else (
echo Passed test 0 :^^D
)
del output0.txt
) else (
if not exist {{TEMP_DIR_NAME}} mkdir {{TEMP_DIR_NAME}}
for /L %%i in (0, 1, {{SAMPLE_LEN}}) do (
output < {{SAMPLE_DIR_NAME}}\input%%~ni.txt > {{TEMP_DIR_NAME}}\output%%~ni.txt
fc {{SAMPLE_DIR_NAME}}\output%%~ni.txt {{TEMP_DIR_NAME}}\output%%~ni.txt > nul
if errorlevel 1 (
echo Failed test %%i :^^O
echo Expected:
type {{SAMPLE_DIR_NAME}}\output%%~ni.txt
echo.
echo Recieved:
type {{TEMP_DIR_NAME}}\output%%~ni.txt
echo.
) else (
echo Passed test %%i :^^D
)
)
rmdir /S /Q {{TEMP_DIR_NAME}}
)