diff --git a/procedures/igortest-basics.ipf b/procedures/igortest-basics.ipf index c93f035b..1fe9bc45 100644 --- a/procedures/igortest-basics.ipf +++ b/procedures/igortest-basics.ipf @@ -453,15 +453,12 @@ static Function EvaluateRTE(err, errmessage, abortCode, funcName, funcType, proc IUTF_Reporting#AddError(str, IUTF_STATUS_ERROR) break default: + sprintf str, "Encountered \"AbortOnValue\" Code %d in %s \"%s\" (%s)", abortCode, funcTypeString, funcName, procWin + IUTF_Reporting#AddFailedSummaryInfo(str) + IUTF_Reporting#AddError(str, IUTF_STATUS_ERROR) break endswitch message += str - if(abortCode > 0) - sprintf str, "Encountered \"AbortOnValue\" Code %d in %s \"%s\" (%s)", abortCode, funcTypeString, funcName, procWin - IUTF_Reporting#AddFailedSummaryInfo(str) - IUTF_Reporting#AddError(str, IUTF_STATUS_ERROR) - message += str - endif endif IUTF_Reporting#ReportError(message, incrGlobalErrorCounter = 0) diff --git a/procedures/igortest-tap.ipf b/procedures/igortest-tap.ipf index ddd9cd47..a8cd7b23 100644 --- a/procedures/igortest-tap.ipf +++ b/procedures/igortest-tap.ipf @@ -7,9 +7,6 @@ static StrConstant TAP_LINEEND_STR = "\n" /// @brief returns 1 if all test cases are marked as SKIP and TAP is enabled, zero otherwise -/// -/// @param testCaseList list of function names -/// @returns 1 if all test cases are marked as SKIP and TAP is enabled, zero otherwise static Function TAP_AreAllFunctionsSkip() variable dimPos diff --git a/tests/UnitTests/Utils/AbortedTests.ipf b/tests/UnitTests/Utils/AbortedTests.ipf new file mode 100644 index 00000000..7b3ec0e1 --- /dev/null +++ b/tests/UnitTests/Utils/AbortedTests.ipf @@ -0,0 +1,33 @@ +#pragma rtGlobals=3 +#pragma TextEncoding="UTF-8" +#pragma rtFunctionErrors=1 +#pragma version=1.10 +#pragma ModuleName=TEST_Aborted + +static Function TEST_CASE_BEGIN_OVERRIDE(testcase) + string testcase + + variable/G root:historyRef = CaptureHistoryStart() +End + +static Function TEST_CASE_END_OVERRIDE(testcase) + string testcase + + NVAR/SDFR=root: historyRef + string/G root:history = CaptureHistory(historyRef, 1) +End + +// IUTF_EXPECTED_FAILURE +static Function AbortWithNegativeValue() + + AbortOnValue 1, -10 +End + +static Function EvaluateAbortWithNegativeValue() + + SVAR/SDFR=root: history + + INFO("%s", s0 = history) + + CHECK_GE_VAR(strsearch(history, "Encountered \"AbortOnValue\" Code -10 in test case \"TEST_Aborted#AbortWithNegativeValue\" (AbortedTestcases.ipf)", 0), 0) +End diff --git a/tests/UnitTests/main.ipf b/tests/UnitTests/main.ipf index d67f7685..66dac31a 100644 --- a/tests/UnitTests/main.ipf +++ b/tests/UnitTests/main.ipf @@ -10,6 +10,7 @@ #include ":Tracing:ComplexityTests" #include ":Utils:PathsTests" #include ":Utils:StringsTests" +#include ":Utils:AbortedTests" #undef UTF_ALLOW_TRACING #if Exists("TUFXOP_Version")