summaryrefslogtreecommitdiff
path: root/editors/openoffice.org-vcltesttool/files/ooovcltest.pl
blob: 69214590762c925be164523916b0ffe0faecda08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/perl
# Copyright 2009 by NAKATA Maho <maho@FreeBSD.org> <maho@openoffice.org>
# All rights reserved.
use Cwd;
use File::HomeDir; #devel/p5-File-HomeDir, libfile-homedir-perl

sub parse_option {
        while ($_ = shift) {
                if (substr($_, 0, 1) eq '-') {
                        if ($_ eq '-help') {
                                print "ooovcltest [-tag tag]\n";
                                exit;
                        } elsif ($_ eq '-tag') {
				$ooo_tag_flag=1;
                                $ooo_tag = shift;
                        } else {
                                die "Invalid option: \"$_\"\n";
                        }
                }
        }
}

#main
$ooo_tag_flag=0;
parse_option(@ARGV);
split('_',$ooo_tag);
$ooo_codeline=@_[0];
$ooo_milestone=@_[1];
$ooo_milestone=~ s/m//; 

####
### Customize according your needs
$path_to_testttol = "/usr/local/openoffice.org-vcltesttool/program";
$path_to_ooo = "/usr/local/openoffice.org-$ooo_tag/openoffice.org3/program";
#for other environments
#$path_to_testttol = "/opt/openoffice-vcltesttool/testtool.bin";
#$path_to_ooo = "/usr/lib/openoffice/program";
####

$ooo_testautomation_archive_name="OOo_" . "$ooo_tag" . "_testautomation.tar.bz2" ;
$ooo_testautomation_site="http://ooopackages.good-day.net/pub/OpenOffice.org/qa/testautomation/";

if (!$ooo_tag_flag) {die "please speficy OOo tag\n";}
print "testing tag: $ooo_tag at ";
system("date\n");
print "downloading testautomation environment....\n";
system ("wget $ooo_testautomation_site" . "$ooo_testautomation_archive_name" . "\n");
print "done\n";

print "Downloading category list for scripts at $ooo_tag \n";

$uri="index.php\?option=com_quaste\&task=tests_overview\&workspace=" . "$ooo_codeline" . "\&milestone=" . "m$ooo_milestone";
$caturi="http://quaste.services.openoffice.org/" . $uri . "\&download=1";
$catlist=$ooo_codeline . "_m$ooo_milestone" . ".txt" ;
system ("wget -O $catlist \"$caturi\"\n");

print "Downloading hid list for scripts at $ooo_tag \n";
$hiduri="http://quaste.services.openoffice.org/" . $uri . "\&download=2";
$hidlist="hid.lst";
system ("wget -O $hidlist \"$hiduri\"\n");
print "Download done...\n";

print "extracting testautomation environment....\n";
system ("tar xfj $ooo_testautomation_archive_name\n");
print "done\n";

#download is done....

###########
#settings...
#copying hid.lst and test list 
system ("cp hid.lst $ooo_tag/testautomation/global/hid\n");
system ("grep bas $catlist >  $ooo_tag/testautomation/tools/run_tests/$catlist\n");

#settings of run_test.sh
$location=getcwd() . "/$ooo_tag/testautomation/" ;
system ("mkdir $location/errorlogs\n");
$location=~ s/\//\\\//g;
$path_to_testttol =~ s/\//\\\//g;
system ("sed -i.bak 's/sLocation=\"\"/sLocation=\"$location\"/\' $ooo_tag/testautomation/tools/run_tests/run_tests.sh\n");
system ("sed -i.bak 's/sTestTool=\"\"/sTestTool=\"$path_to_testttol\\/testtool\"/' $ooo_tag/testautomation/tools/run_tests/run_tests.sh\n");

#adjust ~/.testtoolrc
$HOME = File::HomeDir->my_home;
$location=getcwd() . "/$ooo_tag/testautomation" ;

$testtoolrc="$HOME/.testtoolrc";
open (TESTTOOLRC,">$testtoolrc") || die "Can't open file $testtoolrc !\n";
print TESTTOOLRC "[Misc]\n";
print TESTTOOLRC "CurrentProfile=_profile_Default\n";
print TESTTOOLRC "ServerTimeout=4500\n";
print TESTTOOLRC "[OOoProgramDir]\n";
print TESTTOOLRC "Type=$path_to_ooo/\n";
print TESTTOOLRC "Current=$path_to_ooo\n";
print TESTTOOLRC "All=.\n";
print TESTTOOLRC "\n";
print TESTTOOLRC "[Crashreporter]\n";
print TESTTOOLRC "UseProxy=false\n";
print TESTTOOLRC "ProxyServer=none\n";
print TESTTOOLRC "ProxyPort=8080\n";
print TESTTOOLRC "AllowContact=false\n";
print TESTTOOLRC "ReturnAddress=\n";
print TESTTOOLRC "\n";
print TESTTOOLRC "[_profile_Default]\n";
print TESTTOOLRC "BaseDir=$location/\n";
print TESTTOOLRC "LogBaseDir=$location/errorlogs/\n";
print TESTTOOLRC "HIDDir=$location/global/hid\n";
print TESTTOOLRC "StopOnSyntaxError=0\n";
print TESTTOOLRC "AutoReload=0\n";
print TESTTOOLRC "AutoSave=0\n";
print TESTTOOLRC "[GUI Platform]\n";
print TESTTOOLRC "Current=08\n";
print TESTTOOLRC "\n";
print TESTTOOLRC "[Communication]\n";
print TESTTOOLRC "Host=localhost\n";
print TESTTOOLRC "TTPort=12479\n";
print TESTTOOLRC "UnoPort=12480\n";
print TESTTOOLRC "\n";
print TESTTOOLRC "[WinGeom]\n";
print TESTTOOLRC "WinParams=180,74,920,875;1;0,0,0,0;\n";
print TESTTOOLRC "\n";
print TESTTOOLRC "[LRU]\n";
print TESTTOOLRC "MaxLRU=4\n";

close(TESTTOOLRC);

###########
#checking hid.lst (generated and QUASTe)
system ("cat $path_to_ooo/../../hid.lst | sort > hid.lst.genrated\n");
system ("sed 's/\r//' hid.lst | sort > hid.lst.quaste\n");
system ("diff -u hid.lst.genrated hid.lst.quaste > hid.lst.diff\n");
system ("cat hid.lst.diff\n");