#!/usr/bin/env perl use 5.010; use strict; use warnings; use utf8; =head1 NAME 10-testrunner.t - basic test for testrunner.pl =head1 SYNOPSIS perl ./10-testrunner.t This test will run the testrunner.pl script with a few different types of subprocesses and verify that behavior is as expected. =cut use Encode; use English qw( -no_match_vars ); use File::Basename; use File::Spec::Functions; use File::chdir; use FindBin; use Readonly; use Test::More; use Capture::Tiny qw( capture ); use lib "$FindBin::Bin/../../lib/perl5"; use QtQA::Test::More qw( is_or_like ); # 1 if Windows Readonly my $WINDOWS => ($OSNAME =~ m{win32}i); # Directory containing some helper scripts Readonly my $HELPER_DIR => catfile( $FindBin::Bin, 'helpers' ); # perl to print @ARGV unambiguously from a subprocess # (not used directly) Readonly my $TESTSCRIPT_BASE => q{use Data::Dumper; print Data::Dumper->new( \@ARGV )->Indent( 0 )->Dump( ); }; # perl to print @ARGV unambiguously and exit successfully Readonly my $TESTSCRIPT_SUCCESS => $TESTSCRIPT_BASE . 'exit 0'; # perl to print @ARGV unambiguously and exit normally but unsuccessfully Readonly my $TESTSCRIPT_FAIL => $TESTSCRIPT_BASE . 'exit 3'; # perl to print current working directory and exit normally Readonly my $TESTSCRIPT_PRINT_CWD => q{use File::chdir; use File::Spec::Functions; say canonpath $CWD}; # Pattern matching --verbose 'begin' line, without trailing \n. # 'label' is captured. Readonly my $TESTRUNNER_VERBOSE_BEGIN => qr{\QQtQA::App::TestRunner: begin \E(?