~matthias-leich/randgen/rqg-exp

« back to all changes in this revision

Viewing changes to unit/TestScripts.pm

  • Committer: Philip Stoev
  • Date: 2009-10-22 09:07:16 UTC
  • mfrom: (60.1.6 randgen)
  • Revision ID: pstoev@mysql.com-20091022090716-e4zs82sicmaotruh
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Do a simple run of scripts to see that they're sound
 
2
#
 
3
package TestScripts;
 
4
use base qw(Test::Unit::TestCase);
 
5
use lib 'lib';
 
6
 
 
7
sub new {
 
8
    my $self = shift()->SUPER::new(@_);
 
9
    # your state for fixture here
 
10
    return $self;
 
11
}
 
12
 
 
13
my $generator;
 
14
sub set_up {
 
15
}
 
16
 
 
17
sub tear_down {
 
18
    # clean up after test
 
19
}
 
20
 
 
21
sub test_gensql {
 
22
    my $self = shift;
 
23
 
 
24
    my $status = system("perl gensql.pl --grammar=conf/example.yy --dsn=dummy --queries=1");
 
25
 
 
26
    $self->assert_equals(0, $status);
 
27
}
 
28
 
 
29
sub test_gendata {
 
30
    my $self = shift;
 
31
 
 
32
    my $status = system("perl gendata.pl --config=conf/example.zz --dsn=dummy");
 
33
 
 
34
    $self->assert_equals(0, $status);
 
35
}
 
36
 
 
37
sub test_gendata_old {
 
38
    my $self = shift;
 
39
 
 
40
    my $status = system("perl gendata-old.pl --dsn=dummy");
 
41
 
 
42
    $self->assert_equals(0, $status);
 
43
}
 
44
 
 
45
sub test_gentest {
 
46
    my $self = shift;
 
47
 
 
48
    my $status = system("perl gentest.pl --dsn=dummy --grammar=conf/example.yy --threads=1 --queries=1");
 
49
 
 
50
    $self->assert_equals(0, $status);
 
51
}
 
52
 
 
53
 
 
54
1;