xref: /aoo41x/main/sc/source/ui/vba/testvba/launchTest.pl (revision 7e90fac2)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24use File::Basename;
25
26my $test_class = shift || die 'must provide a ext name';
27my $TESTDOCUMENT = shift || die 'must provide a path to testdocument dirs';
28my $OUTPUTDIR = shift || die 'must provide an output path to deposit logs in';
29
30die "can't access TestClass $test_class/TestVBA.class" unless -f "$test_class/TestVBA.class";
31die "can't access officepath env variable \$OFFICEPATH" unless -d $ENV{OFFICEPATH};
32die "can't access testdocuments" unless -d $TESTDOCUMENT;
33die "testdocument not of the correct structure $TESTDOCUMENT/logs/excel" unless -d "$TESTDOCUMENT/logs/excel";
34die "can't access output dir" unless -d $OUTPUTDIR;
35
36
37my $officeclasspath = "$ENV{OFFICEPATH}/program/classes/";
38my $classpath = "$officeclasspath/jurt.jar:$officeclasspath/unoil.jar:$officeclasspath/juh.jar:$officeclasspath/java_uno.jar:$officeclasspath/ridl.jar:$test_class:$ENV{CLASSPATH}";
39$ENV{CLASSPATH}=$classpath;
40print "classpath $ENV{CLASSPATH}\n";
41my $status = system("java -classpath $ENV{CLASSPATH} TestVBA $TESTDOCUMENT $OUTPUTDIR" );
42