summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorJörg Barfurth <jb@openoffice.org>2001-06-20 14:03:39 +0000
committerJörg Barfurth <jb@openoffice.org>2001-06-20 14:03:39 +0000
commit97cc20160abce0d5f60e15fbba4ad50016c2d222 (patch)
tree8d1c308abef7ca8b40c1d711777c7c51da3a85e5 /configmgr
parent25ca4148e9e43c19298ba2cea2c131342229ec5e (diff)
Improved test harness; added parameters; separated module selection
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/workben/memory/makefile.mk19
-rw-r--r--configmgr/workben/memory/memorytests.cxx131
-rw-r--r--configmgr/workben/memory/testmodules.cxx115
-rw-r--r--configmgr/workben/memory/testmodules.hxx72
4 files changed, 253 insertions, 84 deletions
diff --git a/configmgr/workben/memory/makefile.mk b/configmgr/workben/memory/makefile.mk
index 270865b32829..e02a02922942 100644
--- a/configmgr/workben/memory/makefile.mk
+++ b/configmgr/workben/memory/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: lla $ $Date: 2001-06-15 08:29:44 $
+# last change: $Author: jb $ $Date: 2001-06-20 15:03:39 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -83,10 +83,10 @@ CDEFS += -DDLL_VERSION=\"$(UPD)$(DLLPOSTFIX)\"
# ... common for all test executables ..............................
APPSTDLIBS=\
$(SALLIB) \
- $(VOSLIB) \
+ $(VOSLIB) \
$(CPPULIB) \
+ $(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
- $(CPPUHELPERLIB)
# ... cfgapi ..............................
# APP1STDLIBS = $(APPSTDLIBS)
@@ -108,10 +108,10 @@ APPSTDLIBS=\
# ... cfgapi ..............................
APP2STDLIBS = $(APPSTDLIBS)
-APP2STDLIBS+=$(STDLIBCPP)
+APP2STDLIBS+= $(STDLIBCPP)
.IF "$(GUI)"=="WNT"
-APP2STDLIBS+=$(LIBCIMT)
+APP2STDLIBS+= $(LIBCIMT)
.ENDIF
# CFLAGS+=-DWITHOUTAPI
@@ -119,6 +119,7 @@ APP2STDLIBS+=$(LIBCIMT)
APP2TARGET= $(TARGET2)
APP2OBJS= \
$(SLO)$/memorytests.obj \
+ $(SLO)$/testmodules.obj \
$(SLO)$/treeload.obj \
$(SLO)$/accessimpl.obj \
$(SLO)$/adminproviderimpl.obj \
@@ -175,7 +176,6 @@ APP2OBJS= \
$(SLO)$/localizedtreeactions.obj \
$(SLO)$/localsession.obj \
$(SLO)$/matchlocale.obj \
- $(SLO)$/memory.obj \
$(SLO)$/mergechange.obj \
$(SLO)$/namehelper.obj \
$(SLO)$/nodechange.obj \
@@ -236,7 +236,10 @@ APP2OBJS= \
$(SLO)$/writesubtreeasbinaryhandler.obj \
$(SLO)$/xmlformater.obj \
$(SLO)$/xmltreebuilder.obj \
- $(SLO)$/anypair.obj \
+ $(SLO)$/valuemembernode.obj \
+
+# $(SLO)$/memory.obj \
+# $(SLO)$/anypair.obj \
# $(SLO)$/strimpl.obj \
diff --git a/configmgr/workben/memory/memorytests.cxx b/configmgr/workben/memory/memorytests.cxx
index 24e9bf96a6ed..508031806b3e 100644
--- a/configmgr/workben/memory/memorytests.cxx
+++ b/configmgr/workben/memory/memorytests.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: memorytests.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: lla $ $Date: 2001-06-15 08:29:44 $
+ * last change: $Author: jb $ $Date: 2001-06-20 15:03:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -136,13 +136,10 @@
#include "typeconverter.hxx"
-#include "memory.hxx"
+#include "testmodules.hxx"
#include "valuenode.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
namespace configmgr
{
@@ -329,7 +326,6 @@ static const sal_Char* s_pPassword = "";
#endif
static bool m_bChange = false;
-
// -----------------------------------------------------------------------------
static void loadDefaults()
{
@@ -624,7 +620,7 @@ int main( int argc, char * argv[] )
{
loadDefaults();
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
+ OUString const sServiceRegistry = OUString::createFromAscii( "applicat.rdb" );
Reference< XMultiServiceFactory > xORB;
try
{
@@ -662,47 +658,8 @@ int main( int argc, char * argv[] )
MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierung weil beim ersten mal falsch!" );
- // delete [] pMem;
- // showMemoryStatistic();
-
- // standard office start.
-// test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Common/Start"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Common"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Setup/CJK/Enable"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Setup/Office/Modules"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Inet"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Views"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Setup/Product"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.ucb.Configuration"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.ucb.Store/ContentProperties"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.TypeDetection"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Writer"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.WriterWeb"));
- test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Linguistic"));
-
- goto halt;
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Common"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Linguistic"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.TypeDetection"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Setup"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.UserProfile"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Inet"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Calc"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Chart"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.DataAccess"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Draw"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Impress"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Java"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Labels"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Math"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Views"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Writer"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.WriterWeb"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.ucb.Configuration"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.ucb.Hierarchy"));
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.ucb.Store"));
-
- halt:
+ for (char const * const * ppTestModule = configtest::s_aTestModules; *ppTestModule; ++ppTestModule)
+ test(xORB, sSharePath, sUserPath, OUString::createFromAscii(*ppTestModule));
MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig!" );
@@ -1093,7 +1050,7 @@ int requestTest( int argc, char * argv[] )
{
loadDefaults();
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
+ OUString const sServiceRegistry = OUString::createFromAscii( "applicat.rdb" );
Reference< XMultiServiceFactory > xORB;
try
{
@@ -1126,33 +1083,14 @@ int requestTest( int argc, char * argv[] )
OTreeLoad aTreeLoad(xORB, sSharePath, sUserPath);
sal_Int32 nIdx = 0;
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.Common"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Setup/CJK/Enable"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Setup/Office/Modules"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Inet"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.Views"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Setup/Product"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.ucb.Configuration"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.ucb.Store/ContentProperties"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.TypeDetection"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.Writer"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.WriterWeb"));
- aTreeLoad.requestSubtree(ASCII("org.openoffice.Office.Linguistic"));
+
+ for (char const * const * ppRequestModule = configtest::s_aTestModules; *ppRequestModule; ++ppRequestModule)
+ aTreeLoad.requestSubtree( OUString::createFromAscii(*ppRequestModule));
MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "release subtrees" );
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.Common"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Setup/CJK/Enable"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Setup/Office/Modules"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Inet"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.Views"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Setup/Product"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.ucb.Configuration"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.ucb.Store/ContentProperties"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.TypeDetection"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.Writer"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.WriterWeb"));
- aTreeLoad.releaseSubtree(ASCII("org.openoffice.Office.Linguistic"));
+ for (char const * const * ppReleaseModule = configtest::s_aTestModules; *ppReleaseModule; ++ppReleaseModule)
+ aTreeLoad.releaseSubtree( OUString::createFromAscii(*ppReleaseModule));
MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig." );
LOG_MEMORYMEASURE( "FirstTest_of_memusage", "Values of memory access for standard filters.", aMemoryInfo );
@@ -1168,7 +1106,7 @@ int requestTest( int argc, char * argv[] )
int trust( int argc, char * argv[] )
{
- rtl::OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
+ rtl::OUString const sServiceRegistry = OUString::createFromAscii( "applicat.rdb" );
uno::Reference< lang::XMultiServiceFactory > xORB;
try
{
@@ -1222,21 +1160,62 @@ int trust( int argc, char * argv[] )
LOG_MEMORYMEASURE( "FirstTest_of_memusage", "Values of memory access for standard filters.", aMemoryInfo );
volatile int dummy = 0;
+ return 0;
}
} // namespace configmgr
+// -----------------------------------------------------------------------------
+void usage()
+{
+ cerr << "Wrong or missing parameters.\nUsage:\n"
+ "\tmemorytest (all | trust | request | api)+ [clear] [(+<module>|-<module>)+]\n";
+ exit(-1);
+}
// -----------------------------------------------------------------------------
// ------------------------------------ Main ------------------------------------
// -----------------------------------------------------------------------------
-
#if (defined UNX) || (defined OS2)
int main( int argc, char * argv[] )
#else
int _cdecl main( int argc, char * argv[] )
#endif
{
+ enum TestSelect { TEST_TRUST = 01, TEST_REQUEST = 02, TEST_API = 04, TEST_ALL = 07 };
+
+ unsigned nSelect = 0;
+ while (argc >= 1 && argv[1] != NULL)
+ {
+ if ( ::rtl_str_compareIgnoreAsciiCase(argv[1], "trust" ) ) nSelect |= TEST_TRUST;
+ else if ( ::rtl_str_compareIgnoreAsciiCase(argv[1], "request") ) nSelect |= TEST_REQUEST;
+ else if ( ::rtl_str_compareIgnoreAsciiCase(argv[1], "api" ) ) nSelect |= TEST_API;
+ else if ( ::rtl_str_compareIgnoreAsciiCase(argv[1], "all" ) ) nSelect |= TEST_ALL;
+ else break;
+
+ // here we found a known selector, so look on
+ ++argv;
+ --argc;
+ }
+
+ if (nSelect == 0) usage();
+
+//--------------------
+#define DO_TEST( test, func ) \
+ if (nSelect & TEST_##test) \
+ { \
+ char const * const test_name = #test; \
+ if (int nRet = func(argc, argv)) \
+ cerr << "Test: " << test_name << " returned with error code " << nRet << endl; \
+ else \
+ cerr << "Test: " << test_name << " finished without error !" ; \
+ } else // to allow a semicolon
+//--------------------
+
+ DO_TEST( TRUST , configmgr::trust );
+ DO_TEST( REQUEST , configmgr::requestTest );
+ DO_TEST( API , configmgr::main );
+
return configmgr::main(argc, argv); // API
// return configmgr::requestTest(argc, argv);
// return configmgr::trust(argc, argv);
diff --git a/configmgr/workben/memory/testmodules.cxx b/configmgr/workben/memory/testmodules.cxx
new file mode 100644
index 000000000000..d0ec76e0b19c
--- /dev/null
+++ b/configmgr/workben/memory/testmodules.cxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: testmodules.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jb $ $Date: 2001-06-20 15:03:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "testmodules.hxx"
+
+
+namespace configtest
+{
+ #if 0 // more modules
+ +"org.openoffice.Office.Common",
+ +"org.openoffice.Office.Linguistic",
+ x"org.openoffice.Office.TypeDetection",
+ x"org.openoffice.Setup",
+ -"org.openoffice.UserProfile",
+ +"org.openoffice.Inet",
+ -"org.openoffice.Office.Calc",
+ -"org.openoffice.Office.Chart",
+ -"org.openoffice.Office.DataAccess",
+ -"org.openoffice.Office.Draw",
+ -"org.openoffice.Office.Impress",
+ -"org.openoffice.Office.Java",
+ -"org.openoffice.Office.Labels",
+ -"org.openoffice.Office.Math",
+ +"org.openoffice.Office.Views",
+ +"org.openoffice.Office.Writer",
+ +"org.openoffice.Office.WriterWeb",
+ +"org.openoffice.ucb.Configuration",
+ -"org.openoffice.ucb.Hierarchy",
+ x"org.openoffice.ucb.Store",
+ #endif
+
+ char const * const s_aTestModules[] =
+ {
+ "org.openoffice.Office.Common",
+ "org.openoffice.Setup/CJK/Enable",
+ "org.openoffice.Setup/Office/Modules",
+ "org.openoffice.Inet",
+ "org.openoffice.Office.Views",
+ "org.openoffice.Setup/Product",
+ "org.openoffice.ucb.Configuration",
+ "org.openoffice.ucb.Store/ContentProperties",
+ "org.openoffice.Office.TypeDetection",
+ "org.openoffice.Office.Writer",
+ "org.openoffice.Office.WriterWeb",
+ "org.openoffice.Office.Linguistic",
+ NULL // end marker
+ };
+ unsigned int const s_nTestModules = sizeof s_aTestModules/sizeof 0[s_aTestModules];
+
+ std::vector<char const *> listTestModules(int argc, char* argv[])
+ {
+ std::vector<char const *> aModuleList( s_aTestModules, s_aTestModules + s_nTestModules);
+ return aModuleList;
+ }
+}
+
+
diff --git a/configmgr/workben/memory/testmodules.hxx b/configmgr/workben/memory/testmodules.hxx
new file mode 100644
index 000000000000..2d36ad98fda2
--- /dev/null
+++ b/configmgr/workben/memory/testmodules.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: testmodules.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jb $ $Date: 2001-06-20 15:03:39 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef CONFIGMGR_WORKBEN_TESTMODULES_
+#include <vector>
+
+namespace configtest
+{
+ extern char const * const s_aTestModules[];
+ extern unsigned int const s_nTestModules;
+ extern std::vector<char const *> listTestModules(int argc, char* argv[]);
+}
+#endif // CONFIGMGR_WORKBEN_TESTMODULES_
+