8 print "thanks, you gave me $numArgs command-line arguments.\n";
10 foreach $argnum (0 .. $#ARGV) {
11 print "$ARGV[$argnum]\n";
15 my $binDir = abs_path
( dirname
($0) );
20 my $officepath = shift || die "please specify path to office installation program dir";
21 my $DocName = shift || "";
22 my $programpath = "$officepath"."3/program:$officepath/program:";
23 my $basiclibrarypath = "$officepath/basis3.2/program";
24 my $urelibpath = "$officepath/ure/lib";
26 my $testDocDir = "$binDir/TestDocuments";
27 my $testLogDir = "$binDir/Logs";
28 my $testclientname = "testclient";
29 my $buildtestclient = "../../../../unxlngi6.pro/bin/$testclientname";
32 if ( -e
"$buildtestclient" )
34 print "use the latest build\n";
35 system( "cp $buildtestclient ." );
37 elsif ( !( -e
"$testclientname" ) )
39 print "$testclientname do not exist\n";
45 $exit_value = $?
>> 8;
46 $signal_num = $?
& 127;
47 $dumped_core = $?
& 128;
49 $failed = ( $exit_value || $signal_num || $dumped_core );
51 print "$failed = ( $exit_value || $signal_num || $dumped_core )\n";
53 if ( !$failed && open(UNAME
, "uname -a|") ) {
56 if ( $theResult =~ /^CYGWIN/ ) {
57 # windows under cygwin
59 $tmpPath=$ENV{"PATH"};
60 $ENV{"PATH"} = "$officepath:$tmpPath";
61 $testDocDir=`cygpath -m $testDocDir`;
62 uri_escape
($testDocDir);
63 # hacky windows url construction
64 $testDocDir="file:///$testDocDir";
67 #print "*** doc dir is $testDocDir\n";
68 $testLogDir = `cygpath -m "$testLogDir"`;
69 uri_escape
($testLogDir);
70 $testLogDir="file:///$testLogDir";
72 #print "*** log dir is $testLogDir\n";
76 # unix we need to find sal etc. ( from the office path )
77 my $tmpPath=$ENV{"PATH"};
78 $ENV{"PATH"} = "$programpath:$basiclibrarypath:$urelibpath/../bin:$tmpPath";
79 $tmpPATH = $ENV{"LD_LIBRARY_PATH"};
80 $ENV{"LD_LIBRARY_PATH"} = "$officepath:$programpath:$basiclibrarypath:$urelibpath:$urelibpath../bin/javaldx:$urelibpath/../bin:$tmpPATH";
81 $ENV{"LD_LIBRARY_PATH"} = "$officepath:$programpath:$basiclibrarypath:$urelibpath:$tmpPATH";
82 my $testPath = $ENV{"LD_LIBRARY_PATH"};
84 $testPath = $ENV{"PATH"};
86 $ENV{"STAR_RESOURCEPATH"} = "$officepath/basis3.0/program/resource";
87 $ENV{"SAL_ALLOW_LINKOO_SYMLINKS"} = "1";
88 $testPath = $ENV{"LANG"};
94 # ordinary windows, not sure if this will actually work
96 $tmpPath=$ENV{"PATH"};
97 $ENV{"PATH"} = "$tmpPath;$officepath";
101 # the exe needs system paths or urls ( urls are by far the least troublesome )
106 if ( "$DocName" eq "" )
108 $runCmd = "$binDir/testclient$binext $testDocDir $testLogDir";
109 $analyseCmd = "perl $binDir/testResults.pl $binDir/Logs $binDir/TestDocuments/logs/$sysDir";
113 $runCmd = "$binDir/testclient$binext $testDocDir $testLogDir $testDocDir/$DocName";
114 $analyseCmd = "perl $binDir/testResult.pl $binDir/Logs $binDir/TestDocuments/logs/$sysDir $DocName";
116 print "runCmd = $runCmd\n";
118 system ("rm -rf $testLogDir/*");
119 my $status = system( $runCmd );
120 print "analyseCmd = $analyseCmd\n";
121 $status = system( $analyseCmd );