#!/usr/bin/env perl ############################################################################# ## ## Copyright (C) 2017 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the Quality Assurance module of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this file in ## accordance with the commercial license agreement provided with the ## Software or, alternatively, in accordance with the terms contained in ## a written agreement between you and The Qt Company. For licensing terms ## and conditions see https://www.qt.io/terms-conditions. For further ## information use the contact form at https://www.qt.io/contact-us. ## ## GNU General Public License Usage ## Alternatively, this file may be used under the terms of the GNU ## General Public License version 3 as published by the Free Software ## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ## included in the packaging of this file. Please review the following ## information to ensure the GNU General Public License requirements will ## be met: https://www.gnu.org/licenses/gpl-3.0.html. ## ## $QT_END_LICENSE$ ## ############################################################################# use 5.010; use strict; use warnings; package QtQA::App::TestRunner; =head1 NAME testrunner - helper script to safely run autotests =head1 SYNOPSIS # Run one autotest safely... $ path/to/testrunner [options] -- some/tst_test1 # Run many autotests safely... (from within a Qt project) # A maximum runtime of 2 minutes each... $ make check "TESTRUNNER=path/to/testrunner --timeout 120 --" # Will run: # path/to/testrunner --timeout 120 -- some/tst_test1 # path/to/testrunner --timeout 120 -- some/tst_test2 # etc... # Run many autotests and capture the logs to $HOME/test-logs, while also # displaying the logs as they are written $ make check "TESTRUNNER=path/to/testrunner --tee-logs $HOME/test-logs --timeout 120 --" # Will generate: # # $HOME/test-logs/testcase1-00.txt # $HOME/test-logs/testcase2-00.txt # This script is a wrapper for running autotests safely and ensuring that uniform results are generated. It is designed to integrate with Qt's `make check' feature. Some features of this script depend on QTestLib-style autotests, while others are usable for any kind of autotest. =head1 OPTIONS =over =item B<--help> Print this message. =item B<--> Separates the options to testrunner from the test command and arguments (mandatory). =item B<--timeout> If the test takes longer than seconds, it will be killed, and the testrunner will exit with a non-zero exit code to indicate failure. =item B<-C> =item B<--chdir> Change to the specified directory before running the test. =item B<--label>