Output adjustments closer to a more common format

This commit is contained in:
Dirk Wetter
2020-01-14 18:44:11 +01:00
parent 13aa6aa433
commit 8d864aba2e
7 changed files with 42 additions and 30 deletions

View File

@ -18,8 +18,10 @@ my $check2run="--color 0 --htmlfile tmp.html";
die "Unable to open $prg" unless -f $prg;
printf "\n%s\n", "Doing HTML output checks";
#1
printf "\n%s\n", "Running $prg against $uri to create HTML and terminal outputs (may take 2~3 minutes) ...";
printf "%s\n", " .. running $prg against $uri to create HTML and terminal outputs (may take 2~3 minutes)";
# specify a TERM_WIDTH so that the two calls to testssl.sh don't create HTML files with different values of TERM_WIDTH
$out = `TERM_WIDTH=120 $prg $check2run $uri`;
$html = `cat tmp.html`;
@ -41,12 +43,12 @@ $edited_html =~ s/>/>/g;
$edited_html =~ s/"/"/g;
$edited_html =~ s/'/'/g;
printf "\n%s\n", "Comparing HTML and terminal outputs";
printf "\n%s\n", " .. comparing HTML and terminal outputs";
cmp_ok($edited_html, "eq", $out, "HTML file matches terminal output");
$tests++;
#2
printf "\n%s\n", "Running $prg against $uri with --debug 4 to create HTML output (may take 2~3 minutes)";
printf "\n%s\n", " .. running $prg against $uri with --debug 4 to create HTML output (may take another 2~3 minutes)";
# Redirect stderr to /dev/null in order to avoid some unexplained "date: invalid date" error messages
$out = `TERM_WIDTH=120 $prg $check2run --debug 4 $uri 2> /dev/null`;
$debughtml = `cat tmp.html`;
@ -66,9 +68,9 @@ $debughtml =~ s/HTTP clock skew \+?-?[0-9]* /HTTP clock skew
$debughtml =~ s/ Pre-test: .*\n//g;
$debughtml =~ s/.*OK: below 825 days.*\n//g;
printf "\n%s\n", "Checking that using the --debug option doesn't affect the HTML file";
printf "\n%s\n", " .. checking that using the --debug option doesn't affect the HTML file";
cmp_ok($debughtml, "eq", $html, "HTML file created with --debug 4 matches HTML file created without --debug");
$tests++;
printf "\n%s\n";
printf "\n";
done_testing($tests);