1
# LSB Test Execution Framework
2
# Qt3-azov Test Module (Qt3_azov_test.pm)
4
# Copyright (C) 2007-2009 The Linux Foundation. All rights reserved.
6
# This program has been developed by ISP RAS for LF.
7
# The ptyshell tool is originally written by Jiri Dluhos <jdluhos@suse.cz>
8
# Copyright (C) 2005-2007 SuSE Linux Products GmbH
10
# This program is free software; you can redistribute it and/or
11
# modify it under the terms of the GNU General Public License
12
# version 2 as published by the Free Software Foundation.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
24
package Qt3_azov_test;
31
our @ISA = qw(Test_common); # Inherit Test_common
34
#----------------------------------------------------------------------
36
my $checkpoints = undef;
38
#----------------------------------------------------------------------
43
if ( does_shell_know ("ldconfig") ) {
44
for my $lib ( qw/libqt-mt.so.3/ ) {
45
my $lib_grep = "\\<".$lib." ";
46
$lib_grep =~ s/\./\\./g;
47
cmd("ldconfig -p | grep ".shq($lib_grep)) == 0
48
or return error $self->{NAME}." test can't be run without library '$lib'.";
52
is_ok $self->prepare_options() or return $Error::Last;
60
( defined $self->{OPTIONS} )
61
or return error "Answers are undefined"; # Should not happen
63
my $testsuite_dir = $self->option('TESTSUITE_DIR') || "/opt/lsb/test/qt3-azov";
64
$self->{TESTSUITE_DIR} = $testsuite_dir;
65
$self->{RESULTS_DIR} = $self->option('RESULTS_DIR') || "/opt/lsb/test/qt3-azov/results";
67
my $q = 'X11_FONT_PATH';
68
if ( !defined $self->{OPTIONS}{$q}->{VALUE} ) {
69
my $x11_fonts_dir = X11_common::guess_font_dir();
70
is_ok($x11_fonts_dir) or return error $self->name
71
." test requires certain X11 fonts to be installed.", $Error::Last;
72
$self->{OPTIONS}{$q}->{VALUE} = $x11_fonts_dir."/misc";
81
# Call the parent's prepare function
82
is_ok $self->Test_common::prepare() or return $Error::Last;
84
# Download and install required packages
85
is_ok $self->prepare_test_packages() # According to the Manifest
86
or return error "Failed to download and install packages for '"
87
.$self->name."' test.", $Error::Last;
89
cmd ("killall -q Xvfb"); # Should be done before calling guess_display()
92
is_ok $self->prepare_options() or return $Error::Last;
95
cmd("rm -rf ".shq($self->{RESULTS_DIR})."/*");
97
init_checkpoint_data($self->{VERSION});
105
my $subshell = $self->Spawn_subshell();
106
is_ok $subshell or return $Error::Last;
108
# Change to the test suite directory
110
$subshell->Send("cd ".shq($self->{TESTSUITE_DIR})."\n");
112
my $test_display = ":9.0";
113
my $x11_fonts_dir = $self->option('X11_FONT_PATH')
114
or return error "X11 font dir is not set";
116
# Start X Virtual Frame Buffer
118
$subshell->Send( "/opt/lsb/bin/Xvfb"
119
." -render -screen 0 1024x768x24"
122
." ".shq($x11_fonts_dir)
126
$subshell->Send("export DISPLAY=$test_display"."\n");
129
$subshell->Send("export G_SLICE=always-malloc"."\n");
133
$subshell->Send("./run_tests.sh; exit"."\n");
135
# Just wait for the test finished
136
while ( my $line = $subshell->Read(2) ) {
137
$self->check_progress($line);
140
# Just confirm that the subshell has finished
141
$subshell->WaitForSubshell();
147
my ($self, $line) = @_;
149
defined $line or $line = "";
151
if ( $line =~ /^Executing tests for (.*)[\r\n]/ ) {
153
$self->progress_profiled($checkpoints, $testcase);
157
$self->progress_profiled();
163
$self->{JOURNAL_FILE} = $self->name.".journal";
164
$self->{JOURNAL_TYPE} = 'TET';
166
# Find the journal file and copy it to where it should be.
167
is_ok $self->copy_file_globbed( $self->{RESULTS_DIR}."/0*/journal", $self->journal_file )
168
or $self->report_error($Error::Last);
176
cmd ("killall -q Xvfb");
179
sub init_checkpoint_data {
182
# qt3-azov v. 4.0.0-1 for LSB 4.0
184
[ 0, 'QButtonGroup' ],
185
[ 6, 'QCanvasPixmap' ],
186
[ 12, 'QFilePreview' ],
188
[ 24, 'QHebrewCodec' ],
190
[ 39, 'QHttpHeader' ],
191
[ 46, 'QMetaObject' ],
192
[ 52, 'QPixmapCache' ],
193
[ 62, 'QTableSelection' ],
194
[ 69, 'QStyleSheet' ],
195
[ 75, 'QListBoxPixmap' ],
196
[ 81, 'QDataBrowser' ],
198
[ 94, 'QPushButton' ],