Move debugging remainders detection to t/00_testssl_help.t
This commit is contained in:
parent
ec722e0e9c
commit
5083e950d2
|
@ -7,6 +7,11 @@ use Test::More;
|
||||||
|
|
||||||
my $tests = 0;
|
my $tests = 0;
|
||||||
my $fileout="";
|
my $fileout="";
|
||||||
|
my $prg="./testssl.sh";
|
||||||
|
my $out="";
|
||||||
|
|
||||||
|
# Try to detect remainders from debugging:
|
||||||
|
my $debug_regexp='^(\s)*set (-|\+)x';
|
||||||
# Blacklists we use to trigger an error:
|
# Blacklists we use to trigger an error:
|
||||||
my $error_regexp1='(syntax|parse) (e|E)rror';
|
my $error_regexp1='(syntax|parse) (e|E)rror';
|
||||||
my $error_regexp2='testssl.sh: line';
|
my $error_regexp2='testssl.sh: line';
|
||||||
|
@ -15,7 +20,7 @@ my $error_regexp4='command not found';
|
||||||
my $error_regexp5='(syntax error|unexpected token)';
|
my $error_regexp5='(syntax error|unexpected token)';
|
||||||
|
|
||||||
printf "\n%s\n", "Testing whether just calling \"./testssl.sh\" produces no error ...";
|
printf "\n%s\n", "Testing whether just calling \"./testssl.sh\" produces no error ...";
|
||||||
$fileout = `timeout 10 bash ./testssl.sh 2>&1`;
|
$fileout = `timeout 10 bash $prg 2>&1`;
|
||||||
my $retval=$?;
|
my $retval=$?;
|
||||||
|
|
||||||
unlike($fileout, qr/$error_regexp1/, "regex 1");
|
unlike($fileout, qr/$error_regexp1/, "regex 1");
|
||||||
|
@ -36,6 +41,10 @@ $tests++;
|
||||||
is($retval, 0, "return value should be equal zero: \"$retval\"");
|
is($retval, 0, "return value should be equal zero: \"$retval\"");
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
|
$out=`grep -E "$debug_regexp" $prg`;
|
||||||
|
unlike($out, qr/$debug_regexp/, "Debug RegEx");
|
||||||
|
$tests++;
|
||||||
|
|
||||||
printf "\n";
|
printf "\n";
|
||||||
done_testing($tests);
|
done_testing($tests);
|
||||||
|
|
||||||
|
|
28
t/03_set-x.t
28
t/03_set-x.t
|
@ -1,28 +0,0 @@
|
||||||
#!/usr/bin/env perl
|
|
||||||
|
|
||||||
# Basics: is there a synatx error where already bash hiccups on?
|
|
||||||
# --banner is equal to --version
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use Test::More;
|
|
||||||
|
|
||||||
my $tests = 0;
|
|
||||||
my $fileout="";
|
|
||||||
# Blacklists we use to trigger an error:
|
|
||||||
my $error_regexp='^(\|)+([0-9])+>\s+[a-z]';
|
|
||||||
|
|
||||||
printf "\n%s\n", "Testing whether we forgot \"set -x\" ...";
|
|
||||||
$fileout = `./testssl.sh --help 2>&1`;
|
|
||||||
my $retval=$?;
|
|
||||||
|
|
||||||
unlike($fileout, qr/$error_regexp/, "just ran help");
|
|
||||||
$tests++;
|
|
||||||
|
|
||||||
$fileout = `./testssl.sh --ssl-native --color=0 --fast --ip=one google.com 2>&1`;
|
|
||||||
unlike($fileout, qr/$error_regexp/, "ran --ssl-native --color=0 --fast --ip=one google.com");
|
|
||||||
$tests++;
|
|
||||||
|
|
||||||
printf "\n";
|
|
||||||
done_testing($tests);
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue