Something went wrong. Try again.
Reactos
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970:::: PROJECT: ReactOS CMD Testing Suite:: LICENSE: GPL v2 or any later version:: FILE: lib/testlib.cmd:: PURPOSE: Library with functions available for all tests:: COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>::
:: Indicate that a test ran successfully:_successfulset /a test_count+=1set /a successful_tests+=1goto :EOF
:: Indicate that a test failed:: @param 1 Description of the test that failed:_failedset /a test_count+=1set /a failed_tests+=1echo Test "%~1" failed!goto :EOF
:: Test whether a call succeeded:: @param 1 The test command to run and check:_test%~1
if "%errorlevel%" == "0" ( call :_successful) else ( call :_failed "%~1")goto :EOF
:: Test whether a call failed:: @param 1 The test command to run and check:_testnot%~1
if "%errorlevel%" == "0" ( call :_failed "%~1") else ( call :_successful)goto :EOF
:: Test the value of a variable:: @param 1 The variable to check (like %test%):: @param 2 The variable name (like test):: @param 3 The expected result (like 5):: If this parameter wasn't given, _testvar checks if the variable is not "":_testvarif "%~3" == "" ( set testvar_operator=not) else ( set testvar_operator=)
if %testvar_operator% "%~1" == "%~3" ( call :_successful) else ( call :_failed "if %%~2%% == %~3, actual result was %~1")
goto :EOF