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