From: Fabian Keil Date: Tue, 1 Feb 2022 10:46:53 +0000 (+0100) Subject: runtests.pl: tolerate test directories without Makefile.inc X-Git-Tag: curl-7_82_0~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cb0eaba75363a7d8f3801218f415f9be1436b55;p=thirdparty%2Fcurl.git runtests.pl: tolerate test directories without Makefile.inc Silences the following warnings when using a Makefile.inc-free TESTDIR using the "-o" argument: readline() on closed filehandle D at ./runtests.pl line 592. Use of uninitialized value $disttests in pattern match (m//) at ./runtests.pl line 3602. Closes https://github.com/curl/curl/pull/8379 --- diff --git a/tests/runtests.pl b/tests/runtests.pl index d67f40a123..f726d223ba 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -586,9 +586,11 @@ sub checkcmd { ####################################################################### # Get the list of tests that the tests/data/Makefile.am knows about! # -my $disttests; +my $disttests = ""; sub get_disttests { - open(D, "<$TESTDIR/Makefile.inc"); + # If a non-default $TESTDIR is being used there may not be any + # Makefile.inc in which case there's nothing to do. + open(D, "<$TESTDIR/Makefile.inc") or return; while() { chomp $_; if(($_ =~ /^#/) ||($_ !~ /test/)) {