CppCatchAdapter (#195)
* Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Add files via upload * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update setup_debian_2_install_docker.sh * Update cpp_catch2_adapter.rb
This commit is contained in:
@ -1,19 +1,19 @@
|
|||||||
class CppUnitAdapter < TestingFrameworkAdapter
|
class CppCatch2Adapter < TestingFrameworkAdapter
|
||||||
COUNT_REGEXP = /in (\d+) test cases/
|
ALL_PASSED_REGEXP = /in\s+(\d+)\s+test case/
|
||||||
FAILURES_REGEXP = /test cases: (\d+) | (\d+) failed/
|
COUNT_REGEXP = /test cases:\s+(\d+)/
|
||||||
BOTH_REGEXP = /test cases: (\d+) | (\d+) passed | (\d+) failed/
|
FAILURES_REGEXP = / \|\s+(\d+)\s+failed/
|
||||||
ASSERTION_ERROR_REGEXP = /\n(.+) error:(.+); /
|
ASSERTION_ERROR_REGEXP = /\n(.+)error:(.+);/
|
||||||
|
|
||||||
def self.framework_name
|
def self.framework_name
|
||||||
'CppUnit'
|
'CppCatch2'
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_output(output)
|
def parse_output(output)
|
||||||
if SUCCESS_REGEXP.match(output[:stdout])
|
if ALL_PASSED_REGEXP.match(output[:stdout])
|
||||||
{count: Regexp.last_match(1).to_i, passed: Regexp.last_match(1).to_i}
|
{count: Regexp.last_match(1).to_i, passed: Regexp.last_match(1).to_i}
|
||||||
else
|
else
|
||||||
count = COUNT_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || FAILURES_REGEXP.last_match(0).try(:captures).try(:first).try(:to_i) || SUCCESS_REGEXP.last_match(0).try(:captures).try(:first).try(:to_i) || 0
|
count = COUNT_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0
|
||||||
failed = FAILURES_REGEXP.match(1).try(:captures).try(:first).try(:to_i) || BOTH_REGEXP.match(2).try(:captures).try(:first).try(:to_i) || 0
|
failed = FAILURES_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0
|
||||||
error_matches = ASSERTION_ERROR_REGEXP.match(output[:stdout]).try(:captures) || []
|
error_matches = ASSERTION_ERROR_REGEXP.match(output[:stdout]).try(:captures) || []
|
||||||
{count: count, failed: failed, error_messages: error_matches}
|
{count: count, failed: failed, error_messages: error_matches}
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user