xref: /aoo42x/main/soltools/testSHL/testshl.cxx (revision 7a4715d3)
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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_soltools.hxx"
26 
27 #include <stdio.h>
28 
29 #ifndef _SOLTOOLS_TESTSHL_TLOG_HXX_
30 #include "inc/tlog.hxx"
31 #endif
32 
33 #ifndef _SOLTOOLS_TESTSHL_TSTMGR_HXX_
34 #include "inc/tstMgr.hxx"
35 #endif
36 
37 using namespace tstutl;
38 
39 void usage();
40 void test_shl( vector< sal_Char* > cmdln, sal_Bool boom );
41 
42 #if (defined UNX) || (defined OS2)
main(int argc,char * argv[])43 int main( int argc, char* argv[] )
44 #else
45 int _cdecl main( int argc, char* argv[] )
46 #endif
47 {
48     if ( argc < 3 ) {
49         usage();
50     }
51     sal_Bool boom = sal_False;
52     vector< sal_Char* > cmdln;
53 
54     sal_Int32 i;
55     for ( i = 1; i < argc; i++ ) {
56         sal_Char* ptr = argv[i];
57         if ( ptr[0] == '-' ) {
58             boom = sal_True;
59         }
60         else  {
61             cmdln.push_back( ptr );
62         }
63     }
64     if ( cmdln.size() < 3 ) {
65         cmdln.push_back( 0 );
66     }
67     if ( ! cmdln[0] || ! cmdln[1] ) {
68 		usage();
69 	}
70 
71     test_shl( cmdln, boom );
72 
73 	return(0);
74 }
75 
test_shl(vector<sal_Char * > cmdln,sal_Bool boom)76 void test_shl( vector< sal_Char*> cmdln, sal_Bool boom ) {
77 
78     tstMgr tst;
79 
80     if ( tst.initialize( cmdln[0], boom )) {
81         tst.test_EntriesFromFile( cmdln[1], cmdln[2] );
82     }
83 	else {
84         sal_Char* msg = "could not find module\n";
85         fprintf( stdout, "%s\n", msg );
86 	}
87 }
88 
usage()89 void usage(){
90     fprintf( stdout,
91             "USAGE: testSHL shlname scename [logname] [-boom]\n" );
92     exit(0);
93 }
94 
95