Штуки
Some checks failed
Build and Push Docker Images / build (src/LiquidCode.Tester.Gateway/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-gateway-roman, gateway) (push) Successful in 1m12s
Build and Push Docker Images / build (src/LiquidCode.Tester.Worker/Dockerfile, git.nullptr.top/liquidcode/liquidcode-tester-worker-roman, worker) (push) Has been cancelled

This commit is contained in:
2025-11-02 19:31:34 +03:00
parent 50a94ae2be
commit e154890897
103 changed files with 11185 additions and 155 deletions

View File

@@ -0,0 +1,19 @@
set argumentCount=0
for %%x in (%*) do Set /A argumentCount+=1
if not "%argumentCount%"=="4" pause 0
if "%1"=="" pause 0
if "%2"=="" pause 0
if not exist %1 pause 0
files\val.exe --testset "%~3" --group "%~4" < %1
if errorlevel 1 pause 0
solutions\valavshonok_OK.exe < %1 > output.txt
if errorlevel 1 pause 0
if not exist output.txt pause 0
move output.txt %2
check.exe %1 %2 %2
:start
set error=1
if %errorlevel% equ 0 set error=0
if %errorlevel% equ 7 set error=0
if %error% equ 1 pause 0
:end

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
if [ "$#" -ne "4" ]; then
read
fi
if [ "$1" = "" ]; then
read
fi
if [ "$2" = "" ]; then
read
fi
if [ ! -f "$1" ]; then
read
fi
echo "Running validator"
wine files/towin.exe "$1" | wine files/val.exe --testset "$3" --group "$4"
if [ "$?" -ne "0" ]; then
read
fi
echo "Running solution valavshonok_OK.cpp"
wine solutions/valavshonok_OK.exe < "$1" > output.txt
if [ "$?" -ne "0" ]; then
echo "Solution returned non-zero exit code"
read
fi
if [ ! -f "output.txt" ]; then
echo "Solution didn't produced output"
read
fi
mv output.txt "$2"
echo "Running checker"
wine check.exe "$1" "$2" "$2"
if [ "$?" -ne "0" ] && [ "$?" -ne "7" ]; then
echo "Checker exit code is not equal to 0 and 7"
read
fi

View File

@@ -0,0 +1,22 @@
rem parameter 1 is generator execution command line from the root of the package
rem parameter 2 is test input file path from the root of the package
rem parameter 3 is the test index
if "%~1"=="" pause 0
if "%~2"=="" pause 0
if "%~3"=="" pause 0
del /F /Q "%~2"
if exist tmp-for-generator-execution rd /S /Q tmp-for-generator-execution
md tmp-for-generator-execution
cd tmp-for-generator-execution
%~1
if errorlevel 1 pause 0
if exist "%~3" copy "%~3" "..\%~2"
cd ..
rd /S /Q tmp-for-generator-execution
if not exist "%~2" pause 0

View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
if [ "$1" = "" ]
then
echo "First parameter is empty"
read
fi
if [ "$2" = "" ]
then
echo "Second parameter is empty"
read
fi
if [ "$3" = "" ]
then
echo "Third parameter is empty"
read
fi
rm -f "$2"
rm -rf tmp-for-input-generation
mkdir tmp-for-input-generation
cd tmp-for-input-generation
eval $1
if [ "$?" -ne "0" ]
then
echo "Executed "../"$1"", but it returns non-zero exit code"
read
fi
cp "$3" "../$2"
if [ "$?" -ne "0" ]
then
echo "Can't copy $3 to ../$2"
read
fi
if [ ! -f "../$2" ]
then
echo "Can't find ../$2"
read
fi
cd ..
rm -rf tmp-for-input-generation

View File

