From: Dan Fandrich Date: Fri, 31 Mar 2023 02:13:38 +0000 (-0700) Subject: tests: limit return code of unit tests and lib tests X-Git-Tag: curl-8_1_0~235 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dd471d577716af199ce4e882710bffad84264ab;p=thirdparty%2Fcurl.git tests: limit return code of unit tests and lib tests Values greater than 125 have special meanings, so cap it there. Unit tests and lib tests use the number of failures as the return code, so a large number of failures (such as test 2601 as a torture test) can exceed this causing the test to be erroneously reported as having failed. Ref: #10720 --- diff --git a/tests/libtest/first.c b/tests/libtest/first.c index 932d5bb654..334ccd9274 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -188,5 +188,7 @@ int main(int argc, char **argv) _flushall(); #endif - return result; + /* Regular program status codes are limited to 0..127 and 126 and 127 have + * special meanings by the shell, so limit a normal return code to 125 */ + return result <= 125 ? result : 125; }