1
# Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; version 2 of the License.
7
# This program is distributed in the hope that it will be useful, but
8
# WITHOUT ANY WARRANTY; without even the implied warranty of
9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
# General Public License for more details.
12
# You should have received a copy of the GNU General Public License
13
# along with this program; if not, write to the Free Software
14
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
17
# Do a simple run of scripts to see that they're sound
20
use base qw(Test::Unit::TestCase);
26
my $self = shift()->SUPER::new(@_);
27
# your state for fixture here
37
unlink "unit/test1.xml";
38
unlink "unit/test2.xml";
39
unlink "unit/foo1.log";
40
unlink "unit/foo2.log";
41
system("rm -r unit/example*");
45
my $portbase = $ENV{TEST_PORTBASE}>0?int($ENV{TEST_PORTBASE}):22120;
46
my $pb = int(($portbase - 10000) / 10);
48
## This test requires RQG_MYSQL_BASE to point to a in source Mysql database
49
if ($ENV{RQG_MYSQL_BASE}) {
50
$ENV{LD_LIBRARY_PATH}=join(":",map{"$ENV{RQG_MYSQL_BASE}".$_}("/libmysql/.libs","/libmysql","/lib/mysql"));
51
my $status = system("perl -MCarp=verbose ./runall.pl --mtr-build-thread=$pb --grammar=conf/examples/example.yy --gendata=conf/examples/example.zz --queries=3 --threads=3 --report-xml-tt --report-xml-tt-type=none --xml-output=unit/test1.xml --logfile=unit/foo1.log --report-tt-logdir=unit --basedir=".$ENV{RQG_MYSQL_BASE});
52
$self->assert_equals(0, $status);
56
sub test_xml_runall_new {
58
## This test requires RQG_MYSQL_BASE to point to a Mysql database (in source, out of source or installed)
59
my $portbase = 10 + ($ENV{TEST_PORTBASE}>0?int($ENV{TEST_PORTBASE}):22120);
60
my $pb = int(($portbase - 10000) / 10);
63
if ($ENV{RQG_MYSQL_BASE}) {
64
$ENV{LD_LIBRARY_PATH}=join(":",map{"$ENV{RQG_MYSQL_BASE}".$_}("/libmysql/.libs","/libmysql","/lib/mysql"));
65
my $status = system("perl -MCarp=verbose ./runall-new.pl --mtr-build-thread=$pb --grammar=conf/examples/example.yy --gendata=conf/examples/example.zz --queries=3 --threads=3 --report-xml-tt --report-xml-tt-type=none --xml-output=unit/test2.xml --logfile=unit/foo2.log --report-tt-logdir=unit --basedir=".$ENV{RQG_MYSQL_BASE}." --vardir=".cwd()."/unit/tmp");
66
$self->assert_equals(0, $status);