@@ -0,0 +1,70 @@
@echo off
rem parameter 1 is generator execution command line from the root of the package
rem parameter 2 is test input file path from the root of the package or several paths separated with ":"
rem parameter 3 is the test index or several indices separated with ":"
if "%~1"=="" pause 0
if "%~2"=="" pause 0
if "%~3"=="" pause 0
if exist tmp-for-generator-execution rd /S /Q tmp-for-generator-execution
md tmp-for-generator-execution
cd tmp-for-generator-execution
%~1
if errorlevel 1 pause 0
setlocal ENABLEDELAYEDEXPANSION
set paths=%~2
set indices=%~3
:tokenLoop
if "!paths!" EQU "" goto splitEnd
if "!indices!" EQU "" goto splitEnd
for /f "delims=:" %%a in ("!paths!") do set pathItem=%%a
for /f "delims=:" %%a in ("!indices!") do set indexItem=%%a
if exist "..\!pathItem!" del /F /Q "..\!pathItem!"
set copied=0
if exist "!indexItem!" (
set copied=1
copy "!indexItem!" "..\!pathItem!" > nul
)
if exist "0!indexItem!" (
set copied=1
copy "0!indexItem!" "..\!pathItem!" > nul
)
if exist "00!indexItem!" (
set copied=1
copy "00!indexItem!" "..\!pathItem!" > nul
)
echo %copied%
if "%copied%"=="0" (
echo Unable to find test !indexItem!
pause 0
)
echo Test #!indexItem! has been generated and copied to !pathItem!
:pathsStripLoop
set pathsFirstChar=!paths:~0,1!
set paths=!paths:~1!
if "!paths!" EQU "" goto splitEnd
if "!pathsFirstChar!" NEQ ":" goto pathsStripLoop
:indicesStripLoop
set indicesFirstChar=!indices:~0,1!
set indices=!indices:~1!
if "!indices!" EQU "" goto splitEnd
if "!indicesFirstChar!" NEQ ":" goto indicesStripLoop
goto tokenLoop
:splitEnd
endlocal
cd ..
rd /S /Q tmp-for-generator-execution

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
# parameter 1 is generator execution command line from the root of the package
# parameter 2 is test input file path from the root of the package or several paths separated with ":"
# parameter 3 is the test index or several indices separated with ":"
if [ "$1" = "" ]
then
echo "First parameter is empty"
read
fi
if [ "$2" = "" ]
then
echo "Second parameter is empty"
read
fi
if [ "$3" = "" ]
then
echo "Third parameter is empty"
read
fi
rm -rf tmp-for-input-generation
mkdir tmp-for-input-generation
cd tmp-for-input-generation
eval "$1"
if [ "$?" -ne "0" ]
then
echo "Executed "../"$1"", but it returns non-zero exit code"
read
fi
paths=($(echo "$2" | tr ":" "\n"))
indices=($(echo "$3" | tr ":" "\n"))
for (( i = 0 ; i < ${#paths[@]} ; i++ ))
do
rm -f "../${paths[$i]}"
cp "${indices[$i]}" "../${paths[$i]}" 2> /dev/null ||
cp "0${indices[$i]}" "../${paths[$i]}" 2> /dev/null ||
cp "00${indices[$i]}" "../${paths[$i]}" 2> /dev/null
if [ "$?" -ne "0" ]
then
echo "Can't copy ${indices[$i]} to ../${paths[$i]}"
read
fi
if [ ! -f "../${paths[$i]}" ]
then
echo "Can't find ../${paths[$i]}"
read
fi
echo "Test #${indices[$i]} has been generated and copied to ${paths[$i]}"
done
cd ..
rm -rf tmp-for-input-generation

View File

@@ -0,0 +1,10 @@
rem %1 is generator execution command line from the root of the package
rem %2 is test input file path from the root of the package
rem %3 is the test index
if "%~1"=="" pause 0
if "%~2"=="" pause 0
del /F /Q "%~2"
%~1 > "%~2"
if errorlevel 1 pause 0
if not exist "%~2" pause 0

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
if [ "$1" = "" ]
then
echo "First parameter is empty"
read
fi
if [ "$2" = "" ]
then
echo "Second parameter is empty"
read
fi
rm -f "$2"
eval $1 > $2
if [ "$?" -ne "0" ]
then
echo "Executed $1, but it returns non-zero exit code"
read
fi
if [ ! -f "$2" ]
then
echo "Executed ""$1" > "$2"", but it didn't create file"
read
fi

View File

@@ -0,0 +1,4 @@
echo Running 0 checker test(s)
echo Running 0 checker test(s) 1> checker-tests.log
del /F /Q checker-tests.log
echo Checker test(s) finished

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
echo "Running 0 checker test(s)"
echo "Running 0 checker test(s)" 1> checker-tests.log
rm -f checker-tests.log
echo "Checker test(s) finished"

View File

@@ -0,0 +1,36 @@
echo Running 4 validator test(s)
echo Running 4 validator test(s) 1> validator-tests.log
echo Running test #1 1>> validator-tests.log
echo Validator comment: 1>> validator-tests.log
files\val.exe < files\tests\validator-tests\01 2>> validator-tests.log
if errorlevel 1 (
echo Validator returned non-zero exit code for a valid test 1>> validator-tests.log
echo Validator returned non-zero exit code for a valid test. See validator-tests.log for validator comment
pause 0
)
echo Running test #2 1>> validator-tests.log
echo Validator comment: 1>> validator-tests.log
files\val.exe < files\tests\validator-tests\02 2>> validator-tests.log
if not errorlevel 1 (
echo Validator returned zero exit code for a invalid test 1>> validator-tests.log
echo Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment
pause 0
)
echo Running test #3 1>> validator-tests.log
echo Validator comment: 1>> validator-tests.log
files\val.exe < files\tests\validator-tests\03 2>> validator-tests.log
if not errorlevel 1 (
echo Validator returned zero exit code for a invalid test 1>> validator-tests.log
echo Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment
pause 0
)
echo Running test #4 1>> validator-tests.log
echo Validator comment: 1>> validator-tests.log
files\val.exe < files\tests\validator-tests\04 2>> validator-tests.log
if not errorlevel 1 (
echo Validator returned zero exit code for a invalid test 1>> validator-tests.log
echo Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment
pause 0
)
del /F /Q validator-tests.log
echo Validator test(s) finished

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
echo "Running 4 validator test(s)"
echo "Running 4 validator test(s)" 1> validator-tests.log
echo "Running test #1" 1>> validator-tests.log
echo "Validator comment:" 1>> validator-tests.log
wine files/val.exe < files/tests/validator-tests/01 2>> validator-tests.log
if [ "$?" -ne "0" ]; then
echo "Validator returned non-zero exit code for a valid test" 1>> validator-tests.log
echo "Validator returned non-zero exit code for a valid test. See validator-tests.log for validator comment"
read
fi
echo "Running test #2" 1>> validator-tests.log
echo "Validator comment:" 1>> validator-tests.log
wine files/val.exe < files/tests/validator-tests/02 2>> validator-tests.log
if [ "$?" -eq "0" ]; then
echo "Validator returned zero exit code for a invalid test" 1>> validator-tests.log
echo "Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment"
read
fi
echo "Running test #3" 1>> validator-tests.log
echo "Validator comment:" 1>> validator-tests.log
wine files/val.exe < files/tests/validator-tests/03 2>> validator-tests.log
if [ "$?" -eq "0" ]; then
echo "Validator returned zero exit code for a invalid test" 1>> validator-tests.log
echo "Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment"
read
fi
echo "Running test #4" 1>> validator-tests.log
echo "Validator comment:" 1>> validator-tests.log
wine files/val.exe < files/tests/validator-tests/04 2>> validator-tests.log
if [ "$?" -eq "0" ]; then
echo "Validator returned zero exit code for a invalid test" 1>> validator-tests.log
echo "Validator returned zero exit code for a invalid test. See validator-tests.log for validator comment"
read
fi
rm -f validator-tests.log
echo "Validator test(s) finished"