xref: /trunk/main/soltools/testSHL/testshl.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_soltools.hxx"
30 
31 #include <stdio.h>
32 
33 #ifndef _SOLTOOLS_TESTSHL_TLOG_HXX_
34 #include "inc/tlog.hxx"
35 #endif
36 
37 #ifndef _SOLTOOLS_TESTSHL_TSTMGR_HXX_
38 #include "inc/tstMgr.hxx"
39 #endif
40 
41 using namespace tstutl;
42 
43 void usage();
44 void test_shl( vector< sal_Char* > cmdln, sal_Bool boom );
45 
46 #if (defined UNX) || (defined OS2)
47 int main( int argc, char* argv[] )
48 #else
49 int _cdecl main( int argc, char* argv[] )
50 #endif
51 {
52     if ( argc < 3 ) {
53         usage();
54     }
55     sal_Bool boom = sal_False;
56     vector< sal_Char* > cmdln;
57 
58     sal_Int32 i;
59     for ( i = 1; i < argc; i++ ) {
60         sal_Char* ptr = argv[i];
61         if ( ptr[0] == '-' ) {
62             boom = sal_True;
63         }
64         else  {
65             cmdln.push_back( ptr );
66         }
67     }
68     if ( cmdln.size() < 3 ) {
69         cmdln.push_back( 0 );
70     }
71     if ( ! cmdln[0] || ! cmdln[1] ) {
72 		usage();
73 	}
74 
75     test_shl( cmdln, boom );
76 
77 	return(0);
78 }
79 
80 void test_shl( vector< sal_Char*> cmdln, sal_Bool boom ) {
81 
82     tstMgr tst;
83 
84     if ( tst.initialize( cmdln[0], boom )) {
85         tst.test_EntriesFromFile( cmdln[1], cmdln[2] );
86     }
87 	else {
88         sal_Char* msg = "could not find module\n";
89         fprintf( stdout, "%s\n", msg );
90 	}
91 }
92 
93 void usage(){
94     fprintf( stdout,
95             "USAGE: testSHL shlname scename [logname] [-boom]\n" );
96     exit(0);
97 }
98 
99