Skip to content

Commit

Permalink
Prepare MUnit for intentional failures
Browse files Browse the repository at this point in the history
Change the ReportUnitTestResult function in the CommonFunctions.cmake file
to account for intentionally failing checks in an MUnit test output.

Add a check to the section that prints the failure line, which attempts to
match the line to the regex "[Ii]ntentional"  If it finds a match, that
error does not cause the test to fail.

Remove  the failure condition that checks for the error number in the
summary.

OSEHRA-Id: http://issues.osehra.org/browse/OAT-150
Change-Id: I5c0bb477111c0a816d87382ab6baeef9bece34d0
  • Loading branch information
josephsnyder committed Jul 31, 2014
1 parent 82d1779 commit 4a031ce
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions CMake/CommonFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ function(ReportUnitTestResult PACKAGE_NAME DIRNAME OUTPUT)
# Captures and prints the failure message
elseif(line MATCHES "^ ?[^\\^]+\\^${routine_name}+")
message("${routine_name}: ${line}")
set(test_passed FALSE)
# Matches the first part of the results line, checking for test failures
elseif(line MATCHES "^ ?Checked.*, with [1-9]+ failure")
message("${routine_name} in package ${PACKAGE_NAME}:\n${line}")
set(test_passed FALSE)
if(NOT ${line} MATCHES [iI]ntentional)
set(test_passed FALSE)
endif()
# Matches the second part of the results line, checking for errors
elseif(line MATCHES "encountered [1-9]+ error")
message("M Error(s) encountered in ${routine_name} in package ${PACKAGE_NAME}")
Expand Down

0 comments on commit 4a031ce

Please sign in to comment.