It is sometimes hard to tell which varient of something like
$SMB_CONF_PATH or $USERNAME is being used in a test. By giving both
the expanded command ($command with environment variables expanded)
and non-expanded command it is easier to reproduce bugs outside the
test environment.
unlink($pcap_file);
}
+# expand strings from %ENV
+sub expand_environment_strings($)
+{
+ my $s = shift;
+ # we use a reverse sort so we do the longer ones first
+ foreach my $k (sort { $b cmp $a } keys %ENV) {
+ $s =~ s/\$$k/$ENV{$k}/g;
+ }
+ return $s;
+}
+
sub run_testsuite($$$$$)
{
my ($envname, $name, $cmd, $i, $totalsuites) = @_;
}
print "command: $cmd\n";
+ printf "expanded command: %s\n", expand_environment_strings($cmd);
my $exitcode = $ret >> 8;