summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2023-04-13 11:58:41 -0700
committerDan Fandrich <dan@coneharvesters.com>2023-04-18 13:18:17 -0700
commita3bccb2893ab175dad99f843c555183e1cc71c9d (patch)
tree78a1f61bf1b38b0145c97754ce6c63505b908d9e /tests
parentcb5127e17c1c2dade6c3ed7712162cd9d7d1940c (diff)
downloadcurl-a3bccb2893ab175dad99f843c555183e1cc71c9d.tar.gz
runtests: factor out singletest_postcheck
This will eventually need to be part of the test runner. Ref: #10818
Diffstat (limited to 'tests')
-rwxr-xr-xtests/runtests.pl31
1 files changed, 24 insertions, 7 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index dcd25f62f..5e26a3e0f 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -348,7 +348,7 @@ sub runclientoutput {
# my @out = `ssh $CLIENTIP cd \'$pwd\' \\; \'$cmd\'`;
# sleep 2; # time to allow the NFS server to be updated
# return @out;
- }
+}
#######################################################################
# Memory allocation test and failure torture testing.
@@ -2001,11 +2001,10 @@ sub singletest_clean {
return 0;
}
-
#######################################################################
-# Verify test succeeded
-sub singletest_check {
- my ($testnum, $cmdres, $CURLOUT, $tool, $disablevalgrind)=@_;
+# Verify that the postcheck succeeded
+sub singletest_postcheck {
+ my ($testnum)=@_;
# run the postcheck command
my @postcheck= getpart("client", "postcheck");
@@ -2025,9 +2024,13 @@ sub singletest_check {
}
}
}
+ return 0;
+}
- # restore environment variables that were modified
- restore_test_env(0);
+#######################################################################
+# Verify test succeeded
+sub singletest_check {
+ my ($testnum, $cmdres, $CURLOUT, $tool, $disablevalgrind)=@_;
# Skip all the verification on torture tests
if ($torture) {
@@ -2647,6 +2650,19 @@ sub singletest {
return $error;
}
+ #######################################################################
+ # Verify that the postcheck succeeded
+ $error = singletest_postcheck($testnum);
+ if($error == -1) {
+ # return a test failure, either to be reported or to be ignored
+ return $errorreturncode;
+ }
+
+
+ #######################################################################
+ # restore environment variables that were modified
+ restore_test_env(0);
+
#######################################################################
# Verify that the test succeeded
@@ -2661,6 +2677,7 @@ sub singletest {
return $cmdres;
}
+
#######################################################################
# Report a successful test
singletest_success($testnum, $count, $total, $errorreturncode);