Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
iniparser
Fail-testrun-on-test-failure.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Fail-testrun-on-test-failure.patch of Package iniparser
From b7a2c2999aabf2a83ccc164b9729259ea400e747 Mon Sep 17 00:00:00 2001 From: Dan Bungert <daniel.bungert@canonical.com> Date: Thu, 18 Feb 2021 17:35:58 -0700 Subject: [PATCH] Fail testrun on test failure Test failures can go unnoticed, as currently the test runner unconditionally returns exit code 0. Consult the number of test failures and exit code 1 if there are any. --- test/make-tests.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/make-tests.sh b/test/make-tests.sh index f2a3f2a..78e6901 100755 --- a/test/make-tests.sh +++ b/test/make-tests.sh @@ -26,10 +26,11 @@ cat $FILES | grep '^void Test' | echo \ ' -void RunAllTests(void) +int RunAllTests(void) { CuString *output = CuStringNew(); CuSuite* suite = CuSuiteNew(); + int ret = 0; ' cat $FILES | grep '^void Test' | @@ -42,15 +43,16 @@ echo \ ' CuSuiteRun(suite); CuSuiteSummary(suite, output); + if (suite->failCount > 0) ret = 1; CuSuiteDetails(suite, output); printf("%s\n", output->buffer); CuStringDelete(output); CuSuiteDelete(suite); + return ret; } int main(void) { - RunAllTests(); - return 0; + return RunAllTests(); } ' -- 2.37.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor