summaryrefslogtreecommitdiff
path: root/testshl2
diff options
context:
space:
mode:
Diffstat (limited to 'testshl2')
-rw-r--r--testshl2/README8
-rw-r--r--testshl2/inc/makefile.mk47
-rw-r--r--testshl2/inc/pch/precompiled_testshl2.cxx29
-rw-r--r--testshl2/inc/pch/precompiled_testshl2.hxx32
-rw-r--r--testshl2/inc/testshl/additionalfunc.hxx61
-rw-r--r--testshl2/inc/testshl/autoregister/callbackstructure.h86
-rw-r--r--testshl2/inc/testshl/autoregister/htestresult.h6
-rw-r--r--testshl2/inc/testshl/autoregister/registerfunc.h47
-rw-r--r--testshl2/inc/testshl/autoregister/registertestfunction.h51
-rw-r--r--testshl2/inc/testshl/autoregister/testfunc.h44
-rw-r--r--testshl2/inc/testshl/autoregisterhelper.hxx62
-rw-r--r--testshl2/inc/testshl/checkboom.hxx37
-rw-r--r--testshl2/inc/testshl/cmdlinebits.hxx49
-rw-r--r--testshl2/inc/testshl/dynamicregister.hxx64
-rw-r--r--testshl2/inc/testshl/filehelper.hxx47
-rw-r--r--testshl2/inc/testshl/getopt.hxx332
-rw-r--r--testshl2/inc/testshl/joblist.hxx96
-rw-r--r--testshl2/inc/testshl/log.hxx113
-rw-r--r--testshl2/inc/testshl/nocopy.hxx13
-rw-r--r--testshl2/inc/testshl/result/SynchronizedObject.h82
-rw-r--r--testshl2/inc/testshl/result/TestListener.h62
-rw-r--r--testshl2/inc/testshl/result/TestResult.h123
-rw-r--r--testshl2/inc/testshl/result/TestResultCollector.h165
-rw-r--r--testshl2/inc/testshl/result/TestSucessListener.h40
-rw-r--r--testshl2/inc/testshl/result/TextTestResult.h62
-rw-r--r--testshl2/inc/testshl/result/callbackfunc.h25
-rw-r--r--testshl2/inc/testshl/result/emacsTestResult.hxx79
-rw-r--r--testshl2/inc/testshl/result/log.hxx103
-rw-r--r--testshl2/inc/testshl/result/optionhelper.hxx95
-rw-r--r--testshl2/inc/testshl/result/outputter.hxx82
-rw-r--r--testshl2/inc/testshl/result/testshlTestResult.h72
-rw-r--r--testshl2/inc/testshl/signaltest.h62
-rw-r--r--testshl2/inc/testshl/simpleheader.hxx43
-rw-r--r--testshl2/inc/testshl/stringhelper.hxx39
-rw-r--r--testshl2/inc/testshl/taghelper.hxx88
-rw-r--r--testshl2/inc/testshl/tresstatewrapper.h63
-rw-r--r--testshl2/inc/testshl/tresstatewrapper.hxx57
-rw-r--r--testshl2/inc/testshl/versionhelper.hxx84
-rw-r--r--testshl2/inc/testshl/winstuff.hxx40
-rw-r--r--testshl2/prj/build.lst9
-rw-r--r--testshl2/prj/d.lst29
-rw-r--r--testshl2/source/autoregisterhelper.cxx140
-rw-r--r--testshl2/source/codegen/codegen.pl601
-rw-r--r--testshl2/source/cppunit/cmdlinebits.cxx141
-rw-r--r--testshl2/source/cppunit/joblist.cxx221
-rw-r--r--testshl2/source/cppunit/makefile.mk99
-rw-r--r--testshl2/source/cppunit/registertestfunction.cxx57
-rw-r--r--testshl2/source/cppunit/result/SynchronizedObject.cpp38
-rw-r--r--testshl2/source/cppunit/result/TestResult.cpp264
-rw-r--r--testshl2/source/cppunit/result/TestResultCollector.cpp150
-rw-r--r--testshl2/source/cppunit/result/TestSucessListener.cpp50
-rw-r--r--testshl2/source/cppunit/result/TextTestResult.cpp194
-rw-r--r--testshl2/source/cppunit/result/emacsTestResult.cxx190
-rw-r--r--testshl2/source/cppunit/result/log.cxx122
-rw-r--r--testshl2/source/cppunit/result/makefile.mk79
-rw-r--r--testshl2/source/cppunit/result/optionhelper.cxx314
-rw-r--r--testshl2/source/cppunit/result/outputter.cxx103
-rw-r--r--testshl2/source/cppunit/result/signal.cxx996
-rw-r--r--testshl2/source/cppunit/result/signal.hxx39
-rw-r--r--testshl2/source/cppunit/result/testshlTestResult.cxx425
-rw-r--r--testshl2/source/cppunit/result/treswrapper.cxx259
-rw-r--r--testshl2/source/cppunit/signaltest.cxx89
-rw-r--r--testshl2/source/cppunit/t_print.cxx95
-rw-r--r--testshl2/source/cppunit/tresregister.cxx66
-rw-r--r--testshl2/source/cppunit/tresstatewrapper.cxx166
-rw-r--r--testshl2/source/cppunit/win32/makefile.mk60
-rw-r--r--testshl2/source/cppunit/win32/winstuff.cxx140
-rw-r--r--testshl2/source/dynamicregister.cxx207
-rw-r--r--testshl2/source/file.cxx74
-rw-r--r--testshl2/source/filehelper.cxx228
-rw-r--r--testshl2/source/getopt.cxx919
-rw-r--r--testshl2/source/makefile.mk130
-rw-r--r--testshl2/source/terminate.cxx289
-rw-r--r--testshl2/source/testshl.cxx396
-rw-r--r--testshl2/source/testshlrunner/ProcessHandler.java355
-rw-r--r--testshl2/source/testshlrunner/TestShl2Runner.java937
-rw-r--r--testshl2/source/testshlrunner/makefile.mk44
-rw-r--r--testshl2/source/versioner.cxx117
-rw-r--r--testshl2/source/versionhelper.cxx124
-rw-r--r--testshl2/util/makefile.mk38
-rw-r--r--testshl2/workben/codegen/README9
-rw-r--r--testshl2/workben/codegen/checkfile7
-rw-r--r--testshl2/workben/codegen/cleanup10
-rw-r--r--testshl2/workben/codegen/makefile.mk45
-rw-r--r--testshl2/workben/codegen/selftest49
-rw-r--r--testshl2/workben/codegen/test.job17
-rw-r--r--testshl2/workben/codegen/w32/checkfile.btm7
-rw-r--r--testshl2/workben/codegen/w32/cleanup.btm9
-rw-r--r--testshl2/workben/codegen/w32/makefile.mk45
-rw-r--r--testshl2/workben/codegen/w32/selftest.btm47
-rw-r--r--testshl2/workben/codegen/w32/test.job17
-rw-r--r--testshl2/workben/dlltest/export.exp1
-rw-r--r--testshl2/workben/dlltest/makefile.mk126
-rw-r--r--testshl2/workben/dlltest/onefunc.cxx51
-rw-r--r--testshl2/workben/dlltest/onefuncstarter.cxx140
-rw-r--r--testshl2/workben/dlltest/registerfunc.h41
-rw-r--r--testshl2/workben/examples/makefile.mk64
-rw-r--r--testshl2/workben/examples/testshl_test.cxx286
-rw-r--r--testshl2/workben/garbage_dump/float.cxx137
-rw-r--r--testshl2/workben/garbage_dump/nippondir.cxx316
-rw-r--r--testshl2/workben/garbage_dump/some_tips.cxx126
-rw-r--r--testshl2/workben/getopt/makefile.mk60
-rw-r--r--testshl2/workben/getopt/test_getopt.cxx140
-rw-r--r--testshl2/workben/makefile.mk126
-rw-r--r--testshl2/workben/runner/unxlngi4.config.file34
-rw-r--r--testshl2/workben/runner/unxsols3.config.file34
-rw-r--r--testshl2/workben/runner/wntmsci9.config.file46
-rw-r--r--testshl2/workben/selftest/README.txt30
-rw-r--r--testshl2/workben/selftest/delivertest.cxx61
-rw-r--r--testshl2/workben/selftest/export.map8
-rw-r--r--testshl2/workben/selftest/makefile.mk87
-rw-r--r--testshl2/workben/selftest/notdeliveredtest.cxx61
-rw-r--r--testshl2/workben/singleton.cxx49
-rw-r--r--testshl2/workben/skeleton/export.map7
-rw-r--r--testshl2/workben/skeleton/makefile.mk51
-rw-r--r--testshl2/workben/skeleton/skeleton.cxx79
-rw-r--r--testshl2/workben/test_autoptr.cxx100
-rw-r--r--testshl2/workben/test_filter.cxx230
-rw-r--r--testshl2/workben/test_member.cxx97
-rw-r--r--testshl2/workben/test_ostringstream.cxx116
-rw-r--r--testshl2/workben/test_preproc.cxx55
-rw-r--r--testshl2/workben/test_printf.cxx60
-rw-r--r--testshl2/workben/test_string.cxx138
-rw-r--r--testshl2/workben/uno/export.exp1
-rwxr-xr-xtestshl2/workben/uno/export.map8
-rw-r--r--testshl2/workben/uno/makefile.mk79
-rw-r--r--testshl2/workben/uno/unotest.cxx114
127 files changed, 0 insertions, 15105 deletions
diff --git a/testshl2/README b/testshl2/README
deleted file mode 100644
index 03e7475a1d6e..000000000000
--- a/testshl2/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This is the second version of the testshl.
-
-Upper-lower case filenames.
-- I prever lower case filenames. Due to the fact that the cppunit
- code uses mixed upper and lower case I leave the original filenames
- unchanged.
-
-
diff --git a/testshl2/inc/makefile.mk b/testshl2/inc/makefile.mk
deleted file mode 100644
index cbed35c5cbb3..000000000000
--- a/testshl2/inc/makefile.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=testshl2
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
-
diff --git a/testshl2/inc/pch/precompiled_testshl2.cxx b/testshl2/inc/pch/precompiled_testshl2.cxx
deleted file mode 100644
index c30f5dd27e3e..000000000000
--- a/testshl2/inc/pch/precompiled_testshl2.cxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_testshl2.hxx"
-
diff --git a/testshl2/inc/pch/precompiled_testshl2.hxx b/testshl2/inc/pch/precompiled_testshl2.hxx
deleted file mode 100644
index 4de524c0c650..000000000000
--- a/testshl2/inc/pch/precompiled_testshl2.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:13.576513
-
-#ifdef PRECOMPILED_HEADERS
-#endif
-
diff --git a/testshl2/inc/testshl/additionalfunc.hxx b/testshl2/inc/testshl/additionalfunc.hxx
deleted file mode 100644
index 463d1ae87280..000000000000
--- a/testshl2/inc/testshl/additionalfunc.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef ADDITIONALFUNC_HXX
-#define ADDITIONALFUNC_HXX
-
-#include "testshl/autoregister/registertestfunction.h"
-#include "sal/types.h"
-
-extern "C" void SAL_CALL RegisterAdditionalFunctions(FktRegFuncPtr _pFunc);
-
-#define NOADDITIONAL \
-void RegisterAdditionalFunctions(FktRegFuncPtr){}
-
-namespace {
-
-enum T2_OSType {
- T2_OS_WNT32 = 1,
- T2_OS_UNIX,
- T2_OS_OS2
-};
-
-inline T2_OSType getOSType()
-{
-#if defined WNT
- return T2_OS_WNT32;
-#elif defined OS2
- return T2_OS_OS2;
-#else
- return T2_OS_UNIX;
-#endif
-}
-
-}
-
-#define TESTSHL2_UNO_BOOTSTRAP(file) \
-void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc) \
-{ \
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> xMS; \
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xComponentContext; \
- try { \
- if (strlen(#file) > 0) { \
- ::rtl::OUString iniFile(rtl::OUString::createFromAscii(#file)); \
- if (getOSType() == T2_OS_WNT32 || getOSType() == T2_OS_OS2) { \
- iniFile += ::rtl::OUString::createFromAscii(".ini"); \
- } else { \
- iniFile += ::rtl::OUString::createFromAscii("rc"); \
- } \
- xComponentContext = cppu::defaultBootstrap_InitialComponentContext(iniFile); \
- } else { \
- xComponentContext = cppu::defaultBootstrap_InitialComponentContext(); \
- } \
- xMS.set(xComponentContext->getServiceManager(), com::sun::star::uno::UNO_QUERY); \
- comphelper::setProcessServiceFactory(xMS); \
- } \
- catch (::com::sun::star::uno::Exception e ) { \
- rtl::OString aError; \
- aError = rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); \
- printf("Error at UNO bootstrap time caught: %s\nMust quit.\n", aError.getStr()); \
- exit(1); \
- } \
-}
-
-#endif
diff --git a/testshl2/inc/testshl/autoregister/callbackstructure.h b/testshl2/inc/testshl/autoregister/callbackstructure.h
deleted file mode 100644
index 2bddc43eb003..000000000000
--- a/testshl2/inc/testshl/autoregister/callbackstructure.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _callbackstructure_h
-#define _callbackstructure_h
-
-#include <sal/types.h>
-#include <cppunit/callbackfunc_fktptr.h>
-#include <testshl/autoregister/registerfunc.h>
-#include <testshl/autoregister/registertestfunction.h>
-#include <testshl/cmdlinebits.hxx>
-
-// this structure will filled by the testshl tool and hand to the testdll
-
-struct CallbackStructure
-{
- // a version number, if we want to change/expand this struct
- sal_Int32 nVersion;
- sal_Int64 nMagic;
-
- FktRegFuncPtr aRegisterFunction;
-
- FktPtr_CallbackDispatch aCallbackDispatch;
-
- //# FktPtr_TestResult_startTest aStartTest;
- //# FktPtr_TestResult_addFailure aAddFailure;
- //# FktPtr_TestResult_addError aAddError;
- //# FktPtr_TestResult_endTest aEndTest;
- //# FktPtr_TestResult_shouldStop aShouldStop;
- //#
- //# FktPtr_TestResult_addInfo aAddInfo;
- //# FktPtr_TestResult_enterNode aEnterNode;
- //# FktPtr_TestResult_leaveNode aLeaveNode;
-
- const char* psForward;
- CmdLineBits nBits;
-
- // void* pJobList;
-
- sal_Int64 nMagic2;
-
- CallbackStructure()
- :nVersion(1),
- nMagic(SAL_CONST_INT64(0x0123456789abcdef)),
- aRegisterFunction(NULL),
- aCallbackDispatch(NULL),
- /* aStartTest(NULL),
- aAddFailure(NULL),
- aAddError(NULL),
- aEndTest(NULL),
- aShouldStop(NULL),
- aAddInfo(NULL),
- aEnterNode(NULL),
- aLeaveNode(NULL), */
- psForward(NULL),
- nBits(0),
- /* pJobList(NULL), */
- nMagic2(0)
- {}
-};
-
-#endif
diff --git a/testshl2/inc/testshl/autoregister/htestresult.h b/testshl2/inc/testshl/autoregister/htestresult.h
deleted file mode 100644
index 46cfbc8b6808..000000000000
--- a/testshl2/inc/testshl/autoregister/htestresult.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _htestresult_h
-#define _htestresult_h
-
-typedef void* hTestResult;
-
-#endif
diff --git a/testshl2/inc/testshl/autoregister/registerfunc.h b/testshl2/inc/testshl/autoregister/registerfunc.h
deleted file mode 100644
index 7e3ee891c2ec..000000000000
--- a/testshl2/inc/testshl/autoregister/registerfunc.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _registerfunc_h
-#define _registerfunc_h
-
-#include <sal/types.h>
-#include <testshl/autoregister/htestresult.h>
-#include <cppunit/callbackfunc_fktptr.h>
-#include <testshl/autoregister/testfunc.h>
-
-struct CallbackStructure;
-
-// this function is used to register one function into a Container in the testshl tool.
-extern "C" void SAL_CALL registerFunction(FktPtr aFunc, const char* aFuncName);
-
-// this function is the register function for auto registering
-
-extern "C" void SAL_CALL registerAllTestFunction(CallbackStructure* );
-typedef void (* FktRegAllPtr)(CallbackStructure*);
-
-
-#endif
diff --git a/testshl2/inc/testshl/autoregister/registertestfunction.h b/testshl2/inc/testshl/autoregister/registertestfunction.h
deleted file mode 100644
index 0cab2815f85e..000000000000
--- a/testshl2/inc/testshl/autoregister/registertestfunction.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _registertestfunction_h
-#define _registertestfunction_h
-
-#include <sal/types.h>
-#include <testshl/autoregister/testfunc.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// function ptr, to register a function
-typedef void (* FktRegFuncPtr)(FktPtr aFunc, const char* aFuncName);
-
-// this function is used in the testdll to register the given function
-// into the testshl
-extern "C" void SAL_CALL RegisterTestFunctions(FktRegFuncPtr aFunc);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/testshl2/inc/testshl/autoregister/testfunc.h b/testshl2/inc/testshl/autoregister/testfunc.h
deleted file mode 100644
index 55b97de05e34..000000000000
--- a/testshl2/inc/testshl/autoregister/testfunc.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _testfunc_h
-#define _testfunc_h
-
-#include <testshl/autoregister/htestresult.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// typedef for a testfunction
-typedef void (* FktPtr)(hTestResult);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/testshl2/inc/testshl/autoregisterhelper.hxx b/testshl2/inc/testshl/autoregisterhelper.hxx
deleted file mode 100644
index 538133ade19d..000000000000
--- a/testshl2/inc/testshl/autoregisterhelper.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef AUTOREGISTER_HXX
-#define AUTOREGISTER_HXX
-
-#include <vector>
-#include <rtl/ustring.hxx>
-
-#include <testshl/autoregister/testfunc.h>
-
-#include "testshl/dynamicregister.hxx"
-#include "testshl/getopt.hxx"
-
-typedef std::vector<FktPtr> FunctionList;
-
-// -----------------------------------------------------------------------------
-class JobList;
-class AutomaticRegisterHelper : public DynamicLibraryHelper
-{
- FunctionList m_aFunctionList;
- bool m_bLoadLibraryOK;
- // GetOpt & m_aOptions; // use getOptions() instead!
-
-public:
- AutomaticRegisterHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions/* , JobList * _pJobList = NULL */ );
-
- // FunctionList getFunctions(){return m_aFunctionList;}
- void CallAll(hTestResult _hResult) const;
-
- /// @return true, if the given DLLName library could load and initialised.
- bool isOkToStartTests() const {return m_bLoadLibraryOK;}
-
- virtual ~AutomaticRegisterHelper();
-};
-
-#endif
-
diff --git a/testshl2/inc/testshl/checkboom.hxx b/testshl2/inc/testshl/checkboom.hxx
deleted file mode 100644
index 668ce603a429..000000000000
--- a/testshl2/inc/testshl/checkboom.hxx
+++ /dev/null
@@ -1,37 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CHECKBOOM_HXX
-#define CHECKBOOM_HXX
-
-#include <string>
-#include <rtl/ustring.hxx>
-
-void CheckBoom(bool bCondition, std::string const& msg);
-void CheckBoom(bool bCondition, rtl::OUString const& msg);
-
-#endif
diff --git a/testshl2/inc/testshl/cmdlinebits.hxx b/testshl2/inc/testshl/cmdlinebits.hxx
deleted file mode 100644
index 99c166f2fc83..000000000000
--- a/testshl2/inc/testshl/cmdlinebits.hxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CMDLINEBITS_HXX
-#define CMDLINEBITS_HXX
-
-#include <sal/types.h>
-
-typedef sal_uInt32 CmdLineBits;
-const char* getForwardString();
-
-#include <stdarg.h>
-
-enum T_Print_Params {
- T_INFO = 1,
- T_VERBOSE,
- T_DEBUG,
- T_ERROR
-};
-
-// void t_print(const char*);
-void t_print(const char*, ...);
-void t_print(T_Print_Params, const char*, ...);
-
-#endif
diff --git a/testshl2/inc/testshl/dynamicregister.hxx b/testshl2/inc/testshl/dynamicregister.hxx
deleted file mode 100644
index f29ad52e963f..000000000000
--- a/testshl2/inc/testshl/dynamicregister.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef DYNAMICREGISTER_HXX
-#define DYNAMICREGISTER_HXX
-
-#include <rtl/ustring.hxx>
-#include <osl/module.hxx>
-
-#include "testshl/getopt.hxx"
-#include "testshl/nocopy.hxx"
-
-// -------------------------------------------------
-
-class DynamicLibraryHelper : NOCOPY
-{
-protected:
- osl::Module* m_pModule;
- rtl::OUString m_suDLLName;
- GetOpt & m_aOptions;
-
- GetOpt& getOptions() {return m_aOptions;}
-
-public:
- DynamicLibraryHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions);
- virtual ~DynamicLibraryHelper();
-
-private:
- void showFilenameIfVerbose();
- void realLoadLibrary(rtl::OUString const& _sLibToLoad);
- void loadLibraryFromAbsolutePath();
- void loadLibraryFromLocalPath();
-
- rtl::OUString m_suAbsolutePathFile; // file:///D:/foo/bar/library.dll
- rtl::OUString m_suAbsolutePath; // file:///D:/foo/bar
- rtl::OUString m_suFilename; // library.dll
-};
-
-#endif
-
diff --git a/testshl2/inc/testshl/filehelper.hxx b/testshl2/inc/testshl/filehelper.hxx
deleted file mode 100644
index eefef077f4b5..000000000000
--- a/testshl2/inc/testshl/filehelper.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef FILEHELPER_HXX
-#define FILEHELPER_HXX
-
-#include <string>
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <testshl/cmdlinebits.hxx>
-#include "getopt.hxx"
-
-namespace FileHelper
-{
-
- std::string getTempPath();
- rtl::OUString convertPath( rtl::OUString const& _suSysPath );
- rtl::OUString convertPath( rtl::OString const& sysPth );
- CmdLineBits createFlags( GetOpt & _aOptions );
-
-}
-#endif
-
diff --git a/testshl2/inc/testshl/getopt.hxx b/testshl2/inc/testshl/getopt.hxx
deleted file mode 100644
index b4feaa7c535b..000000000000
--- a/testshl2/inc/testshl/getopt.hxx
+++ /dev/null
@@ -1,332 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/*************************************************************************
-#* class GetOpt
-#*
-#*
-#* Implementation getopt.cxx
-#*
-#* Description: class to reflect the commandline options. In addition
-#* it provides functinality to get options from an inifile
-#* ( getIniOptions()), evaluate, test and get options
-#* ( hasOpt(), getOpt() ) and display an usage screen
-#* formated in dependance of the given optionset, as well
-#* as display a status about activ options
-#*
-#*
-#* further descriptions:
-#*
-#* the constructor is called with two parameters:
-#* char* argv[] and char* optionSet[],
-#* the commandline and the available set of options.
-#* Valid optionstrings have to start with a minus '-', otherwise it will
-#* be ignored. Optionstrings consist of one or two arguments divided by a
-#* comma separator, where the second (optional) argument is a short
-#* description of the option, called hint. It will be automatically
-#* formated and displayed in the usage screen if available.
-#* The first argument of the optionstring can consist of two sections,
-#* the name and the optional necessity and format.
-#* The name of the option will be the starting minus followed by a string
-#* like "-src".
-#* One section options will be treated as flag (see '-v' option in example).
-#* The second section consist of '=' or ':' which defines the necessity,
-#* in combination with a character 's' for string or 'n' for numeric and
-#* an optional '@' standing for 'vector of'.
-#* '=' means this option needs an argument, ':' means can take an argument
-#* followed by 's' is, as mentioned above, a single string paramenter,
-#* followed by a 's' in combination with '@' means this argument consists
-#* of one string or a vector of strings separated by commas
-#*
-#* an example for an optionset:
-#*
-#* static char* optionSet[] = {
-#* "-src=s, release or version of sources",
-#* "-ini=s, ini file with additional options",
-#* "-db=s, path of type description database",
-#* "-inPth=s, source path of component descriptions",
-#* "-outPth=s, destination path for testcases",
-#* "-logPth=s, destination path for logging",
-#* "-mdl=s@, name(s) of module(s) to generate",
-#* "-v, enable verbose screen messages",
-#* "-dbg, enable debug messages",
-#* "-h:s, display help or help on option",
-#* "-help:s, see -h",
-#* NULL
-#* };
-#*
-#* As seen a GetOpt class object will be created via:
-#* GetOpt myOptions( argv, optionSet );
-#*
-*************************************************************************/
-#ifndef __QADEV_REGSCAN_GETOPT_HXX__
-#define __QADEV_REGSCAN_GETOPT_HXX__
-
-#include <osl/file.hxx>
-#include <sal/types.h>
-#include <rtl/strbuf.hxx>
-
-
-#include <rtl/string.hxx>
-
-// #ifndef __QADEV_REGSCAN_UTIL_HXX__
-// #include "inc/util.hxx"
-// #endif
-
-
-#ifdef SOLARIS
-#include <sys/time.h>
-#endif
-
-#include <iostream>
-#include <hash_map>
-// #include "rsexception.hxx"
-
-// using namespace std;
-
-struct gstr {
- sal_Bool operator()( const rtl::OString& oStr1,
- const rtl::OString& oStr2 ) const {
- return( oStr1 == oStr2 );
- }
-};
-
-struct ghstr
-{
- sal_uInt32 operator()( const rtl::OString& str ) const {
- return str.hashCode();
- }
-};
-
-struct frmt {
- sal_uInt32 fCol;
- sal_uInt32 sCol;
- sal_uInt32 len;
-};
-
-typedef std::hash_map< rtl::OString, std::vector< rtl::OString >, ghstr, gstr >
- optHashMap;
-
-typedef frmt sFormat;
-typedef sal_uInt16 optType;
-
-#define OT_INVALID 0x0000
-#define OT_BOOL 0x0001
-#define OT_STRING 0x0002
-#define OT_NUMBER 0x0004
-#define OT_SINGLE 0x0010
-#define OT_MULTI 0x0020
-#define OT_OPTIONAL 0x0100
-
-//: Option
-class OptDsc {
-
- rtl::OString m_name;
- rtl::OString m_hint;
- rtl::OString m_legend;
- optType m_type;
-
- /**
- * analysis of optionstring and creation of option description class
- * @param const rtl::OString& opt = optionstring to analyse
- * @return void
- */
- void createOptDsc( const rtl::OString& opt );
-
- /**
- * splitting of an optionstring and creation of a tokenvector
- * in dependance of a charset
- *
- * @param const rtl::OString& opt = optionstring to split
- * @param const rtl::OString& cSet = delimiter charset
- * @param vector< rtl::OString >& optLine = tokenvector to fill
- *
- * @return void
- */
- void split( const rtl::OString& opt, const rtl::OString& charSet,
- std::vector< rtl::OString >& optLine );
-
- /**
- * private default c'tor, copy c'tor and assignment operator
- * to get compiler errors on dumb effords
- */
- OptDsc();
- OptDsc( OptDsc& );
- OptDsc& operator = ( OptDsc& );
-
-public:
-
- //> c'tor
- OptDsc( const rtl::OString& opt )
- : m_name(),
- m_hint(),
- m_legend(),
- m_type( 0 ) {
-
- createOptDsc( opt );
- } ///< c'tor
-
- //> d'tor
- ~OptDsc(){}
-
- /**
- * returns the name of this option
- * @return rtl::OString&
- */
- inline rtl::OString& getName() { return m_name; }
- /**
- * returns the hint of this option
- * @return rtl::OString&
- */
- inline rtl::OString& getHint() { return m_hint; }
- /**
- * returns the legend of this option
- * @return rtl::OString&
- */
- inline rtl::OString& getLegend() { return m_legend; }
-
- /**
- * returns the type of this option
- * @return optType
- */
- inline optType getType() { return m_type; }
-
-
- inline sal_Bool isFlag() {
- return( ( m_type &~ 0xfffe ) == OT_BOOL ) ? sal_True : sal_False;
- }
- inline sal_Bool isString() {
- return( ( m_type &~ 0xfffd ) == OT_STRING ) ? sal_True : sal_False;
- }
- inline sal_Bool isNumber() {
- return( ( m_type &~ 0xfffb ) == OT_NUMBER ) ? sal_True : sal_False;
- }
- inline sal_Bool isSingle() {
- return( ( m_type &~ 0xffef ) == OT_SINGLE ) ? sal_True : sal_False;
- }
- inline sal_Bool isMulti() {
- return( ( m_type &~ 0xffdf ) == OT_MULTI ) ? sal_True : sal_False;
- }
- inline sal_Bool isOptional() {
- return( ( m_type &~ 0xfeff ) == OT_OPTIONAL ) ? sal_True : sal_False;
- }
-
-}; ///:~ Option
-
-class Exception
-{
- rtl::OString m_sAsciiMessage;
-public:
- Exception();
- virtual ~Exception(){}
-
- Exception(char const* sAsciiMessage);
- Exception(rtl::OString const& sAsciiMessage);
-
- virtual rtl::OUString message() const;
- virtual char const* what() const;
-};
-
-class ValueNotFoundException : public Exception
-{
-public:
- ValueNotFoundException();
- ValueNotFoundException(char const* sExit);
-};
-
-//: GetOpt
-class GetOpt {
-
- rtl::OString m_prgname;
- rtl::OString m_vardelim;
- std::vector< rtl::OString > m_cmdline;
- std::vector< rtl::OString > m_param;
- std::vector< rtl::OString > m_varvec;
- std::vector< OptDsc* > m_optionset;
- optHashMap m_opthash;
-
- //> private methods
- void initialize( char* cmdLine[], char const * optSet[] );
- void createCmdLineOptions();
- sal_uInt32 getMaxNameLength();
- sal_uInt32 getMaxLegendLength();
- const rtl::OString optDsc2Str( OptDsc* optDsc , sFormat frm );
- void tokenize( const rtl::OString& opt, const rtl::OString& charSet,
- std::vector< rtl::OString >& optLine, sal_Bool strip = sal_True );
- ///< private methods
-
- GetOpt();
- GetOpt( GetOpt& );
- GetOpt& operator = ( GetOpt& );
-
-public:
-
- //> c'tor
- GetOpt( char* cmdLine[], char const * optSet[], rtl::OString varDelim =
- rtl::OString( "$" ) )
- : m_vardelim( varDelim ) {
-
- initialize( cmdLine, optSet );
- createCmdLineOptions();
- } ///< c'tor
-
- //> d'tor
- ~GetOpt();
- ///< d'tor
-
- //> inline methods
- inline std::vector< rtl::OString >* getCmdLine() { return &m_cmdline; }
- inline optHashMap* getOptions() { return ( &m_opthash ); }
- inline rtl::OString& getName() { return m_prgname; }
- inline rtl::OString& getFirstParam() { return *(m_param.begin()); }
- inline std::vector< rtl::OString >& getParams() { return m_param; }
- rtl::OString& getOpt( const rtl::OString& opt );
- void rmvOpt( rtl::OString& opt ) {
- m_opthash.erase( opt );
- }
- inline std::vector< rtl::OString >& getOptVec( const rtl::OString& opt ) {
- return m_opthash[ opt ];
- }
- ///< inline methods
-
-
- sal_Bool exist( rtl::OString& opt );
- sal_Bool hasParam( std::vector< rtl::OString >::iterator iter );
- sal_Bool hasVars( void );
- sal_Bool evaluateOpt( std::vector< rtl::OString >::iterator iter );
- OptDsc* getOptDsc( rtl::OString& opt );
- sal_Bool hasOpt( const rtl::OString& opt ) const;
- ::osl::FileBase::RC getIniOptions( rtl::OString iniPth );
- void createOpt( rtl::OString& optdsc );
- void str2Opt( rtl::OString iOpts );
- void addOpt( rtl::OString& opt, sal_Bool evaluate = sal_True );
- void replVars( void );
- void showUsage( void );
- void printStatus( void );
-
-}; ///:~ GetOpt
-#endif
diff --git a/testshl2/inc/testshl/joblist.hxx b/testshl2/inc/testshl/joblist.hxx
deleted file mode 100644
index 24f45bc5ec26..000000000000
--- a/testshl2/inc/testshl/joblist.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CPPUNIT_JOBLIST_HXX
-#define CPPUNIT_JOBLIST_HXX
-
-#include <vector>
-#include <string>
-#include <hash_map>
-#include "sal/types.h"
-
-// #include <testshl/nocopy.hxx>
-
-/*
- struct eqstr
- {
- bool operator()( std::string const & s1, std::string const& s2 ) const
- {
- return ( s1 == s2 );
- }
- };
-*/
-
-/*
- struct hashstr
- {
- sal_uInt32 operator()( std::string const & str ) const
- {
- return str.hashCode();
- }
- };
-*/
-typedef std::hash_map< std::string, int > HashMap;
-
-// typedef std::vector<std::string> StringList;
-
-#define JOB_UNKNOWN 0
-#define JOB_NOT_FOUND 1
-#define JOB_PASSED 2
-#define JOB_FAILED 3
-#define JOB_ACCESS 4
-
-#define JOB_EXCLUDE_LIST 0x1000
-#define JOB_ONLY_LIST 0x1001
-
-typedef sal_Int16 JobType;
-
-class JobList /* : NOCOPY */
-{
- HashMap m_aJobList;
- char** ppsJobList;
-
- // returns true if the given List contains unxlngi or unxsols or wntmsci...
- bool isInCurrentEnvironment(std::string const& _sString);
- std::string trim(std::string const& _sStringToTrim);
-
-public:
- JobList();
- ~JobList();
-
- bool readfile(std::string const& _sFilename, JobType _nJobType);
- const char** getList() const {return (const char**)ppsJobList;}
-
- int getJobListEntry(std::string const& _sIndexName);
- void setJobListEntry(std::string const& _sIndexName, int _nValue);
-
- int size() {return m_aJobList.size();}
- HashMap const& getHashMap() {return m_aJobList;}
-};
-
-#endif
-
diff --git a/testshl2/inc/testshl/log.hxx b/testshl2/inc/testshl/log.hxx
deleted file mode 100644
index abe93c55347f..000000000000
--- a/testshl2/inc/testshl/log.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- *************************************************************************
-
- Source Code Control System - Header
-
- $Header$
-
- Source Code Control System - Update
-
-*************************************************************************/
-#ifndef __QADEV_REGSCAN_LOG_HXX__
-#define __QADEV_REGSCAN_LOG_HXX__
-
-#include <time.h>
-#include <rtl/ustring.hxx>
-#include <rtl/strbuf.hxx>
-#include <sal/types.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
-
-//!io #include <iostream>
-#include <vector>
-
-// using namespace std;
-
-
-/**
- * Log derives the interface of the ::osl::File class ( is-a relation ).
- * Its members (has-a relation) are the (full qualified)name of the log
- * and an OStringBuffer which represents the content of the logfile.
- * It provides the functionality of easy-to-use open and write logs
- */
-//: Log
-class Log {
-
- ::osl::File* m_logfile; // fileobject
- rtl::OUString m_logurl; // url of log
- rtl::OStringBuffer m_buf; // content of log
-
- Log();
-
-public:
-
- //> c'tor
- /**
- * constructors argument is a full qualified UNC path
- * @param OUString logfile ( full qualified UNC path )
- */
- Log( const rtl::OUString& logURL )
- : m_logfile( new ::osl::File( logURL ))
- , m_logurl(logURL)
- {} ///< c'tor
-
- //> d'tor
- virtual ~Log() {
- m_logfile->close();
- delete( m_logfile );
- } ///< d'tor
-
- //> inline methods
- // returns a reference to name instance
- inline rtl::OUString getLogURL() { return m_logurl; }
- inline rtl::OString getName() { return rtl::OUStringToOString(
- m_logurl, RTL_TEXTENCODING_ASCII_US ); }
- ///< inline methods
-
- // open logfile for overwrite (default) or append
- ::osl::FileBase::RC open( sal_Bool append = sal_False );
- ::osl::FileBase::RC close() { return m_logfile->close(); }
-
-
- // write methods without (default) or with echo on display
- ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False );
- ::osl::FileBase::RC write( const rtl::OString& buf,
- sal_Bool v = sal_False );
- // ::osl::FileBase::RC write( rtl::OStringBuffer const& buf,
- // sal_Bool v = sal_False );
- ::osl::FileBase::RC write( const rtl::OUString& buf,
- rtl_TextEncoding enc = RTL_TEXTENCODING_ASCII_US,
- sal_Bool v = sal_False );
-
-}; ///:~ Log
-
-Log &operator <<( Log &_aLog, const sal_Char * _sValue );
-Log &operator <<( Log &_aLog, rtl::OString const& _sValue );
-Log &operator <<( Log &_aLog, rtl::OUString const& _sValue );
-// Log &operator <<( Log &_aLog, rtl::OStringBuffer const& _sValue );
-
-#endif
diff --git a/testshl2/inc/testshl/nocopy.hxx b/testshl2/inc/testshl/nocopy.hxx
deleted file mode 100644
index 660bb1892e46..000000000000
--- a/testshl2/inc/testshl/nocopy.hxx
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef NOCOPY_HXX
-#define NOCOPY_HXX
-
-// prevent illegal copies
-class NOCOPY
-{
- NOCOPY(NOCOPY const&);
- NOCOPY& operator=(NOCOPY const&);
-public:
- NOCOPY(){}
-};
-
-#endif
diff --git a/testshl2/inc/testshl/result/SynchronizedObject.h b/testshl2/inc/testshl/result/SynchronizedObject.h
deleted file mode 100644
index 6994fdb1692e..000000000000
--- a/testshl2/inc/testshl/result/SynchronizedObject.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef CPPUNIT_SYNCHRONIZEDOBJECT_H
-#define CPPUNIT_SYNCHRONIZEDOBJECT_H
-
-#include <cppunit/Portability.h>
-#include <testshl/nocopy.hxx>
-
-namespace CppUnit
-{
-
-/*! \brief Base class for synchronized object.
- *
- * Synchronized object are object which members are used concurrently by mutiple
- * threads.
- *
- * This class define the class SynchronizationObject which must be subclassed
- * to implement an actual lock.
- *
- * Each instance of this class holds a pointer on a lock object.
- *
- * See src/msvc6/MfcSynchronizedObject.h for an example.
- */
-class CPPUNIT_API SynchronizedObject
-{
-public:
- /*! \brief Abstract synchronization object (mutex)
- */
- class SynchronizationObject
- {
- public:
- SynchronizationObject() {}
- virtual ~SynchronizationObject() {}
-
- virtual void lock() {}
- virtual void unlock() {}
- };
-
- /*! Constructs a SynchronizedObject object.
- */
- SynchronizedObject( SynchronizationObject *syncObject =0 );
-
- /// Destructor.
- virtual ~SynchronizedObject();
-
-protected:
- /*! \brief Locks a synchronization object in the current scope.
- */
- class ExclusiveZone : NOCOPY
- {
- SynchronizationObject *m_syncObject;
-
- public:
- ExclusiveZone( SynchronizationObject *syncObject )
- : m_syncObject( syncObject )
- {
- m_syncObject->lock();
- }
-
- ~ExclusiveZone()
- {
- m_syncObject->unlock ();
- }
- };
-
- virtual void setSynchronizationObject( SynchronizationObject *syncObject );
-
-protected:
- SynchronizationObject *m_syncObject;
-
-private:
- /// Prevents the use of the copy constructor.
- SynchronizedObject( const SynchronizedObject &copy );
-
- /// Prevents the use of the copy operator.
- void operator =( const SynchronizedObject &copy );
-};
-
-
-
-} // namespace CppUnit
-
-
-#endif // CPPUNIT_SYNCHRONIZEDOBJECT_H
diff --git a/testshl2/inc/testshl/result/TestListener.h b/testshl2/inc/testshl/result/TestListener.h
deleted file mode 100644
index 0814f21b7e2f..000000000000
--- a/testshl2/inc/testshl/result/TestListener.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef CPPUNIT_TESTLISTENER_H // -*- C++ -*-
-#define CPPUNIT_TESTLISTENER_H
-
-#include <cppunit/Portability.h>
-
-
-namespace CppUnit {
-
-class Exception;
-class Test;
-class TestFailure;
-
-
-/*! \brief Listener for test progress and result.
- * \ingroup TrackingTestExecution
- *
- * Implementing the Observer pattern a TestListener may be registered
- * to a TestResult to obtain information on the testing progress. Use
- * specialized sub classes of TestListener for text output
- * (TextTestProgressListener). Do not use the Listener for the test
- * result output, use a subclass of Outputter instead.
- *
- * The test framework distinguishes between failures and errors.
- * A failure is anticipated and checked for with assertions. Errors are
- * unanticipated problems signified by exceptions that are not generated
- * by the framework.
- *
- * \see TestResult
- */
-class CPPUNIT_API TestListener
-{
-public:
- virtual ~TestListener() {}
-
- /// Called when just before a TestCase is run.
- virtual void startTest( Test *test ) =0 ;
-
- /*! Called when a failure occurs while running a test.
- * \see TestFailure.
- * \warning \a failure is a temporary object that is destroyed after the
- * method call. Use TestFailure::clone() to create a duplicate.
- */
- virtual void addFailure( const TestFailure &failure ) =0;
-
- /// Called just after a TestCase was run (even if a failure occured).
- virtual void endTest( Test *test ) =0;
-
- // additional info
- virtual void addInfo(Test *test, const char*) =0;
-
- // info in which node we are
- // helper functions to create tree structures
- // old: virtual void enterNode( const char* ) =0;
- // old: virtual void leaveNode( const char* ) =0;
-};
-
-
-} // namespace CppUnit
-
-#endif // CPPUNIT_TESTLISTENER_H
-
-
diff --git a/testshl2/inc/testshl/result/TestResult.h b/testshl2/inc/testshl/result/TestResult.h
deleted file mode 100644
index 22b5d2346664..000000000000
--- a/testshl2/inc/testshl/result/TestResult.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef CPPUNIT_TESTRESULT_H
-#define CPPUNIT_TESTRESULT_H
-
-#include <cppunit/Portability.h>
-
-#if CPPUNIT_NEED_DLL_DECL
-#ifdef _MSC_VER
-#pragma warning( push )
-#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
-#endif
-#endif
-
-#include <testshl/result/SynchronizedObject.h>
-#include <vector>
-#include <string>
-#include <deque>
-//!io #include <iostream>
-
-#include "testshl/result/optionhelper.hxx"
-#include "cppunit/TestFailure.h"
-
-class Outputter;
-namespace CppUnit {
-
-class Exception;
-class Test;
-// class TestFailure;
-class TestListener;
-
-#if CPPUNIT_NEED_DLL_DECL
- template class CPPUNIT_API std::deque<TestListener *>;
-#endif
-
-/*! \brief Manages TestListener.
- * \ingroup TrackingTestExecution
- *
- * A single instance of this class is used when running the test. It is usually
- * created by the test runner (TestRunner).
- *
- * This class shouldn't have to be inherited from. Use a TestListener
- * or one of its subclasses to be informed of the ongoing tests.
- * Use a Outputter to receive a test summary once it has finished
- *
- * TestResult supplies a template method 'setSynchronizationObject()'
- * so that subclasses can provide mutual exclusion in the face of multiple
- * threads. This can be useful when tests execute in one thread and
- * they fill a subclass of TestResult which effects change in another
- * thread. To have mutual exclusion, override setSynchronizationObject()
- * and make sure that you create an instance of ExclusiveZone at the
- * beginning of each method.
- *
- * \see Test, TestListener, TestResultCollector, Outputter.
- */
-class CPPUNIT_API TestResult : protected SynchronizedObject
-{
-protected:
- OptionHelper m_aOptionHelper;
-
-public:
- TestResult( GetOpt & _aOptions, SynchronizationObject *syncObject = 0 );
- virtual ~TestResult();
-
- virtual void addListener( TestListener *listener );
- virtual void removeListener( TestListener *listener );
-
- virtual void reset();
- virtual void stop();
-
- virtual bool shouldStop() const;
-
- virtual void startTest( Test *test );
- virtual void addError( Test *test, Exception *e, ErrorType::num eType=ErrorType::ET_ERROR);
- virtual void addFailure( Test *test, Exception *e );
- virtual void endTest( Test *test );
-
- // LLA: additionals
- virtual void addInfo(Test *test, const char *sInfo);
-
- virtual void enterNode(const char* Node);
- virtual void leaveNode(const char* Node);
- virtual std::string getNodeName();
-
- // if true, execution is allowed.
- virtual bool isAllowedToExecute(std::string const & sName);
- bool isOnlyShowJobs() {return m_aOptionHelper.isOnlyShowJobs();}
- bool isOptionWhereAmI();
-
- virtual void print(Outputter &);
- void setExitValue(int _nValue) {m_nExitValue = _nValue;}
- int getExitValue() {return m_nExitValue;}
-
-protected:
- void addFailure( const TestFailure &failure );
-
-protected:
- typedef std::deque<TestListener *> TestListeners;
- TestListeners m_listeners;
- bool m_stop;
-
- // this vector is used to expand the test name with a current node name
- std::vector<std::string> m_aCurrentNodeNames;
-
- //# std::vector<std::string> m_aNodes;
-
-private:
- TestResult( const TestResult &other );
- TestResult &operator =( const TestResult &other );
- int m_nExitValue;
-};
-
-
-} // namespace CppUnit
-
-
-#if CPPUNIT_NEED_DLL_DECL
-#ifdef _MSC_VER
-#pragma warning( pop )
-#endif
-#endif
-
-#endif // CPPUNIT_TESTRESULT_H
-
-
diff --git a/testshl2/inc/testshl/result/TestResultCollector.h b/testshl2/inc/testshl/result/TestResultCollector.h
deleted file mode 100644
index ddbe517f8935..000000000000
--- a/testshl2/inc/testshl/result/TestResultCollector.h
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef CPPUNIT_TESTRESULTCOLLECTOR_H
-#define CPPUNIT_TESTRESULTCOLLECTOR_H
-
-#include <cppunit/Portability.h>
-
-#if CPPUNIT_NEED_DLL_DECL
-#ifdef _MSC_VER
-#pragma warning( push )
-#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
-#endif
-#endif
-
-#include <testshl/result/TestResult.h>
-#include <testshl/result/TestSucessListener.h>
-#include <deque>
-#include <vector>
-
-namespace CppUnit
-{
-
-
-#if CPPUNIT_NEED_DLL_DECL
- template class CPPUNIT_API std::deque<TestFailure *>;
- template class CPPUNIT_API std::deque<Test *>;
-#endif
-
-
-/*! \brief Collects test result.
- * \ingroup WritingTestResult
- * \ingroup BrowsingCollectedTestResult
- *
- * A TestResultCollector is a TestListener which collects the results of executing
- * a test case. It is an instance of the Collecting Parameter pattern.
- *
- * The test framework distinguishes between failures and errors.
- * A failure is anticipated and checked for with assertions. Errors are
- * unanticipated problems signified by exceptions that are not generated
- * by the framework.
- * \see TestListener, TestFailure.
- */
-
-class OneStringContainer
-{
- std::string m_sName;
-protected:
- OneStringContainer() {}
-public:
- OneStringContainer(std::string const& _sName)
- :m_sName(_sName){}
- std::string getString() const {return m_sName;}
- virtual ~OneStringContainer(){}
-};
-
-// -----------------------------------------------------------------------------
-class TestEnvelope : public OneStringContainer
-{
- Test* m_pTest;
-public:
- TestEnvelope():m_pTest(NULL){}
-
- TestEnvelope(Test* _pTest, std::string const& _sName)
- : OneStringContainer(_sName),
- m_pTest(_pTest)
- {}
-
- Test* getTest() {return m_pTest;}
- virtual ~TestEnvelope(){}
-
-};
-
-// -----------------------------------------------------------------------------
-class TestInfo : public TestEnvelope
-{
-public:
- TestInfo(Test* _pTest, std::string const& _sName)
- :TestEnvelope(_pTest, _sName)
- {}
-};
-
-// -----------------------------------------------------------------------------
-class TestFailureEnvelope : public OneStringContainer
-{
- TestFailure* m_pTestFailure;
-public:
- TestFailureEnvelope():m_pTestFailure(NULL){}
-
- TestFailureEnvelope(TestFailure* _pTestFailure, std::string const& _sName)
- :OneStringContainer(_sName),
- m_pTestFailure(_pTestFailure)
- {}
-
- TestFailure* getTestFailure() {return m_pTestFailure;}
- virtual ~TestFailureEnvelope(){}
-
-};
-// -----------------------------------------------------------------------------
-
-class CPPUNIT_API TestResultCollector : public TestSucessListener
-{
- TestResult* m_pResult;
-public:
- typedef std::deque<TestFailureEnvelope *> TestFailures;
- typedef std::deque<TestEnvelope *> Tests;
- typedef std::vector<TestInfo *> TestInfos;
-
-
- /*! Constructs a TestResultCollector object.
- */
- TestResultCollector( TestResult *_pResult, SynchronizationObject *syncObject = 0 );
-
- /// Destructor.
- virtual ~TestResultCollector();
-
- void startTest( Test *test );
- void endTest( Test *test );
-
- void addFailure( const TestFailure &failure );
-
- virtual void reset();
-
- virtual int runTests() const;
- virtual int testErrors() const;
- virtual int testFailures() const;
- virtual int testFailuresTotal() const;
-
- virtual const TestFailures& failures() const;
- virtual const Tests &tests() const;
- virtual std::string getInfo(Test*);
-
- virtual void addInfo(Test *test, const char *sInfo);
-
- // virtual void enterNode(const char* Node);
- // virtual void leaveNode(const char* Node);
-
-protected:
- Tests m_tests;
- TestFailures m_failures;
- TestInfos m_aInfos;
-
- int m_testErrors;
-
- // this vector is used to expand the test name with a current node name
- // std::vector<std::string> m_aCurrentNodeNames;
- // std::string getNodeName();
-private:
- /// Prevents the use of the copy constructor.
- TestResultCollector( const TestResultCollector &copy );
-
- /// Prevents the use of the copy operator.
- void operator =( const TestResultCollector &copy );
-};
-
-
-
-} // namespace CppUnit
-
-
-#if CPPUNIT_NEED_DLL_DECL
-#ifdef _MSC_VER
-#pragma warning( pop )
-#endif
-#endif
-
-
-#endif // CPPUNIT_TESTRESULTCOLLECTOR_H
diff --git a/testshl2/inc/testshl/result/TestSucessListener.h b/testshl2/inc/testshl/result/TestSucessListener.h
deleted file mode 100644
index 3eb53b9fc13f..000000000000
--- a/testshl2/inc/testshl/result/TestSucessListener.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef CPPUNIT_TESTSUCESSLISTENER_H
-#define CPPUNIT_TESTSUCESSLISTENER_H
-
-#include <testshl/result/SynchronizedObject.h>
-#include <testshl/result/TestListener.h>
-
-
-namespace CppUnit
-{
-
-/*! \brief TestListener that checks if any test case failed.
- * \ingroup TrackingTestExecution
- */
-class CPPUNIT_API TestSucessListener : public TestListener,
- public SynchronizedObject
-{
-public:
- /*! Constructs a TestSucessListener object.
- */
- TestSucessListener( SynchronizationObject *syncObject = 0 );
-
- /// Destructor.
- virtual ~TestSucessListener();
-
- virtual void reset();
-
- void addFailure( const TestFailure &failure );
-
- /// Returns whether the entire test was successful or not.
- virtual bool wasSuccessful() const;
-
-private:
- bool m_sucess;
-};
-
-
-} // namespace CppUnit
-
-
-#endif // CPPUNIT_TESTSUCESSLISTENER_H
diff --git a/testshl2/inc/testshl/result/TextTestResult.h b/testshl2/inc/testshl/result/TextTestResult.h
deleted file mode 100644
index e2ba0ffba427..000000000000
--- a/testshl2/inc/testshl/result/TextTestResult.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef CPPUNIT_TEXTTESTRESULT_H
-#define CPPUNIT_TEXTTESTRESULT_H
-
-#include <testshl/result/TestResult.h>
-#include <testshl/result/TestResultCollector.h>
-#include <ostream>
-
-class GetOpt;
-namespace CppUnit {
-
-class SourceLine;
-class Exception;
-class Test;
-
-/*! \brief Holds printable test result (DEPRECATED).
- * \ingroup TrackingTestExecution
- *
- * deprecated Use class TextTestProgressListener and TextOutputter instead.
- */
-class CPPUNIT_API TextTestResult : public TestResult
-/* public TestResultCollector*/
-{
- TestResultCollector m_aResulter;
-public:
- TextTestResult(GetOpt& _aOptions);
-
- virtual void addFailure( const TestFailure &failure );
- virtual void startTest( Test *test );
- virtual void endTest( Test *test );
-
- virtual void print( std::ostream &stream );
-protected:
-
- virtual void printFailures( std::ostream &stream );
- virtual void printHeader( std::ostream &stream );
-
- virtual void printFailure( TestFailure *failure,
- int failureNumber,
- std::ostream &stream );
- virtual void printFailureListMark( int failureNumber,
- std::ostream &stream );
- virtual void printFailureTestName( TestFailure *failure,
- std::ostream &stream );
- virtual void printFailureType( TestFailure *failure,
- std::ostream &stream );
- virtual void printFailureLocation( SourceLine sourceLine,
- std::ostream &stream );
- virtual void printFailureDetail( Exception *thrownException,
- std::ostream &stream );
- virtual void printFailureWarning( std::ostream &stream );
- virtual void printStatistics( std::ostream &stream );
-};
-
-/** insertion operator for easy output */
-std::ostream &operator <<( std::ostream &stream,
- TextTestResult &result );
-
-} // namespace CppUnit
-
-#endif // CPPUNIT_TEXTTESTRESULT_H
-
-
diff --git a/testshl2/inc/testshl/result/callbackfunc.h b/testshl2/inc/testshl/result/callbackfunc.h
deleted file mode 100644
index 606bf7179163..000000000000
--- a/testshl2/inc/testshl/result/callbackfunc.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _callbackfunc_h
-#define _callbackfunc_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- // this is the entry point from the DLL back to the executable.
- long CallbackDispatch(int x, ...);
-
-//# void TestResult_startTest(hTestResult _pResult, hTest _pTest);
-//# void TestResult_addFailure( hTestResult _pResult, hTest _pTest, hException _pException );
-//# void TestResult_addError( hTestResult _pResult, hTest _pTest, hException _pException );
-//# void TestResult_endTest( hTestResult _pResult, hTest _pTest );
-//# bool TestResult_shouldStop(hTestResult _pResult);
-//# void TestResult_addInfo( hTestResult _pResult, hTest _pTest, const char* _sInfo );
-//#
-//# void TestResult_enterNode( hTestResult _pResult, const char* _sInfo );
-//# void TestResult_leaveNode( hTestResult _pResult, const char* _sInfo );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/testshl2/inc/testshl/result/emacsTestResult.hxx b/testshl2/inc/testshl/result/emacsTestResult.hxx
deleted file mode 100644
index 3f64060d75cb..000000000000
--- a/testshl2/inc/testshl/result/emacsTestResult.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef cppunit_emacstestresult_h
-#define cppunit_emacstestresult_h
-
-#include <testshl/result/TestResult.h>
-#include <testshl/result/TestResultCollector.h>
-#include <ostream>
-#include "testshl/getopt.hxx"
-
-class Outputter;
-namespace CppUnit {
-
-class SourceLine;
-class Exception;
-class Test;
-
-/*! \brief Holds printable test result (DEPRECATED).
- * \ingroup TrackingTestExecution
- *
- * deprecated Use class TextTestProgressListener and TextOutputter instead.
- */
- class CPPUNIT_API emacsTestResult : public TestResult
-
-/* ,public TestResultCollector*/
- {
- GetOpt & m_aOptions;
- // OptionHelper m_aOptionHelper;
- TestResultCollector m_aResulter;
-
- public:
- emacsTestResult(GetOpt & _aOptions);
-
- // virtual void addFailure( const TestFailure &failure );
- // virtual void startTest( Test *test );
- // virtual void endTest( Test *test );
-
- virtual void print( Outputter &stream );
-
- protected:
- virtual void printHeader( Outputter &stream );
- // virtual void printTestLine( Outputter &stream, Test* pTest, std::string const& _sNodeName, std::string const& _sInfo);
- virtual void printFailureLine( Outputter &stream, TestFailure* pFailure, std::string const& _sNodeName );
- };
-
-/** insertion operator for easy output */
-// std::ostream &operator <<( std::ostream &stream,
-// emacsTestResult &result );
-
-} // namespace CppUnit
-
-#endif // CPPUNIT_testshlTESTRESULT_H
-
-
diff --git a/testshl2/inc/testshl/result/log.hxx b/testshl2/inc/testshl/result/log.hxx
deleted file mode 100644
index f57c9af0e119..000000000000
--- a/testshl2/inc/testshl/result/log.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef __QADEV_REGSCAN_LOG_HXX__
-#define __QADEV_REGSCAN_LOG_HXX__
-
-#include <time.h>
-#include <rtl/ustring.hxx>
-#include <rtl/strbuf.hxx>
-#include <sal/types.h>
-#include <osl/thread.h>
-#include <osl/file.hxx>
-
-#include <testshl/nocopy.hxx>
-
-//!io #include <iostream>
-#include <vector>
-
-// using namespace std;
-
-
-/**
- * Log derives the interface of the ::osl::File class ( is-a relation ).
- * Its members (has-a relation) are the (full qualified)name of the log
- * and an OStringBuffer which represents the content of the logfile.
- * It provides the functionality of easy-to-use open and write logs
- */
-//: Log
-class Log : NOCOPY {
-
- ::osl::File* m_logfile; // fileobject
- rtl::OUString m_logurl; // url of log
- rtl::OStringBuffer m_buf; // content of log
-
- Log();
-
-public:
-
- //> c'tor
- /**
- * constructors argument is a full qualified UNC path
- * @param OUString logfile ( full qualified UNC path )
- */
- Log( const rtl::OUString& logURL )
- : m_logfile( new ::osl::File( logURL ))
- , m_logurl(logURL)
- {} ///< c'tor
-
- //> d'tor
- virtual ~Log()
- {
- m_logfile->close();
- delete( m_logfile );
- } ///< d'tor
-
- //> inline methods
- // returns a reference to name instance
- inline rtl::OUString getLogURL() { return m_logurl; }
- inline rtl::OString getName() { return rtl::OUStringToOString(
- m_logurl, RTL_TEXTENCODING_ASCII_US ); }
- ///< inline methods
-
- // open logfile for overwrite (default) or append
- ::osl::FileBase::RC open( sal_Bool append = sal_False );
- ::osl::FileBase::RC close() { return m_logfile->close(); }
-
-
- // write methods without (default) or with echo on display
- ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False );
- ::osl::FileBase::RC write( const rtl::OString& buf,
- sal_Bool v = sal_False );
- //! ::osl::FileBase::RC write( rtl::OStringBuffer& buf,
- //! sal_Bool v = sal_False );
- ::osl::FileBase::RC write( const rtl::OUString& buf,
- rtl_TextEncoding enc = RTL_TEXTENCODING_ASCII_US,
- sal_Bool v = sal_False );
-
-}; ///:~ Log
-
-#endif
diff --git a/testshl2/inc/testshl/result/optionhelper.hxx b/testshl2/inc/testshl/result/optionhelper.hxx
deleted file mode 100644
index 6b67bacf0472..000000000000
--- a/testshl2/inc/testshl/result/optionhelper.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef optionhelper_hxx
-#define optionhelper_hxx
-
-#include <string>
-
-#include <sal/types.h>
-
-#include "testshl/nocopy.hxx"
-#include "testshl/getopt.hxx"
-#include "testshl/joblist.hxx"
-
-// -----------------------------------------------------------------------------
-
-typedef std::vector<rtl::OString> OStringList;
-
-//!? Better: OptionHelper
-class OptionHelper : NOCOPY
-{
- GetOpt & m_aOption;
- JobList m_aJobOnlyList;
- JobList m_aJobExcludeList;
- OStringList m_aJobFilter;
-
- std::string m_sProjectId;
- std::string m_sBuildId;
-
- std::string getProjectId() const;
- std::string getBuildId() const;
- std::string createDateTag(std::string const& _sProjectId, std::string const& _sBuildId);
-
- void handleJobs();
-public:
- OptionHelper(GetOpt & _aOption)
- :m_aOption(_aOption)
- {
- if (m_aOption.hasOpt("-projectid"))
- m_sProjectId = m_aOption.getOpt("-projectid");
-
- if (m_aOption.hasOpt("-buildid"))
- m_sBuildId = m_aOption.getOpt("-buildid");
-
- handleJobs();
- }
-
- static std::string integerToAscii(sal_Int32 nValue);
- static std::string twoDigits(std::string const& _sValue);
-
- std::string createDateTag();
- bool showErrors();
- bool showTests();
-
- JobList getJobOnlyList() {return m_aJobOnlyList;}
- JobList getJobExcludeList() {return m_aJobExcludeList;}
-
- bool isAllowedToExecute(std::string const& _sNode, std::string const& _sName);
-
- bool isOnlyShowJobs() {return m_aOption.hasOpt("-onlyshowjobs") == sal_True ? true : false;}
- GetOpt& getOptions() {return m_aOption;}
- bool isVerbose() {return m_aOption.hasOpt("-verbose") == sal_True ? true : false;}
- bool isOptionWhereAmI() {return m_aOption.hasOpt("-whereami") == sal_True ? true : false;}
-};
-
-// -----------------------------------------------------------------------------
-
-
-#endif
-
-
diff --git a/testshl2/inc/testshl/result/outputter.hxx b/testshl2/inc/testshl/result/outputter.hxx
deleted file mode 100644
index 9394a39a1ccd..000000000000
--- a/testshl2/inc/testshl/result/outputter.hxx
+++ /dev/null
@@ -1,82 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-//
-
-#ifndef outputter_hxx
-#define outputter_hxx
-
-#include <string>
-#include <ostream>
-#include <memory>
-#include "testshl/log.hxx"
-#include <sal/types.h>
-#include "testshl/nocopy.hxx"
-
-// #include <fstream>
-
-class Outputter : NOCOPY
-{
- std::auto_ptr<Log> m_pLog;
- std::ostream* m_pStream;
-
- void writeToAll(const sal_Char* _pStr);
-public:
- class endl
- {
- char c;
- public:
- endl():c('\0'){}
- };
-public:
- Outputter(Log * _pLog )
- :m_pLog(_pLog),
- m_pStream(NULL) {}
-
- Outputter(std::ostream& _aStream)
- :m_pLog(NULL),
- m_pStream(&_aStream) {}
-
- ~Outputter();
-
- void write(const sal_Char*);
- void write(std::string const&);
- void write(sal_Int32);
- // void write(double);
-};
-
-Outputter& operator <<( Outputter &stream, const sal_Char* );
-Outputter& operator <<( Outputter &stream, std::string const& );
-Outputter& operator <<( Outputter &stream, sal_Int32 );
-// Outputter& operator <<( Outputter &stream, double );
-
-Outputter& operator <<( Outputter &stream, Outputter::endl const&);
-
-// Outputter& operator <<( Outputter &stream, const char* );
-
-#endif
-
diff --git a/testshl2/inc/testshl/result/testshlTestResult.h b/testshl2/inc/testshl/result/testshlTestResult.h
deleted file mode 100644
index 22a50a9a841e..000000000000
--- a/testshl2/inc/testshl/result/testshlTestResult.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef cppunit_testshltestresult_h
-#define cppunit_testshltestresult_h
-
-#include <map>
-#include <testshl/result/TestResult.h>
-#include <testshl/result/TestResultCollector.h>
-#include <ostream>
-#include "testshl/getopt.hxx"
-
-class Outputter;
-
-namespace CppUnit {
-
-class SourceLine;
-class Exception;
-class Test;
-
-struct ltstr
-{
- bool operator()(const CppUnit::Test* p1, const CppUnit::Test* p2) const
- {
- return p1 < p2;
- }
-};
-typedef std::map<CppUnit::Test*, bool, ltstr> TestPtrList;
-
-
-/*! \brief Holds printable test result (DEPRECATED).
- * \ingroup TrackingTestExecution
- *
- * deprecated Use class TextTestProgressListener and TextOutputter instead.
- */
- class CPPUNIT_API testshlTestResult : public TestResult
-
-/* ,public TestResultCollector*/
- {
- GetOpt & m_aOptions;
- // OptionHelper m_aOptionHelper;
- TestResultCollector m_aResulter;
-
- public:
- testshlTestResult(GetOpt & _aOptions);
- virtual ~testshlTestResult();
-
- // virtual void addFailure( const TestFailure &failure );
- // virtual void startTest( Test *test );
- // virtual void endTest( Test *test );
-
- virtual void print( Outputter &stream );
-
- protected:
- virtual void printHeader( Outputter &stream );
-
- void printLines(Outputter &stream, HashMap & _aJobList);
- void printFailedTests(Outputter &stream, TestPtrList &aFailedTests);
- void printTestLines(Outputter &stream, TestPtrList &aFailedTests);
- void printUnknownLines(Outputter &stream, HashMap & _aJobList);
-
- virtual void printTestLine( Outputter &stream, Test* pTest, std::string const& _sNodeName, std::string const& _sInfo);
- virtual void printFailureLine( Outputter &stream, TestFailure* pFailure, std::string const& _sNodeName );
- virtual void printUnknownLine( Outputter &stream, std::string const& _sTestName);
- };
-
-/** insertion operator for easy output */
- Outputter &operator <<( Outputter &stream,
- testshlTestResult &result );
-
-} // namespace CppUnit
-
-#endif // CPPUNIT_testshlTESTRESULT_H
-
-
diff --git a/testshl2/inc/testshl/signaltest.h b/testshl2/inc/testshl/signaltest.h
deleted file mode 100644
index 6886d60be906..000000000000
--- a/testshl2/inc/testshl/signaltest.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SIGNALTEST_H
-#define SIGNALTEST_H
-
-#include <string>
-#include "cppunit/Test.h"
-#include <testshl/autoregister/htestresult.h>
-
-namespace CppUnit
-{
-
-class CPPUNIT_API SignalTest : public Test
-{
-public:
-
- SignalTest( std::string const& Name );
-
- ~SignalTest();
-
- virtual void run(hTestResult pResult);
- virtual int countTestCases() const;
- std::string getName() const;
- std::string toString() const;
-
-private:
- SignalTest( const SignalTest &other );
- SignalTest &operator=( const SignalTest &other );
-
-private:
- const std::string m_sName;
-};
-
-} // namespace CppUnit
-
-
-#endif
diff --git a/testshl2/inc/testshl/simpleheader.hxx b/testshl2/inc/testshl/simpleheader.hxx
deleted file mode 100644
index c910a7bdcd0f..000000000000
--- a/testshl2/inc/testshl/simpleheader.hxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CPPUNIT_SIMPLEHEADER_HXX
-#define CPPUNIT_SIMPLEHEADER_HXX
-
-// This file contains only the cppunit header files, for simplification.
-
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCaller.h>
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestAssert.h>
-#include <testshl/autoregister/registertestfunction.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include <testshl/additionalfunc.hxx>
-#include <testshl/cmdlinebits.hxx>
-#include <testshl/checkboom.hxx>
-
-#endif
diff --git a/testshl2/inc/testshl/stringhelper.hxx b/testshl2/inc/testshl/stringhelper.hxx
deleted file mode 100644
index 4e30c2d2d447..000000000000
--- a/testshl2/inc/testshl/stringhelper.hxx
+++ /dev/null
@@ -1,39 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef STRINGHELPER_HXX
-#define STRINGHELPER_HXX
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-
-inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString)
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US);
-}
-
-#endif
diff --git a/testshl2/inc/testshl/taghelper.hxx b/testshl2/inc/testshl/taghelper.hxx
deleted file mode 100644
index 1100256e6dee..000000000000
--- a/testshl2/inc/testshl/taghelper.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef TAGHELPER_HXX
-#define TAGHELPER_HXX
-
-#include <map>
-#include <sal/types.h>
-#include <testshl/nocopy.hxx>
-#include <cppunit/tagvalues.hxx>
-
-/* Tags are a general mechanism of extensible data arrays for parameter
- * specification and property inquiry. In practice, tags are used in arrays,
- * or chain of arrays.
- *
- */
-
-typedef sal_IntPtr TagData;
-
-//# struct TagItem
-//# {
-//# Tag ti_Tag; /* identifies the type of data */
-//# TagData ti_Data; /* type-specific data */
-//# };
-
-/* constants for Tag.ti_Tag, control tag values */
-#define TAG_DONE (Tag(0L)) /* terminates array of TagItems. ti_Data unused */
-#define TAG_END (Tag(0L)) /* synonym for TAG_DONE */
-#define TAG_IGNORE (Tag(1L)) /* ignore this item, not end of array */
-#define TAG_MORE (Tag(2L)) /* ti_Data is pointer to another array of TagItems
- * note that this tag terminates the current array
- */
-#define TAG_SKIP (Tag(3L)) /* skip this and the next ti_Data items */
-
-/* differentiates user tags from control tags */
-#define TAG_USER (Tag(1L<<31))
-
-// -----------------------------------------------------------------------------
-class TagHelper /* : NOCOPY */
-{
- typedef std::map<Tag, TagData> TagItems;
- TagItems m_aTagItems;
-
-public:
- TagHelper(){}
- void insert(Tag _nTag, TagData _nData)
- {
- m_aTagItems[_nTag] = _nData;
- }
- // const TagItems& get() const { return m_aTagItems; }
-
- TagData GetTagData(Tag _aTagValue, TagData _aDefaultValue = 0 /* NULL */) const
- {
- TagItems::const_iterator it = m_aTagItems.find(_aTagValue);
- if (it != m_aTagItems.end())
- return (*it).second;
- else
- return _aDefaultValue;
- }
-};
-
-#endif
-
-
diff --git a/testshl2/inc/testshl/tresstatewrapper.h b/testshl2/inc/testshl/tresstatewrapper.h
deleted file mode 100644
index 0f6830451caf..000000000000
--- a/testshl2/inc/testshl/tresstatewrapper.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef TESTSTATEWRAPPER_H
-#define TESTSTATEWRAPPER_H
-
-#ifdef _RTL_TRES_H_
-#error "This is old code, please remove the include of rtl/tres.h"
-#endif
-
-#include <sal/types.h>
-#include "testshl/autoregister/registertestfunction.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// typedef void* hTestResult;
-typedef hTestResult rtlTestResult;
-
-// -----------------------------------------------------------------------------
-void c_rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName);
-void c_rtl_tres_state_end(hTestResult _aResult, const sal_Char* _pName);
-
-// -----------------------------------------------------------------------------
-// the old test state function, which here convert all values for using with the
-// new testshl tool
-
-sal_Bool SAL_CALL c_rtl_tres_state(
- hTestResult pResult,
- sal_Bool bSuccess,
- char const * pTestMsg,
- char const * pFuncName);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/testshl2/inc/testshl/tresstatewrapper.hxx b/testshl2/inc/testshl/tresstatewrapper.hxx
deleted file mode 100644
index c90a5fe2535b..000000000000
--- a/testshl2/inc/testshl/tresstatewrapper.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef teststatewrapper_hxx
-#define teststatewrapper_hxx
-
-#include <testshl/nocopy.hxx>
-#include <sal/types.h>
-
-#include <testshl/simpleheader.hxx>
-#include <cppunit/callbackfunc_fktptr.h>
-
-// This is a hack, because it's possible that the testshl directory doesn't exist.
-#ifdef LOAD_TRESSTATEWRAPPER_LOCAL
-#include "tresstatewrapper.h"
-#else
-#include <testshl/tresstatewrapper.h>
-#endif
-
-// -----------------------------------------------------------------------------
-// helper class to mark the start off old test code
-// the name is need in the test result generator
-class rtl_tres_state_start : NOCOPY
-{
- const sal_Char* m_pName;
- hTestResult m_aResult;
-public:
- rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName);
- ~rtl_tres_state_start();
-};
-
-#endif
-
diff --git a/testshl2/inc/testshl/versionhelper.hxx b/testshl2/inc/testshl/versionhelper.hxx
deleted file mode 100644
index efa28bef0bda..000000000000
--- a/testshl2/inc/testshl/versionhelper.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef AUTOREGISTER_HXX
-#define AUTOREGISTER_HXX
-
-#include <stdio.h>
-#include <vector>
-#include <ostream>
-#include <iostream>
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-
-#include "dynamicregister.hxx"
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- Version ----------------------------------
-// -----------------------------------------------------------------------------
-// extern "C" const struct VersionInfo *GetVersionInfo();
-
-// this is a Hack, but at the moment, no change to handle this behaviour better.
-struct VersionInfo
-{
- const char* pTime;
- const char* pDate;
- const char* pUpd;
- const char* pMinor;
- const char* pBuild;
- const char* pInpath;
-};
-typedef const struct VersionInfo* (*FktGetVersionInfoPtr)();
-
-// -----------------------------------------------------------------------------
-class VersionHelper : public DynamicLibraryHelper
-{
- const VersionInfo *m_pInfo;
-
-public:
- VersionHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions);
-// void print(std::ostream& _aStream);
- void printall(FILE*);
-
- rtl::OString getTime() const;
- rtl::OString getDate() const;
- rtl::OString getUpd() const;
- rtl::OString getMinor() const;
- rtl::OString getBuild() const;
- rtl::OString getInpath() const;
-
- bool isOk() const;
-};
-
-/** insertion operator for easy output */
-// std::ostream &operator <<( std::ostream &stream,
-// VersionHelper &version );
-
-
-#endif
-
diff --git a/testshl2/inc/testshl/winstuff.hxx b/testshl2/inc/testshl/winstuff.hxx
deleted file mode 100644
index 830275883e0a..000000000000
--- a/testshl2/inc/testshl/winstuff.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef WINSTUFF_HXX
-#define WINSTUFF_HXX
-
-#include <sal/types.h>
-
-// Isolated into own compilation unit, to avoid interference with
-// windows headers
-void WinDebugBreak();
-void WinSleep( sal_uInt32 sec );
-sal_uInt32 WinGetCurrentProcessId();
-void WinTerminateApp( sal_uInt32 dwPID, sal_uInt32 dwTimeout );
-
-#endif
diff --git a/testshl2/prj/build.lst b/testshl2/prj/build.lst
deleted file mode 100644
index 7bbdfa8c1646..000000000000
--- a/testshl2/prj/build.lst
+++ /dev/null
@@ -1,9 +0,0 @@
-t2 testshl2 : cppunit sal NULL
-t2 testshl2 usr1 - all t2_mkout NULL
-t2 testshl2\inc nmake - all t2_inc NULL
-t2 testshl2\source\cppunit\win32 nmake - all t2_src_cppunit_win32 t2_inc NULL
-t2 testshl2\source\cppunit nmake - all t2_src_cppunit t2_src_cppunit_win32 t2_inc NULL
-t2 testshl2\source\cppunit\result nmake - all t2_src_cppunit_result t2_inc NULL
-t2 testshl2\source nmake - all t2_src t2_src_cppunit_result t2_src_cppunit t2_inc NULL
-t2 testshl2\util nmake - all t2_util t2_src NULL
-
diff --git a/testshl2/prj/d.lst b/testshl2/prj/d.lst
deleted file mode 100644
index 67cc1ad8e9e7..000000000000
--- a/testshl2/prj/d.lst
+++ /dev/null
@@ -1,29 +0,0 @@
-../%__SRC%/bin/testshl2.exe %_DEST%/bin%_EXT%/testshl2.exe
-../%__SRC%/bin/testshl2_timeout.exe %_DEST%/bin%_EXT%/testshl2_timeout.exe
-../%__SRC%/bin/testshl2 %_DEST%/bin%_EXT%/testshl2
-../%__SRC%/bin/testshl2_timeout %_DEST%/bin%_EXT%/testshl2_timeout
-../%__SRC%/bin/versioninfo.exe %_DEST%/bin%_EXT%/versioninfo.exe
-../%__SRC%/bin/versioninfo %_DEST%/bin%_EXT%/versioninfo
-
-../source/codegen/codegen.pl %_DEST%/bin%_EXT%/codegen_testshl2.pl
-
-mkdir: %_DEST%/inc%_EXT%/testshl
-mkdir: %_DEST%/inc%_EXT%/testshl/autoregister
-mkdir: %_DEST%/inc%_EXT%/testshl/result
-../inc/testshl/*.hxx %_DEST%/inc%_EXT%/testshl/*.hxx
-../inc/testshl/*.h %_DEST%/inc%_EXT%/testshl/*.h
-../inc/testshl/result/*.hxx %_DEST%/inc%_EXT%/testshl/result/*.hxx
-../inc/testshl/result/*.h %_DEST%/inc%_EXT%/testshl/result/*.h
-../inc/testshl/autoregister/*.h %_DEST%/inc%_EXT%/testshl/autoregister/*.h
-
-../%__SRC%/lib/testshl2.lib %_DEST%/lib%_EXT%/testshl2.lib
-../%__SRC%/lib/*.a %_DEST%/lib%_EXT%/*.a
-../%__SRC%/lib/c5t_*.lib %_DEST%/lib%_EXT%/c5t_*.lib
-
-# The follows is a testshl2 selftest library, which must be delivered for tests.
-# But per default this library doesn't exists.
-# For more information see workben/selftest
-../%__SRC%/bin/delivertest.dll %_DEST%/bin%_EXT%/testshl2_deliver_test.dll
-../%__SRC%/lib/libdelivertest.so %_DEST%/lib%_EXT%/libtestshl2_deliver_test.so
-../%__SRC%/lib/libdelivertest.dylib %_DEST%/lib%_EXT%/libtestshl2_deliver_test.dylib
-
diff --git a/testshl2/source/autoregisterhelper.cxx b/testshl2/source/autoregisterhelper.cxx
deleted file mode 100644
index 62e76804262c..000000000000
--- a/testshl2/source/autoregisterhelper.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "testshl/autoregisterhelper.hxx"
-
-#include <rtl/ustring.hxx>
-
-#include <testshl/autoregister/registerfunc.h>
-#include <testshl/autoregister/callbackstructure.h>
-#include <testshl/result/callbackfunc.h>
-#include <testshl/autoregister/testfunc.h>
-#include "testshl/filehelper.hxx"
-
-FunctionList m_Functions;
-// osl::Mutex m_Mutex;
-
-extern "C" void SAL_CALL registerFunc(FktPtr _pFunc, const char*)
-{
- m_Functions.push_back(_pFunc);
-}
-
-// -----------------------------------------------------------------------------
-AutomaticRegisterHelper::AutomaticRegisterHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions /*, JobList * _pJobList*/)
- :DynamicLibraryHelper(_sDLLName, _aOptions),
- m_bLoadLibraryOK(false)
-{
- // try to get the entry pointer
- FktRegAllPtr pFunc = (FktRegAllPtr) m_pModule->getFunctionSymbol(
- rtl::OUString::createFromAscii( "registerAllTestFunction" ) );
-
- if (pFunc)
- {
- m_bLoadLibraryOK = true;
- // FktRegFuncPtr pRegisterFunc = &DynamicLibraryHelper::registerFunc;
- // pFunc(pRegisterFunc);
- // osl::Guard aGuard(m_Mutex);
- FktRegFuncPtr pRegisterFunc = &registerFunc;
-
- CallbackStructure aCallback;
- aCallback.aRegisterFunction = pRegisterFunc;
-
- aCallback.aCallbackDispatch = &CallbackDispatch;
-
- // special parameter for API testing
- if (_aOptions.hasOpt("-forward"))
- {
- aCallback.psForward = _aOptions.getOpt("-forward").getStr();
- }
-
- // aCallback.pJobList = _pJobList;
-
- //# aCallback.aStartTest = &TestResult_startTest;
- //# aCallback.aAddFailure = &TestResult_addFailure;
- //# aCallback.aAddError = &TestResult_addError;
- //# aCallback.aEndTest = &TestResult_endTest;
- //# aCallback.aShouldStop = &TestResult_shouldStop;
- //# aCallback.aAddInfo = &TestResult_addInfo;
- //# aCallback.aEnterNode = &TestResult_enterNode;
- //# aCallback.aLeaveNode = &TestResult_leaveNode;
-
- aCallback.nBits = FileHelper::createFlags(_aOptions);
-
- pFunc(&aCallback);
-
- if (aCallback.nMagic == aCallback.nMagic2)
- {
- // ok internal simple test done.
- m_aFunctionList = m_Functions;
- }
- else
- {
- // ERROR, the function seams not to be what we thing it's to be.
- fprintf(stderr, "error: Internal check failed. Structure inconsistent, Value Magic2 != Magic.\nPlease recompile your test libraries.");
- exit(-1);
- }
- }
- else
- {
- fprintf(stderr, "warning: Function 'registerAllTestFunction' not found.\n");
- fprintf(stderr, "If you think, you are right, build testshl2 completly new.\n");
- }
-}
-
-void AutomaticRegisterHelper::CallAll(hTestResult _hResult) const
-{
- // can't load the module, break the tests.
- if (m_bLoadLibraryOK == false)
- {
- return;
- }
-
- for (FunctionList::const_iterator it = m_aFunctionList.begin();
- it != m_aFunctionList.end();
- ++it)
- {
- FktPtr pFunc = *it;
- if (pFunc)
- {
- (pFunc)(_hResult);
- }
- }
-}
-
-AutomaticRegisterHelper::~AutomaticRegisterHelper()
-{
- if (getOptions().hasOpt("-verbose"))
- {
- fprintf(stderr, "Dtor AutomaticRegisterHelper.\n");
- }
-}
diff --git a/testshl2/source/codegen/codegen.pl b/testshl2/source/codegen/codegen.pl
deleted file mode 100644
index ab7a68397aeb..000000000000
--- a/testshl2/source/codegen/codegen.pl
+++ /dev/null
@@ -1,601 +0,0 @@
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
-
-use strict;
-use Cwd;
-
-# #/usr/bin/perl
-
-# @lines
-# push(@lines, $line) append
-# pop(@lines) remove last
-# shift(@lines) remove at first
-# unshift(@lines, $line) insert at first
-# $lines[-1] get last
-# foreach $line (@lines)
-
-# $a eq $b compares strings
-# $a == $b compares digits
-
-# split operator
-# ($vorname, $nachname, $email) = split (/\s+/, $person);
-
-my $sCurrentPackage = "";
-my $sCurrentClass = "";
-my @sMethodNames;
-my @sClassNameStack;
-my @sFilenameStack;
-my $sCurrentFilename;
-my $nNoAdditionalAnyMore = 0;
-my $bShowDemo = 1;
-my $sSrcExt = ".cxx";
-
-my $cwd = getcwd();
-
-sub generateMakefileEntry(*$$);
-
-# ------------------------------------------------------------------------------
-sub createFilename
-{
- my $sPackageName = shift;
- my $sFilenameCounter = "$sPackageName$sSrcExt";
- my $sFilename = "$sPackageName";
- my $nCount = 0;
- while ( -e $sFilenameCounter)
- {
- $nCount ++;
- $sFilename = "$sPackageName" . "_$nCount";
- $sFilenameCounter = "$sFilename$sSrcExt";
- }
- push(@sFilenameStack, $sFilename);
-
- $sCurrentFilename = $sFilenameCounter;
- return $sFilenameCounter;
-}
-# ------------------------------------------------------------------------------
-
-sub generateNewPackage(*$)
-{
- local *CPPFILE = shift;
- my $sPackageName = shift;
-
- my $sFilename = createFilename($sPackageName);
- open(CPPFILE, ">$sFilename") || die "can't create source file";
- print CPPFILE "// autogenerated file with codegen.pl\n";
- print CPPFILE "\n";
- print CPPFILE "#include <testshl/simpleheader.hxx>\n";
- print CPPFILE "\n";
- print CPPFILE "namespace $sPackageName\n";
- print CPPFILE "{\n";
-}
-
-# ------------------------------------------------------------------------------
-sub generateNewClass
-{
- my $sClassName = shift;
- print CPPFILE "\n";
- print CPPFILE "class $sClassName : public CppUnit::TestFixture\n";
- print CPPFILE "{\n";
- print CPPFILE "public:\n";
-}
-# ------------------------------------------------------------------------------
-sub closeMethods
-{
- # due to the fact, that this is a function based code, not object based
- # we have to do some hacks, to prevent us from creating wrong code
- if ($sCurrentClass =~ /^$/ || $sCurrentPackage =~ /^$/ )
- {
- return;
- }
-
- # here we create the methods
- # first the setUp() and tearDown()
- print CPPFILE " // initialise your test code values here.\n";
- print CPPFILE " void setUp()\n";
- print CPPFILE " {\n";
- print CPPFILE " }\n";
- print CPPFILE "\n";
- print CPPFILE " void tearDown()\n";
- print CPPFILE " {\n";
- print CPPFILE " }\n";
- print CPPFILE "\n";
-
- print CPPFILE " // insert your test code here.\n";
-
- my $sMethod;
- if ($#sMethodNames >= 0)
- {
- # all found methods
- foreach $sMethod (@sMethodNames)
- {
- print CPPFILE " void $sMethod()\n";
- print CPPFILE " {\n";
- if ($bShowDemo == 1)
- {
- print CPPFILE " // this is demonstration code\n";
- print CPPFILE " // CPPUNIT_ASSERT_MESSAGE(\"a message\", 1 == 1);\n";
- $bShowDemo = 0;
- }
- print CPPFILE " CPPUNIT_ASSERT_STUB();\n";
- print CPPFILE " }\n";
- print CPPFILE "\n";
- }
- }
- else
- {
- # if no methods found, create at least one
- print CPPFILE " // this is only demonstration code\n";
- print CPPFILE " void EmptyMethod()\n";
- print CPPFILE " {\n";
- print CPPFILE " // CPPUNIT_ASSERT_MESSAGE(\"a message\", 1 == 1);\n";
- print CPPFILE " CPPUNIT_ASSERT_STUB();\n";
- print CPPFILE " }\n";
- print CPPFILE "\n";
- }
-
- # create the autoregister code
- print CPPFILE " // Change the following lines only, if you add, remove or rename \n";
- print CPPFILE " // member functions of the current class, \n";
- print CPPFILE " // because these macros are need by auto register mechanism.\n";
- print CPPFILE "\n";
-
- print CPPFILE " CPPUNIT_TEST_SUITE($sCurrentClass);\n";
- push(@sClassNameStack, $sCurrentClass);
-
- my $nCount = 0;
- if ($#sMethodNames >= 0)
- {
- foreach $sMethod (@sMethodNames)
- {
- print CPPFILE " CPPUNIT_TEST($sMethod);\n";
- $nCount ++;
- }
- # empty the method list
- my $i;
- for ($i = 0;$i < $nCount;$i++)
- {
- pop(@sMethodNames);
- }
- }
- else
- {
- print CPPFILE " CPPUNIT_TEST(EmptyMethod);\n";
- }
- print CPPFILE " CPPUNIT_TEST_SUITE_END();\n";
-}
-
-# ------------------------------------------------------------------------------
-sub closeClass
-{
- # my $sClassName = shift;
- if ($sCurrentClass =~ /^$/)
- {
- return;
- }
- print CPPFILE "}; // class $sCurrentClass\n";
- print CPPFILE "\n";
- $sCurrentClass = "";
-}
-# ------------------------------------------------------------------------------
-
-sub closePackage
-{
- # my $sPackageName = shift;
- if ($sCurrentPackage =~ /^$/)
- {
- return;
- }
- # create the autoregister code
- print CPPFILE "// -----------------------------------------------------------------------------\n";
- my $nCount = 0;
- my $sClassName;
- foreach $sClassName (@sClassNameStack)
- {
- print CPPFILE "CPPUNIT_TEST_SUITE_NAMED_REGISTRATION($sCurrentPackage" . "::" . "$sClassName, \"$sCurrentPackage\");\n";
- $nCount ++;
- }
- # empty the method list
- my $i;
- for ($i = 0;$i < $nCount;$i++)
- {
- pop(@sClassNameStack);
- }
-
- print CPPFILE "} // namespace $sCurrentPackage\n";
- print CPPFILE "\n";
-
- print CPPFILE "
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-";
- # if the variable nNoAdditionalAnyMore is set to one, we insert a remark before
- # the macro NOADDITIONAL; to prevent us from linker problems.
- if ($nNoAdditionalAnyMore == 1)
- {
- print CPPFILE "// ";
- }
- print CPPFILE "NOADDITIONAL;\n";
- print CPPFILE "\n";
-
- close(CPPFILE);
-
- $nNoAdditionalAnyMore = 1;
-
- $sCurrentPackage = "";
-}
-
-# ------------------------------------------------------------------------------
-
-# sub generateCppSource
-# {
-# my $sPackageName = shift;
-# my $sClassName = shift;
-# my $sMethodName = shift;
-#
-#
-# open(CPPFILE, ">$sFilename") || die "can't create cxx source file";
-# print CPPFILE "// autogenerated file\n";
-# close(CPPFILE);
-# }
-# ------------------------------------------------------------------------------
-sub walkThroughJobFile
-{
- my $filename = shift;
-
- open(FILE, $filename) || die "can't open $filename\n";
-
- print "start jobfile interpreter.\n";
- my $line;
- while($line = <FILE>)
- {
- chomp($line);
- # DOS Hack grrrr...
- while ($line =~ /
-$/)
- {
- $line = substr($line, 0, -1);
- }
-
- if ($line =~ /^\#/ || $line =~ /^$/)
- {
- # remark or empty line
- }
- else
- {
- if ($line =~ /^\w+/) # must start with a word character
- {
- # print "$line\n";
- my $sPackageName = "";
- my $sClassName = "";
- my $sMethodName = "";
- my @names;
- @names = split(/\./, $line);
- if (exists $names[0])
- {
- $sPackageName = $names[0];
- }
- if (exists $names[1])
- {
- $sClassName = $names[1];
- }
- if (exists $names[2])
- {
- $sMethodName = $names[2];
- }
-
- if ($sClassName =~ /^$/)
- {
- print "error: in $line, no class name exist. Build no code.\n";
- }
- # test if it also works without methods
- # elsif ($sMethodName =~ /^$/)
- # {
- # print "error: in $line, no method name exist.\n";
- # }
- else
- {
- if ($sMethodName =~ /^$/)
- {
- print "warning: in $line, no method name exist, create only one member function.\n";
- }
-
- print "build code for: ${sPackageName}.${sClassName}.${sMethodName}\n";
-
- if ($sCurrentPackage ne $sPackageName)
- {
- closeMethods();
- closeClass();
- closePackage();
-
- $sCurrentPackage = $sPackageName;
- generateNewPackage(CPPFILE, $sPackageName);
- }
- if ($sCurrentClass ne $sClassName)
- {
- closeMethods();
- closeClass();
- $sCurrentClass = $sClassName;
- generateNewClass($sClassName);
- }
- if ($sMethodName)
- {
- push(@sMethodNames, $sMethodName);
- }
- }
- }
- }
- }
-
- closeMethods();
- closeClass();
- closePackage();
- close(FILE);
-
- print "done.\n\nThe following files have been created in the current directory:\n";
-
- my $sFilename;
- foreach $sFilename (@sFilenameStack)
- {
- print " ${sFilename}${sSrcExt}\n";
- }
- print "\n";
-}
-
-# ------------------------------------------------------------------------------
-sub checkMakefileNumber
-{
- my $sTargetName = shift;
-
- # This function gives back the lowest number for SHL\dTARGET
- open(MAKEFILE, "makefile.mk") || return -1;
-
- my $line;
- my $nNumber;
- my @aNumbers;
- my $i;
- for($i = 1;$i < 10;$i++)
- {
- $aNumbers[$i] = 0;
- }
-
- my $nReplacePos = -1;
- while($line = <MAKEFILE>)
- {
- chomp($line);
-
- if ($line =~ /^SHL(\d)TARGET/)
- {
- $aNumbers[$1] = 1;
- $line =~ /^SHL(\d)TARGET=\s*(\S+)\s*/;
-
- print "Target: $2\n";
- if ($sTargetName eq $2)
- {
- print "info: Targetname already exist.\n";
- $nReplacePos = $1;
- }
- }
- }
- close(MAKEFILE);
-
- my $nFirstFree = 0;
- for($i = 1;$i < 10;$i++)
- {
- if ($aNumbers[$i] == 0)
- {
- $nFirstFree = $i;
- last;
- }
- }
- return $nFirstFree, $nReplacePos;
-}
-# ------------------------------------------------------------------------------
-sub createNewMakefile($$$)
-{
- my $sNewMakefileName = shift;
- my $sTargetName = shift;
- my $nNumber = shift;
- local *MAKEFILE;
-
- # this function split a makefile into two parts,
- open(MAKEFILE, "makefile.mk") || return;
- my @lines = <MAKEFILE>;
- close(MAKEFILE);
-
- # print "info: Makefile has $#lines lines.\n";
-
- # search a point, where to insert the new makefile part.
- my $nTargetMK = -1;
- my $i;
- for ($i = $#lines; $i > 0; $i--)
- {
- if ($lines[$i] =~ /\.INCLUDE.*target.mk\s$/)
- {
- $nTargetMK = $i;
- last;
- }
- }
- if ($nTargetMK > 0)
- {
- # print "info: target.mk found, is in line $nTargetMK\n";
-
- # print "@lines[0]";
- # print "@lines[1]";
- # print "@lines[2]";
- # print "@lines[$nTargetMK - 2]";
- # print "@lines[$nTargetMK - 1]";
- # print "@lines[$nTargetMK]";
-
- local *OUT_MAKEFILE;
- open(OUT_MAKEFILE, ">$sNewMakefileName") || return;
- for ($i = 0;$i < ($nTargetMK - 2); $i++)
- {
- print OUT_MAKEFILE $lines[$i];
- }
-
- generateMakefileEntry(OUT_MAKEFILE, $sTargetName, $nNumber);
-
- for ($i = ($nTargetMK - 2);$i <= $#lines; $i++)
- {
- print OUT_MAKEFILE $lines[$i];
- }
- close(OUT_MAKEFILE);
- }
-}
-# ------------------------------------------------------------------------------
-
-sub generateMakefileEntry(*$$)
-{
- # my MAKEFILE = shift;
- local *_MAKEFILE = shift;
- my $sTargetName = shift;
- my $nNumber = shift;
-
- # open(_MAKEFILE, ">makefile.add") || die "can't open makefile.add";
-
- print _MAKEFILE "# BEGIN ----------------------------------------------------------------\n";
- print _MAKEFILE "# auto generated Target:$sTargetName by codegen.pl \n";
- print _MAKEFILE "SHL${nNumber}OBJS= ";
- my $sFilename;
- foreach $sFilename (@sFilenameStack)
- {
- print _MAKEFILE " \\\n";
- print _MAKEFILE " \$(SLO)\$/$sFilename.obj";
- }
- print _MAKEFILE "\n\n";
-
- # targetname
- print _MAKEFILE "SHL${nNumber}TARGET= $sTargetName\n";
- # additional libraries
- print _MAKEFILE "SHL${nNumber}STDLIBS=\\\n";
- print _MAKEFILE " \$(SALLIB) \\\n";
- # LLA: added by sb 18th jun 2003 (announced)
- print _MAKEFILE " \$(CPPUNITLIB) \n";
- # link static cppunit library
- # print _MAKEFILE ".IF \"\$(GUI)\" == \"WNT\"\n";
- # print _MAKEFILE "SHL${nNumber}STDLIBS+= \$(SOLARLIBDIR)\$/cppunit.lib\n";
- # print _MAKEFILE ".ENDIF\n";
- # print _MAKEFILE ".IF \"\$(GUI)\" == \"UNX\"\n";
- # print _MAKEFILE "SHL${nNumber}STDLIBS+=\$(SOLARLIBDIR)\$/libcppunit\$(DLLPOSTFIX).a\n";
- # print _MAKEFILE ".ENDIF\n";
- print _MAKEFILE "\n";
- print _MAKEFILE "SHL${nNumber}IMPLIB= i\$(SHL${nNumber}TARGET)\n";
- print _MAKEFILE "# SHL${nNumber}DEF= \$(MISC)\$/\$(SHL${nNumber}TARGET).def\n";
- print _MAKEFILE "\n";
- # DEF name
- print _MAKEFILE "DEF${nNumber}NAME =\$(SHL${nNumber}TARGET)\n";
- print _MAKEFILE "# DEF${nNumber}EXPORTFILE= export.exp\n";
- print _MAKEFILE "SHL${nNumber}VERSIONMAP= export.map\n";
- print _MAKEFILE "# auto generated Target:$sTargetName\n";
- print _MAKEFILE "# END ------------------------------------------------------------------\n\n";
-
- # close(_MAKEFILE);
-}
-
-# ------------------------------------------------------------------------------
-sub usage
-{
- print "usage:\ncodegen.pl joblist [targetname]\n";
- print "\n(c) Sun Microsystems Inc. 2003\n";
- print "
-This is a testshl2 codegenerator which creates compilable C++ source files
-with stub functions for all given test routines from the jobfile.
-Also generate a makefile entry which is insert in the makefile.new
-if a makefile.mk already exist or this tool creates a makefile.add. Which
-has to add into a new makefile.mk by hand.
-Also generate a export.map file, if no one exist.
-";
- exit(1);
-}
-# -------------------------------- main function --------------------------------
-
-sub main
-{
- if ($#ARGV < 0)
- {
- usage();
- }
- my $jobfile = $ARGV[0];
- my $sTargetName;
- if ($#ARGV < 2)
- {
- # remove .sce
- $sTargetName = $jobfile;
- $sTargetName =~ s/\.\w*//;
- }
- else
- {
- $sTargetName = $ARGV[1];
- }
- print "Test code generator\n\n";
-
- if (! -e $jobfile)
- {
- print "error: given jobfile '$jobfile' doesn't exist.\n";
- exit(1);
- }
- walkThroughJobFile($jobfile);
-
- # generate makefile
-
- if (-e "makefile.mk")
- {
- my $n;
- my $nReplacePos;
- ($n, $nReplacePos) = checkMakefileNumber($sTargetName);
- # $n == -1 no makefile
- # $n == 0 no free number
- # $n 1..9 ok.
- if ($n > 0)
- {
- my $sNewMakefileName = "makefile.new";
- print "Makefile: Add the 'SHL${n}TARGET' to the file '$sNewMakefileName'\n";
- createNewMakefile($sNewMakefileName, $sTargetName, $n);
- }
- }
- else
- {
- print "warning: No makefile.mk found, please add the content of makefile.add to a makefile.mk file\n";
- local *MAKEFILE;
- open(MAKEFILE, ">makefile.add");
- generateMakefileEntry(MAKEFILE, $sTargetName, 1);
- close(MAKEFILE);
- }
- print "\n";
- # this is the old export.exp method
- # if (! -e "export.exp")
- # {
- # print "info: create export.exp file\n";
- # open(EXPORTEXP, ">export.exp") || die "can't create export.exp";
- # print EXPORTEXP "registerAllTestFunction\n";
- # close(EXPORTEXP);
- # }
- # else
- # {
- # print "The file 'export.exp' file already exist, please make sure that it contains the entry 'registerAllTestFunction'.\n";
- # }
- if (! -e "export.map")
- {
- local *EXPORTMAP;
- print "info: create export.map file\n";
- open(EXPORTMAP, ">export.map") || die "can't create export.map";
- print EXPORTMAP "UDK_3.0 {\n";
- print EXPORTMAP " global:\n";
- print EXPORTMAP " registerAllTestFunction;\n";
- print EXPORTMAP "\n";
- print EXPORTMAP " local:\n";
- print EXPORTMAP " *;\n";
- print EXPORTMAP "};\n";
- close(EXPORTMAP);
- }
- else
- {
- print "The file 'export.map' file already exist, please make sure that it contains the entry 'registerAllTestFunction'.\n";
- }
-}
-
-# ------------------------------------------------------------------------------
-
-main();
diff --git a/testshl2/source/cppunit/cmdlinebits.cxx b/testshl2/source/cppunit/cmdlinebits.cxx
deleted file mode 100644
index 061e82fe2d73..000000000000
--- a/testshl2/source/cppunit/cmdlinebits.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#ifdef WNT
-# define UNDER_WINDOWS_DEBUGGING
-# include "testshl/winstuff.hxx"
-#endif /* WNT */
-
-#include <stdio.h>
-#include <testshl/cmdlinebits.hxx>
-#include "testshl/checkboom.hxx"
-
-#include <testshl/autoregister/callbackstructure.h>
-#include <osl/diagnose.h>
-#include <rtl/tres.h>
-#include <testshl/stringhelper.hxx>
-
-extern CallbackStructure aGlobalStructure;
-
-sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag );
-
-// sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag )
-// {
-// return( ( _nBits & _nFlag ) == _nFlag );
-// }
-
-void CheckBoom(bool bCondition, std::string const& msg)
-{
- (void) msg; // avoid warning
- if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_BOOM ) )
- {
- /* force an assertion on false state */
- if ( !bCondition ) {
-#ifdef UNDER_WINDOWS_DEBUGGING
- WinDebugBreak();
-#else
- OSL_ENSURE( false, msg.c_str() );
-#endif
- }
- }
-}
-
-void CheckBoom(bool bCondition, rtl::OUString const& msg)
-{
- if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_BOOM ) )
- {
- /* force an assertion on false state */
- rtl::OString sMessage;
- sMessage <<= msg;
- if ( !bCondition ) {
-#ifdef UNDER_WINDOWS_DEBUGGING
- WinDebugBreak();
-#else
- OSL_ENSURE( false, sMessage.getStr() );
-#endif
- }
- }
-}
-
-const char* getForwardString()
-{
- return aGlobalStructure.psForward;
-}
-
-// -----------------------------------------------------------------------------
-// ----------------------------- own printf method -----------------------------
-// -----------------------------------------------------------------------------
-
-// bool isVerbose()
-// {
-// if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_VERBOSE ) )
-// {
-// return true;
-// }
-// return false;
-// }
-//
-// bool isQuiet()
-// {
-// if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_QUIET ) )
-// {
-// return true;
-// }
-// return false;
-// }
-//
-// void impl_t_print(const char* _pFormatStr, va_list &args)
-// {
-// if (! isQuiet())
-// {
-// printf("# ");
-// vprintf(_pFormatStr, args);
-// }
-// }
-//
-// void t_print(const char* _pFormatStr, ...)
-// {
-// va_list args;
-// va_start( args, _pFormatStr );
-// impl_t_print(_pFormatStr, args);
-// va_end( args );
-// }
-//
-// void t_print(T_Print_Params _eType, const char* _pFormatStr, ...)
-// {
-// if (_eType == T_VERBOSE && isVerbose())
-// {
-// // if T_VERBOSE and we should be verbose, print info
-// va_list args;
-// va_start( args, _pFormatStr );
-// impl_t_print(_pFormatStr, args);
-// va_end( args );
-// }
-// }
diff --git a/testshl2/source/cppunit/joblist.cxx b/testshl2/source/cppunit/joblist.cxx
deleted file mode 100644
index 18f4c5aff4cd..000000000000
--- a/testshl2/source/cppunit/joblist.cxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <fstream>
-#include <rtl/string.hxx>
-#include "testshl/joblist.hxx"
-
-#define C_SEPARATOR_LIST " \t,;:#"
-JobList::JobList()
- :ppsJobList(NULL)
-{}
-
-// -----------------------------------------------------------------------------
-bool JobList::isInCurrentEnvironment(std::string const& _sString)
-{
- int nSpace = 0;
- std::string sSearchString = _sString;
- bool bEnd = false;
- // run through the hole given string,
- std::string sEnv;
-
- do {
- nSpace = sSearchString.find_first_of(C_SEPARATOR_LIST);
- if (nSpace < 0)
- {
- sEnv = sSearchString;
- bEnd = true;
- }
- else
- {
- sEnv = sSearchString.substr(0, nSpace);
- sSearchString = sSearchString.substr(nSpace + 1);
- }
- if (sEnv.length() > 0)
- {
- // cout << sEnv << endl;
-#ifdef LINUX
- int nLinux = sEnv.find("unxlng");
- if (nLinux >= 0)
- {
- // found unxlng
- return true;
- }
-#endif
-#ifdef SOLARIS
- int nSolaris = sEnv.find("unxsol");
- if (nSolaris >= 0)
- {
- // found unxsol
- return true;
- }
-#endif
-#ifdef WNT
- int nWindows = sEnv.find("wnt");
- if (nWindows >= 0)
- {
- // found wnt
- return true;
- }
-#endif
- }
- } while ( !bEnd );
- return false;
-}
-
-std::string JobList::trim(std::string const& _sStringToTrim)
-{
- rtl::OString sStr(_sStringToTrim.c_str());
- sStr = sStr.trim();
- return std::string(sStr.getStr());
-}
-
-// -----------------------------------------------------------------------------
-bool JobList::readfile(std::string const& _sFilename, JobType _nJobType)
-{
- // StringList aJobList;
- m_aJobList.clear();
-
- std::ifstream in(_sFilename.c_str(), std::ios::in);
-
- if (!in)
- {
- // fprintf(stderr, "warning: Can't open job file: %s\n", _sFilename.c_str());
- return false;
- }
- else
- {
- if (_nJobType == JOB_EXCLUDE_LIST)
- {
- fprintf(stderr, "warning: There exist a job exclusion list file: %s\n", _sFilename.c_str());
- }
-
- // std::cout << "Check for signal" << std::endl;
- std::string sLine;
- while (std::getline(in, sLine))
- {
- if (sLine.size() > 0)
- {
- char ch = sLine[0];
- if (ch != '#' &&
- isspace(ch) == 0)
- {
- sLine = trim(sLine);
-
- // m_aJobList.push_back( sLine );
- int nSpace = sLine.find_first_of(C_SEPARATOR_LIST);
- if (nSpace < 0)
- {
- m_aJobList[sLine] = JOB_UNKNOWN;
- }
- else
- {
- // found a separator
- std::string sTest = sLine.substr(0, nSpace);
- std::string sRest = sLine.substr(nSpace + 1);
- if (isInCurrentEnvironment(sRest))
- {
- m_aJobList[sTest] = JOB_UNKNOWN;
- }
- }
- }
- }
- }
-
- // inclusion list
-/*
- int nSize = m_aJobList.size();
-
- ppsJobList = (char**) malloc((nSize + 1) * sizeof(char*));
-
- int nIdx = 0;
- StringList::const_iterator aItEnd = m_aJobList.end();
- for(StringList::const_iterator it = m_aJobList.begin();
- it != aItEnd; ++it)
- {
- std::string sValue = *it;
- char* psTestFkt = (char*) malloc(sValue.size() + 1);
- strcpy(psTestFkt, sValue.c_str());
- ppsJobList[nIdx] = psTestFkt;
- ++nIdx;
- }
-
- ppsJobList[nIdx] = NULL;
-*/
- }
- return true;
-}
-
-// -----------------------------------------------------------------------------
-int JobList::getJobListEntry(std::string const& _sIndexName)
-{
- if (m_aJobList.find(_sIndexName) != m_aJobList.end())
- {
- return m_aJobList[_sIndexName];
- }
- return JOB_NOT_FOUND;
-}
-
-// -----------------------------------------------------------------------------
-void JobList::setJobListEntry(std::string const& _sIndexName, int _nValue)
-{
- // if (m_aJobList.find(_sIndexName) == m_aJobList.end())
- // {
- m_aJobList[_sIndexName] = _nValue;
- // }
- // else
- // {
- // fprintf(stderr, "error: test function '%s' already exist.\n", _sIndexName);
- // }
-}
-
-// -----------------------------------------------------------------------------
-JobList::~JobList()
-{
- int nIdx = 0;
- if (ppsJobList)
- {
- while(ppsJobList[nIdx] != NULL)
- {
- free(ppsJobList[nIdx]);
- ++nIdx;
- }
- free(ppsJobList);
- }
-}
-// -----------------------------------------------------------------------------
-/*
- bool JobList::checkFilter(JobList m_aJobFilter, std::string const& _sNodeName, std::string const& _sName)
- {
- std::string sFilter = m_aJobFilter.m_aJobList.begin();
- }
-*/
diff --git a/testshl2/source/cppunit/makefile.mk b/testshl2/source/cppunit/makefile.mk
deleted file mode 100644
index 05e5bfa3fb69..000000000000
--- a/testshl2/source/cppunit/makefile.mk
+++ /dev/null
@@ -1,99 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=testshl2
-TARGET=testshl2
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-# ENABLE_RTTI=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# CXXFILES = \
-# querytemplate.cxx \
-# stringhelper.cxx
-
-# ENVCFLAGSCXX+=-DCPPUNIT_BUILD_DLL
-
-CPPUNIT_TESTSHL_SLOFILES = \
- $(SLO)$/joblist.obj \
- $(SLO)$/t_print.obj \
- $(SLO)$/signaltest.obj
-
-CPPUNIT_STATIC_SOLFILES = \
- $(SLO)$/cmdlinebits.obj \
- $(SLO)$/tresregister.obj \
- $(SLO)$/tresstatewrapper.obj \
- $(SLO)$/registertestfunction.obj
-
-
-SLOFILES = \
- $(CPPUNIT_TESTSHL_SLOFILES) \
- $(CPPUNIT_STATIC_SOLFILES)
-#-------------------------------------------------------------------------------
-# This is statically cppunit library
-LIB1TARGET= $(LB)$/$(TARGET).lib
-LIB1OBJFILES= \
- $(SLOFILES)
-
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"=="GCC"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-LIB1FILES=$(LB)$/c5t_winstuff.lib
-.ENDIF
-
-.IF "$(GUI)" == "UNX"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-
-#-------------------------------------------------------------------------------
-TARGET2=c5t_no_regallfkt
-LIB2TARGET= $(LB)$/$(TARGET2).lib
-LIB2OBJFILES= \
- $(CPPUNIT_TESTSHL_SLOFILES)
-
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"=="GCC"
-LIB2ARCHIV=$(LB)$/lib$(TARGET2)$(DLLPOSTFIX).a
-.ENDIF
-.ENDIF
-
-.IF "$(GUI)" == "UNX"
-LIB2ARCHIV=$(LB)$/lib$(TARGET2)$(DLLPOSTFIX).a
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/testshl2/source/cppunit/registertestfunction.cxx b/testshl2/source/cppunit/registertestfunction.cxx
deleted file mode 100644
index 74c70ee55ab1..000000000000
--- a/testshl2/source/cppunit/registertestfunction.cxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-#include <testshl/simpleheader.hxx>
-#include <testshl/additionalfunc.hxx>
-
-extern "C" void SAL_CALL testAllRegisteredFunctions(hTestResult _pResult)
-{
- CppUnit::TestFactoryRegistry::testRegistries(_pResult);
- // CppUnit::Test* tp = CppUnit::TestFactoryRegistry::getRegistry("rtl_OUString").makeTest();
- // tp->run(pResult);
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------- RegisterTestFunctions ----------------------------
-// -----------------------------------------------------------------------------
-
-extern "C" void SAL_CALL RegisterTestFunctions(FktRegFuncPtr _pFunc)
-{
- if (_pFunc)
- {
- (_pFunc)(&testAllRegisteredFunctions, "");
- }
- else
- {
- // error, FktRegFuncPtr not given
- }
- RegisterAdditionalFunctions(_pFunc);
-}
diff --git a/testshl2/source/cppunit/result/SynchronizedObject.cpp b/testshl2/source/cppunit/result/SynchronizedObject.cpp
deleted file mode 100644
index 73de43b8c543..000000000000
--- a/testshl2/source/cppunit/result/SynchronizedObject.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <cppunit/SynchronizedObject.h>
-
-
-namespace CppUnit
-{
-
-
-
-
-SynchronizedObject::SynchronizedObject( SynchronizationObject *syncObject )
- : m_syncObject( syncObject == 0 ? new SynchronizationObject() :
- syncObject )
-{
-}
-
-
-SynchronizedObject::~SynchronizedObject()
-{
- delete m_syncObject;
-}
-
-
-/** Accept a new synchronization object for protection of this instance
- * TestResult assumes ownership of the object
- */
-void
-SynchronizedObject::setSynchronizationObject( SynchronizationObject *syncObject )
-{
- delete m_syncObject;
- m_syncObject = syncObject;
-}
-
-
-} // namespace CppUnit
-
diff --git a/testshl2/source/cppunit/result/TestResult.cpp b/testshl2/source/cppunit/result/TestResult.cpp
deleted file mode 100644
index 5fa5e444e540..000000000000
--- a/testshl2/source/cppunit/result/TestResult.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <cppunit/TestFailure.h>
-#include <testshl/result/TestListener.h>
-#include "testshl/getopt.hxx"
-#include <testshl/result/TestResult.h>
-#include <algorithm>
-#include "testshl/result/outputter.hxx"
-#include <cppunit/Test.h>
-#include <testshl/cmdlinebits.hxx>
-
-namespace CppUnit {
-
-/// Construct a TestResult
-TestResult::TestResult( GetOpt &_pOptions, SynchronizationObject *syncObject )
- : SynchronizedObject( syncObject ),
- m_aOptionHelper(_pOptions),
- m_nExitValue(0)
-{
- reset();
-}
-
-
-/// Destroys a test result
-TestResult::~TestResult()
-{
-}
-
-
-/** Resets the result for a new run.
- *
- * Clear the previous run result.
- */
-void
-TestResult::reset()
-{
- ExclusiveZone zone( m_syncObject );
- m_stop = false;
-}
-
-
-/** Adds an error to the list of errors.
- * The passed in exception
- * caused the error
- */
-void
-TestResult::addError( Test *test,
- Exception *e, ErrorType::num _eType )
-{
- TestFailure aTestFailure( test, e, _eType );
- addFailure( aTestFailure );
-}
-
-
-/** Adds a failure to the list of failures. The passed in exception
- * caused the failure.
- */
-void
-TestResult::addFailure( Test *test, Exception *e )
-{
- TestFailure aTestFailure( test, e, ErrorType::ET_FAILURE );
- addFailure( aTestFailure );
-}
-
-
-/** Called to add a failure to the list of failures.
- */
-void
-TestResult::addFailure( const TestFailure &failure )
-{
- ExclusiveZone zone( m_syncObject );
-
- // LLA:
- // this set the global returnvalue, due to the fact, there occurs a failure, we have to return a non zero value
- // at the moment this seams to be a good place.
- setExitValue(1);
-
- for ( TestListeners::iterator it = m_listeners.begin();
- it != m_listeners.end();
- ++it )
- {
- TestListener *pListener = *it;
- pListener->addFailure( failure );
- }
-}
-
-
-/// Informs the result that a test will be started.
-void
-TestResult::startTest( Test *test )
-{
- ExclusiveZone zone( m_syncObject );
- if (m_aOptionHelper.isVerbose())
- {
- std::string aStr;
- if (test)
- {
- aStr = getNodeName();
- aStr += ".";
- aStr += test->getName();
- }
- // fprintf(stderr, "Start test: %s\n", aStr.c_str());
- t_print( T_VERBOSE, "Start test: %s\n", aStr.c_str());
- }
-
- for ( TestListeners::iterator it = m_listeners.begin();
- it != m_listeners.end();
- ++it )
- {
- TestListener *pListener = *it;
- pListener->startTest( test );
- }
-}
-
-
-/// Informs the result that a test was completed.
-void
-TestResult::endTest( Test *test )
-{
- ExclusiveZone zone( m_syncObject );
- for ( TestListeners::iterator it = m_listeners.begin();
- it != m_listeners.end();
- ++it )
- {
- TestListener *pListener = *it;
- pListener->endTest( test );
- }
-}
-
-
-/// Returns whether testing should be stopped
-bool
-TestResult::shouldStop() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_stop;
-}
-
-
-/// Stop testing
-void
-TestResult::stop()
-{
- ExclusiveZone zone( m_syncObject );
- m_stop = true;
-}
-
-
-void
-TestResult::addListener( TestListener *listener )
-{
- ExclusiveZone zone( m_syncObject );
- m_listeners.push_back( listener );
-}
-
-
-void
-TestResult::removeListener ( TestListener *listener )
-{
- ExclusiveZone zone( m_syncObject );
-#if defined(_MSC_VER) && (_MSC_VER >=1400)
- m_listeners.erase( remove( m_listeners.begin(),
-#else
- m_listeners.erase( std::remove( m_listeners.begin(),
-#endif
- m_listeners.end(),
- listener ),
- m_listeners.end());
-}
-
-void
-TestResult::addInfo(Test *test, const char* _aStr)
-{
- ExclusiveZone zone( m_syncObject );
- for ( TestListeners::iterator it = m_listeners.begin();
- it != m_listeners.end();
- ++it )
- {
- TestListener *pListener = *it;
- pListener->addInfo( test, _aStr );
- }
-}
-
-// old: void
-// old: TestResult::enterNode(const char* _aStr)
-// old: {
-// old: ExclusiveZone zone( m_syncObject );
-// old: for ( TestListeners::iterator it = m_listeners.begin();
-// old: it != m_listeners.end();
-// old: ++it )
-// old: {
-// old: TestListener *pListener = *it;
-// old: pListener->enterNode( _aStr );
-// old: }
-// old: }
-// old:
-// old: void
-// old: TestResult::leaveNode(const char* _aStr)
-// old: {
-// old: ExclusiveZone zone( m_syncObject );
-// old:
-// old: for ( TestListeners::iterator it = m_listeners.begin();
-// old: it != m_listeners.end();
-// old: ++it )
-// old: {
-// old: TestListener *pListener = *it;
-// old: pListener->leaveNode( _aStr );
-// old: }
-// old: }
-
-void TestResult::enterNode(const char* _sNode)
-{
- ExclusiveZone zone( m_syncObject );
- m_aCurrentNodeNames.push_back(std::string(_sNode));
-}
-
-void TestResult::leaveNode(const char* /*_sNode*/)
-{
- ExclusiveZone zone( m_syncObject );
- std::string sBack = m_aCurrentNodeNames.back();
- m_aCurrentNodeNames.pop_back();
-
- // due to a -Wall warning, comment out.
- // if (sBack != std::string(_sNode))
- // {
- // volatile int dummy = 0;
- // // problem?!
- // }
-}
-
-std::string TestResult::getNodeName()
-{
- std::string sName;
- for (std::vector<std::string>::const_iterator it = m_aCurrentNodeNames.begin();
- it != m_aCurrentNodeNames.end();
- ++it)
- {
- if (sName.size() != 0)
- {
- sName += ".";
- }
- sName += *it;
- }
- return sName;
-}
-
-// -----------------------------------------------------------------------------
-bool TestResult::isAllowedToExecute(std::string const& _sName)
-{
- return m_aOptionHelper.isAllowedToExecute(getNodeName(), _sName);
-}
-// -----------------------------------------------------------------------------
-bool TestResult::isOptionWhereAmI()
-{
- return m_aOptionHelper.isOptionWhereAmI();
-}
-
-// -----------------------------------------------------------------------------
-void TestResult::print(Outputter&)
-{
-}
-
-} // namespace CppUnit
diff --git a/testshl2/source/cppunit/result/TestResultCollector.cpp b/testshl2/source/cppunit/result/TestResultCollector.cpp
deleted file mode 100644
index e3913219b541..000000000000
--- a/testshl2/source/cppunit/result/TestResultCollector.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <cppunit/TestFailure.h>
-#include <testshl/result/TestResultCollector.h>
-
-
-namespace CppUnit
-{
-
-
-TestResultCollector::TestResultCollector( TestResult* _pResult, SynchronizationObject *syncObject )
- : TestSucessListener( syncObject ),
- m_pResult(_pResult),
- m_testErrors(0)
-{
- reset();
-}
-
-
-TestResultCollector::~TestResultCollector()
-{
- TestFailures::iterator itFailure = m_failures.begin();
- while ( itFailure != m_failures.end() )
- {
- TestFailureEnvelope *pEnvelope = *itFailure++;
- TestFailure *pFailure = pEnvelope->getTestFailure();
- delete pFailure;
- }
-}
-
-
-void
-TestResultCollector::reset()
-{
- TestSucessListener::reset();
-
- ExclusiveZone zone( m_syncObject );
- m_testErrors = 0;
- m_tests.clear();
- m_failures.clear();
-}
-
-
-void
-TestResultCollector::startTest( Test *test )
-{
- ExclusiveZone zone (m_syncObject);
-
- m_tests.push_back( new TestEnvelope(test, m_pResult->getNodeName()) );
-}
-
-void
-TestResultCollector::endTest( Test * )
-{
- // ExclusiveZone zone (m_syncObject);
- // Nothing!
-}
-
-
-void
-TestResultCollector::addFailure( const TestFailure &failure )
-{
- TestSucessListener::addFailure( failure );
-
- ExclusiveZone zone( m_syncObject );
- if ( failure.isError() )
- ++m_testErrors;
- m_failures.push_back( new TestFailureEnvelope(failure.clone(), m_pResult->getNodeName()) );
-}
-
-
-/// Gets the number of run tests.
-int
-TestResultCollector::runTests() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_tests.size();
-}
-
-
-/// Gets the number of detected errors (uncaught exception).
-int
-TestResultCollector::testErrors() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_testErrors;
-}
-
-
-/// Gets the number of detected failures (failed assertion).
-int
-TestResultCollector::testFailures() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_failures.size() - m_testErrors;
-}
-
-
-/// Gets the total number of detected failures.
-int
-TestResultCollector::testFailuresTotal() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_failures.size();
-}
-
-
-/// Returns a the list failures (random access collection).
-const TestResultCollector::TestFailures &
-TestResultCollector::failures() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_failures;
-}
-
-
-const TestResultCollector::Tests &
-TestResultCollector::tests() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_tests;
-}
-
-void TestResultCollector::addInfo(Test *_pTest, const char* _sInfo)
-{
- ExclusiveZone zone( m_syncObject );
- m_aInfos.push_back(new TestInfo(_pTest, _sInfo));
-}
-
-std::string TestResultCollector::getInfo(Test *_pTest)
-{
- for (TestInfos::const_iterator it = m_aInfos.begin();
- it != m_aInfos.end();
- ++it)
- {
- TestInfo *pInfo = *it;
- Test *pTest = pInfo->getTest();
- if (pTest == _pTest)
- {
- std::string sInfo = pInfo->getString();
- return sInfo;
- }
- }
- return std::string();
-}
-
-
-} // namespace CppUnit
-
diff --git a/testshl2/source/cppunit/result/TestSucessListener.cpp b/testshl2/source/cppunit/result/TestSucessListener.cpp
deleted file mode 100644
index d8f8268f09aa..000000000000
--- a/testshl2/source/cppunit/result/TestSucessListener.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-
-#include <testshl/result/TestSucessListener.h>
-
-
-
-namespace CppUnit
-{
-
-
-TestSucessListener::TestSucessListener( SynchronizationObject *syncObject )
- : SynchronizedObject( syncObject )
- , m_sucess( true )
-{
-}
-
-
-TestSucessListener::~TestSucessListener()
-{
-}
-
-
-void
-TestSucessListener::reset()
-{
- ExclusiveZone zone( m_syncObject );
- m_sucess = true;
-}
-
-
-void
-TestSucessListener::addFailure( const TestFailure & )
-{
- ExclusiveZone zone( m_syncObject );
- m_sucess = false;
-}
-
-
-bool
-TestSucessListener::wasSuccessful() const
-{
- ExclusiveZone zone( m_syncObject );
- return m_sucess;
-}
-
-
-} // namespace CppUnit
-
diff --git a/testshl2/source/cppunit/result/TextTestResult.cpp b/testshl2/source/cppunit/result/TextTestResult.cpp
deleted file mode 100644
index 2ad271ded7de..000000000000
--- a/testshl2/source/cppunit/result/TextTestResult.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <cppunit/Exception.h>
-#include <cppunit/NotEqualException.h>
-#include <cppunit/Test.h>
-#include <cppunit/TestFailure.h>
-#include <testshl/result/TextTestResult.h>
-// #include <TextTestResult.h>
-//!io #include <iostream>
-
-namespace CppUnit {
-
-
-TextTestResult::TextTestResult(GetOpt& _aOptions)
- :TestResult(_aOptions),
- m_aResulter(this)
-{
- addListener( &m_aResulter );
-}
-
-
-void
-TextTestResult::addFailure( const TestFailure &failure )
-{
- TestResult::addFailure( failure );
- // std::cerr << ( failure.isError() ? "E" : "F" );
- if (failure.isError())
- fprintf(stderr, "E");
- else
- fprintf(stderr, "F");
-}
-
-
-void
-TextTestResult::startTest( Test *test )
-{
- TestResult::startTest (test);
- // std::cerr << ".";
- fprintf(stderr, ".");
-}
-
-void TextTestResult::endTest( Test *test )
-{
- TestResult::endTest (test);
-}
-
-
-void
-TextTestResult::printFailures( std::ostream &stream )
-{
- TestResultCollector::TestFailures::const_iterator itFailure = m_aResulter.failures().begin();
- int failureNumber = 1;
- while ( itFailure != m_aResulter.failures().end() )
- {
- stream << std::endl;
- TestFailure *pFailure= (*itFailure++)->getTestFailure();
- printFailure( pFailure, failureNumber++, stream );
- }
-}
-
-
-void
-TextTestResult::printFailure( TestFailure *failure,
- int failureNumber,
- std::ostream &stream )
-{
- printFailureListMark( failureNumber, stream );
- stream << ' ';
- printFailureTestName( failure, stream );
- stream << ' ';
- printFailureType( failure, stream );
- stream << ' ';
- printFailureLocation( failure->sourceLine(), stream );
- stream << std::endl;
- printFailureDetail( failure->thrownException(), stream );
- stream << std::endl;
-}
-
-
-void
-TextTestResult::printFailureListMark( int failureNumber,
- std::ostream &stream )
-{
- stream << failureNumber << ")";
-}
-
-
-void
-TextTestResult::printFailureTestName( TestFailure *failure,
- std::ostream &stream )
-{
- Test* pTest = failure->failedTest();
- stream << "test: " << pTest->getName();
-}
-
-
-void
-TextTestResult::printFailureType( TestFailure *failure,
- std::ostream &stream )
-{
- stream << "("
- << (failure->isError() ? "E" : "F")
- << ")";
-}
-
-
-void
-TextTestResult::printFailureLocation( SourceLine sourceLine,
- std::ostream &stream )
-{
- if ( !sourceLine.isValid() )
- return;
-
- stream << "line: " << sourceLine.lineNumber()
- << ' ' << sourceLine.fileName();
-}
-
-
-void
-TextTestResult::printFailureDetail( Exception *thrownException,
- std::ostream &stream )
-{
- if ( thrownException->isInstanceOf( NotEqualException::type() ) )
- {
- NotEqualException *e = (NotEqualException*)thrownException;
- stream << "expected: " << e->expectedValue() << std::endl
- << "but was: " << e->actualValue();
- if ( !e->additionalMessage().empty() )
- {
- stream << std::endl;
- stream << "additional message:" << std::endl
- << e->additionalMessage();
- }
- }
- else
- {
- stream << " \"" << thrownException->what() << "\"";
- }
-}
-
-
-void
-TextTestResult::print( std::ostream& stream )
-{
- printHeader( stream );
- stream << std::endl;
- printFailures( stream );
-}
-
-
-void
-TextTestResult::printHeader( std::ostream &stream )
-{
- if (m_aResulter.wasSuccessful ())
- stream << std::endl << "OK (" << m_aResulter.runTests () << " tests)"
- << std::endl;
- else
- {
- stream << std::endl;
- printFailureWarning( stream );
- printStatistics( stream );
- }
-}
-
-
-void
-TextTestResult::printFailureWarning( std::ostream &stream )
-{
- stream << "!!!FAILURES!!!" << std::endl;
-}
-
-
-void
-TextTestResult::printStatistics( std::ostream &stream )
-{
- stream << "Test Results:" << std::endl;
-
- stream << "Run: " << m_aResulter.runTests()
- << " Failures: " << m_aResulter.testFailures()
- << " Errors: " << m_aResulter.testErrors()
- << std::endl;
-}
-
-
-std::ostream &
-operator <<( std::ostream &stream,
- TextTestResult &result )
-{
- result.print (stream); return stream;
-}
-
-
-} // namespace CppUnit
diff --git a/testshl2/source/cppunit/result/emacsTestResult.cxx b/testshl2/source/cppunit/result/emacsTestResult.cxx
deleted file mode 100644
index 4a4d57b6cee6..000000000000
--- a/testshl2/source/cppunit/result/emacsTestResult.cxx
+++ /dev/null
@@ -1,190 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-
-#include <map>
-#include <cppunit/Exception.h>
-#include <cppunit/NotEqualException.h>
-#include <cppunit/Test.h>
-#include <cppunit/TestFailure.h>
-#include <testshl/result/emacsTestResult.hxx>
-// #include <TextTestResult.h>
-//!io #include <iostream>
-#include <string>
-
-#include <rtl/string.hxx>
-#include "testshl/result/outputter.hxx"
-
-namespace CppUnit {
-
- emacsTestResult::emacsTestResult(GetOpt & _aOptions)
- :TestResult(_aOptions),
- m_aOptions(_aOptions),
- m_aResulter(this)
- {
- addListener( &m_aResulter );
- }
-
- //# struct ltstr
- //# {
- //# bool operator()(const CppUnit::Test* p1, const CppUnit::Test* p2) const
- //# {
- //# return p1 < p2;
- //# }
- //# };
- //# typedef std::map<CppUnit::Test*, bool, ltstr> TestPtrList;
-
- void
- emacsTestResult::print( Outputter& stream )
- {
- printHeader( stream );
- // stream << std::endl;
- // printFailures( stream );
-
- // TestPtrList aFailedTests;
-
- for (TestResultCollector::TestFailures::const_iterator it2 = m_aResulter.failures().begin();
- it2 != m_aResulter.failures().end();
- ++it2)
- {
- TestFailureEnvelope *pEnvelop = *it2;
- TestFailure *pFailure = pEnvelop->getTestFailure();
- std::string sNodeName = pEnvelop->getString();
-
- // aFailedTests[ pFailure->failedTest() ] = true;
-
- printFailureLine(stream, pFailure, sNodeName);
- }
-
- // only errors are from interest here
- //# for (TestResultCollector::Tests::const_iterator it = m_aResulter.tests().begin();
- //# it != m_aResulter.tests().end();
- //# ++it)
- //# {
- //# TestEnvelope *pEnvelop = *it;
- //# Test* pTest = pEnvelop->getTest();
- //# std::string sNodeName = pEnvelop->getString();
- //#
- //# if (aFailedTests.find(pTest) == aFailedTests.end())
- //# {
- //# std::string sInfo = m_aResulter.getInfo(pTest);
- //# printTestLine(stream, pTest, sNodeName, sInfo);
- //# }
- //# }
- stream << "Test #PASSED#" << Outputter::endl();
- }
-
-
- void
- emacsTestResult::printHeader( Outputter &stream )
- {
- std::string sDate(m_aOptionHelper.createDateTag());
- stream << sDate << Outputter::endl();
- }
-
- void
- emacsTestResult::printFailureLine( Outputter &stream, TestFailure *_pFailure, std::string const& _sNodeName)
- {
- std::string aName;
- aName += _sNodeName;
- aName += ".";
- aName += _pFailure->failedTestName();
-
- SourceLine aLine = _pFailure->sourceLine();
- sal_Int32 nLine = -1;
- std::string sFilename;
- if (aLine.isValid())
- {
- nLine = aLine.lineNumber();
- sFilename = aLine.fileName();
- }
-
- Exception *pExp = _pFailure->thrownException();
- std::string sWhat;
- if (pExp)
- {
- sWhat = pExp->what();
- }
-
- stream << sFilename;
- stream << ":";
- stream << nLine;
- stream << ":";
-
- stream << aName;
- stream << ";#FAILED#";
- // ErrorType::num eErr = _pFailure->getErrorType();
- //# if (isErr)
- //# stream << "FAILED#;";
- //# else
- //# stream << "ERROR#;";
-
- stream << sWhat;
- stream << Outputter::endl();
- }
-
- //# void
- //# emacsTestResult::printTestLine( Outputter &stream, Test* _pTest, std::string const& _sNodeName, std::string const& _sInfo)
- //# {
- //# std::string aName;
- //# aName += _sNodeName;
- //# aName += ".";
- //# aName += _pTest->getName();
- //#
- //# stream << aName;
- //# stream << ";";
- //# stream << _sInfo << "#";
- //# stream << "OK#";
- //# stream << std::endl;
- //# }
-
-
-//# void
-//# emacsTestResult::printStatistics( Outputter &stream )
-//# {
-//# stream << "Test Results:" << std::endl;
-//#
-//# stream << "Run: " << runTests()
-//# << " Failures: " << testFailures()
-//# << " Errors: " << testErrors()
-//# << std::endl;
-//# }
-
-
- Outputter &
- operator <<( Outputter &stream,
- emacsTestResult &result )
- {
- result.print (stream); return stream;
- }
-
-
-} // namespace CppUnit
diff --git a/testshl2/source/cppunit/result/log.cxx b/testshl2/source/cppunit/result/log.cxx
deleted file mode 100644
index 3279d1b2091e..000000000000
--- a/testshl2/source/cppunit/result/log.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include "testshl/log.hxx"
-
-// #include <hash_map>
-// #include <list>
-// #include <set>
-
-using namespace std;
-
-::osl::FileBase::RC Log::open( sal_Bool append ) {
-
- ::osl::FileBase::RC ret;
-
- if ( ! append ) {
- ret = ::osl::File::remove( m_logurl );
- }
-
- if( m_logfile->open( OpenFlag_Write ) == ::osl::FileBase::E_NOENT ) {
- ret = m_logfile->open( OpenFlag_Write | OpenFlag_Create );
- }
- else {
- ret = m_logfile->setPos( Pos_End, 0 );
- }
- return ret;
-}
-
-::osl::FileBase::RC Log::write( const sal_Char* buf, sal_Bool v ) {
- sal_uInt64 uBytes=0;
- sal_uInt32 len = 0;
- const sal_Char* ptr = buf;
-
- if( ptr ) {
- while( *ptr++ ) len++;
- }
-
- if ( v ) {
- // cout << buf << flush;
- printf("%s", buf);
- }
- return m_logfile->write( buf, len , uBytes );
-}
-
-::osl::FileBase::RC Log::write( const rtl::OString& buf, sal_Bool v ) {
- sal_uInt64 uBytes=0;
- if ( v ) {
- // cout << buf.getStr() << flush;
- printf("%s", buf.getStr());
- }
- return m_logfile->write( buf.getStr(), buf.getLength(), uBytes );
-}
-/*
-// LLA: due to a problem with sal/OUStingBuffer getLength() which isn't const, this
-// is so not compilable.
-::osl::FileBase::RC Log::write( rtl::OStringBuffer const& buf, sal_Bool v ) {
- sal_uInt64 uBytes=0;
- if ( v ) {
- cout << buf.getStr() << flush;
- }
- return m_logfile->write( buf.getStr(), buf.getLength(), uBytes );
-}
-*/
-::osl::FileBase::RC Log::write( const rtl::OUString& buf,
- rtl_TextEncoding tenc, sal_Bool v ) {
- sal_uInt64 uBytes=0;
- if ( ! tenc ) {
- tenc = RTL_TEXTENCODING_ASCII_US;
- }
- rtl::OStringBuffer osbuf(
- rtl::OUStringToOString( buf, tenc ).getStr() );
-
- if ( v ) {
- // cout << osbuf.getStr() << flush;
- printf("%s", osbuf.getStr());
- }
- return m_logfile->write( osbuf.getStr(), osbuf.getLength(), uBytes );
-}
-
-Log &operator <<( Log &_aLog, const sal_Char * _sValue )
-{
- _aLog.write(_sValue); return _aLog;
-}
-Log &operator <<( Log &_aLog, rtl::OString const& _sValue )
-{
- _aLog.write(_sValue); return _aLog;
-}
-Log &operator <<( Log &_aLog, rtl::OUString const& _sValue )
-{
- _aLog.write(_sValue); return _aLog;
-}
-//! Log &operator <<( Log &_aLog, rtl::OStringBuffer const& _sValue )
-//! {
-//! _aLog.write(_sValue); return _aLog;
-//! }
diff --git a/testshl2/source/cppunit/result/makefile.mk b/testshl2/source/cppunit/result/makefile.mk
deleted file mode 100644
index 59ff333726db..000000000000
--- a/testshl2/source/cppunit/result/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..$/..
-
-PRJNAME=testshl2
-TARGET=c5t_testresult
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-# ENABLE_RTTI=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# CXXFILES = \
-# querytemplate.cxx \
-# stringhelper.cxx
-
-# ENVCFLAGSCXX+=-DCPPUNIT_BUILD_DLL
-SLOFILES = \
- $(SLO)$/SynchronizedObject.obj \
- $(SLO)$/TestResult.obj \
- $(SLO)$/TestResultCollector.obj \
- $(SLO)$/TestSucessListener.obj \
- $(SLO)$/emacsTestResult.obj \
- $(SLO)$/log.obj \
- $(SLO)$/optionhelper.obj \
- $(SLO)$/outputter.obj \
- $(SLO)$/signal.obj \
- $(SLO)$/testshlTestResult.obj \
- $(SLO)$/treswrapper.obj
-
-# currently unused
-# $(SLO)$/TextTestResult.obj
-
-LIB1TARGET= $(LB)$/$(TARGET).lib
-LIB1OBJFILES= $(SLOFILES)
-
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"=="GCC"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-.ENDIF
-
-.IF "$(GUI)" == "UNX"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/testshl2/source/cppunit/result/optionhelper.cxx b/testshl2/source/cppunit/result/optionhelper.cxx
deleted file mode 100644
index 90096c8957e7..000000000000
--- a/testshl2/source/cppunit/result/optionhelper.cxx
+++ /dev/null
@@ -1,314 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include "testshl/result/optionhelper.hxx"
-// #include <sstream>
-// #include <string>
-#include <osl/time.h>
-#include "testshl/cmdlinebits.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace
-{
- void split( const rtl::OString& opt,
- const rtl::OString& _sSeparator,
- OStringList& optLine )
- {
- optLine.clear();
- // const sal_Int32 cSetLen = cSet.getLength();
- sal_Int32 index = 0;
- sal_Int32 oldIndex = 0;
-
- // sal_Int32 i;
- // sal_Int32 j = 0;
- while ( opt.getLength() > 0)
- {
- // for ( i = 0; i < cSetLen; i++ )
- // {
- index = opt.indexOf( _sSeparator, oldIndex);
- if( index != -1 )
- {
- optLine.push_back( opt.copy( oldIndex, index - oldIndex ) );
- oldIndex = index + _sSeparator.getLength();
- }
- // }
- else // if (index == -1)
- {
- optLine.push_back( opt.copy( oldIndex ) );
- break;
- }
- }
- } ///< split
-
- bool match(OStringList const& _aFilter, OStringList const& _aName)
- {
- OStringList::const_iterator aFilterIter = _aFilter.begin();
- OStringList::const_iterator aValueIter = _aName.begin();
-
- bool bMatch = false;
-
- while (aFilterIter != _aFilter.end() && aValueIter != _aName.end())
- {
- rtl::OString sFilter = *aFilterIter;
- rtl::OString sName = *aValueIter;
-
- if (sFilter == sName)
- {
- bMatch = true;
- ++aFilterIter;
- ++aValueIter;
- }
- else if (sFilter == "*")
- {
- bMatch = true;
- break;
- }
- else
- {
- // Filter does not match
- bMatch = false;
- break;
- }
- }
- return bMatch;
- }
-}
-
-/* static */
-std::string OptionHelper::integerToAscii(sal_Int32 nValue)
-{
- sal_Char cBuf[30];
- sal_Char *pBuf = cBuf;
- sprintf(pBuf, "%d", static_cast<int>(nValue));
-//# std::ostringstream sBuf;
-//# sBuf << nValue;
-// rtl::OString sStr;
-// sStr = rtl::OString::valueOf(nValue);
- return std::string(pBuf);
-}
-
-/* static */
-// if a given String is less then 2 char, add a "0" in front.
-std::string OptionHelper::twoDigits(std::string const& _sValue)
-{
- std::string sBack;
- if (_sValue.length() == 0)
- {
- sBack = "00";
- }
- else if (_sValue.length() == 1)
- {
- sBack = "0";
- sBack += _sValue;
- }
- else
- {
- sBack = _sValue;
- }
- return sBack;
-}
-
-
-std::string OptionHelper::createDateTag(std::string const& _sProjectId, std::string const& _sBuildId)
-{
- TimeValue tmv_system;
- TimeValue tmv_local;
- oslDateTime dt;
- osl_getSystemTime( &tmv_system );
- osl_getLocalTimeFromSystemTime(&tmv_system, &tmv_local);
- osl_getDateTimeFromTimeValue( &tmv_local, &dt );
-
- sal_Int32 nYear = dt.Year;
- sal_Int32 nMonth = dt.Month;
- sal_Int32 nDay = dt.Day;
-
- std::string sDate;
- sDate = "# Current Time: ";
- sDate += std::string(twoDigits(integerToAscii(dt.Hours)));
- sDate += ":";
- sDate += std::string(twoDigits(integerToAscii(dt.Minutes)));
- sDate += ":";
- sDate += std::string(twoDigits(integerToAscii(dt.Seconds)));
- sDate += "\n";
-
- sDate += "[";
-
- // sDate += rtl::OString::valueOf(nYear);
- sDate.append(integerToAscii(nYear));
- sDate += ".";
- if (nMonth < 10)
- sDate += "0";
- // sDate += rtl::OString::valueOf(nMonth);
- sDate.append(integerToAscii(nMonth));
- sDate += ".";
- if (nDay < 10)
- sDate += "0";
- // sDate += rtl::OString::valueOf(nDay);
- sDate += std::string(integerToAscii(nDay));
- sDate += "/";
- sDate += _sProjectId;
- sDate += "/";
- sDate += _sBuildId;
- sDate += "]";
-
- return sDate;
-}
-
-//# rtl::OString createDateTag()
-//# {
-//# TimeValue tmv;
-//# oslDateTime dt;
-//# osl_getSystemTime( &tmv );
-//# osl_getDateTimeFromTimeValue( &tmv, &dt );
-//#
-//# sal_Int32 nYear = dt.Year;
-//# sal_Int32 nMonth = dt.Month;
-//# sal_Int32 nDay = dt.Day;
-//#
-//# rtl::OString sDate("[");
-//# sDate += rtl::OString::valueOf(nYear);
-//# sDate += ".";
-//# if (nMonth < 10)
-//# sDate += "0";
-//# sDate += rtl::OString::valueOf(nMonth);
-//# sDate += ".";
-//# if (nDay < 10)
-//# sDate += "0";
-//# sDate += rtl::OString::valueOf(nDay);
-//# sDate += "//]";
-//#
-//# return sDate;
-//# }
-
-std::string OptionHelper::createDateTag()
-{
- return createDateTag(m_sProjectId, m_sBuildId);
-}
-
-bool OptionHelper::showErrors()
-{
- bool bRetValue = true; // default, show all
- if (m_aOption.hasOpt("-noerrors"))
- {
- bRetValue = false;
- }
- return bRetValue;
-}
-
-bool OptionHelper::showTests()
-{
- bool bRetValue = true; // default, show all
- if (m_aOption.hasOpt("-onlyerrors"))
- {
- bRetValue = false;
- }
- return bRetValue;
-}
-
-// Check which parameter is given for handle the jobs.
-// If no parameter is given, all jobs (tests) will run through
-void OptionHelper::handleJobs()
-{
- // load job file, the file contains the functions which we only want to test.
- if (m_aOption.hasOpt("-jobexclude"))
- {
- rtl::OString sJobFile = m_aOption.getOpt("-jobexclude");
- m_aJobExcludeList.readfile(sJobFile.getStr(), JOB_EXCLUDE_LIST);
- }
-
- if (m_aOption.hasOpt("-jobonly"))
- {
- rtl::OString sJobFile = m_aOption.getOpt("-jobonly");
- m_aJobOnlyList.readfile(sJobFile.getStr(), JOB_ONLY_LIST);
- }
-
- //
- if (m_aOption.hasOpt("-jobfilter"))
- {
- rtl::OString sJobFilter = m_aOption.getOpt("-jobfilter");
- split(sJobFilter, ".", m_aJobFilter);
- }
-}
-
-// -----------------------------------------------------------------------------
-// Here will be decide, if a job/test will execute or not.
-// therefore exist some lists, in which stay all jobs (positive list) or a list (negative list) which jobs should not execute
-// or if only specific jobs should execute by a given filter
-
-bool OptionHelper::isAllowedToExecute(std::string const& _sNodeName, std::string const& _sName)
-{
- std::string sJobName = _sNodeName + "." + _sName;
- // t_print(T_VERBOSE, "Jobname %s\n", sJobName.c_str());
- if (isOnlyShowJobs()) // true, if parameter -onlyshowjob
- {
- m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS);
- return false;
- }
-
- if (m_aJobOnlyList.size()) // >0 if parameter -jobonly
- {
- if (m_aJobOnlyList.getJobListEntry(sJobName) != JOB_NOT_FOUND)
- {
- // job entry found, mark as accessed
- m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS);
- return true;
- }
- return false;
- }
- else if (m_aJobFilter.size() > 0) // >0 if parameter -jobfilter
- {
- OStringList aSplitName;
- split(sJobName.c_str(), ".", aSplitName);
- if (! match(m_aJobFilter, aSplitName))
- {
- t_print(T_VERBOSE, "job: '%s' filtered by [-jobfilter]\n", sJobName.c_str());
- return false;
- }
- }
- else if (m_aJobExcludeList.size() > 0) // >0 if parameter -jobexclude
- {
- if (m_aJobExcludeList.getJobListEntry(sJobName) != JOB_NOT_FOUND)
- {
- // job entry found, this job should not executed, so return false
- t_print(T_VERBOSE, "job: '%s' filtered by [-jobexclude]\n", sJobName.c_str());
- return false;
- }
- // m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS);
- return true;
- }
- else
- {
- //! not handled yet
- }
-
- return true;
-}
-
diff --git a/testshl2/source/cppunit/result/outputter.cxx b/testshl2/source/cppunit/result/outputter.cxx
deleted file mode 100644
index 182b9db683e9..000000000000
--- a/testshl2/source/cppunit/result/outputter.cxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-//
-#include <string>
-#include <sal/types.h>
-#include "testshl/result/outputter.hxx"
-
-// -----------------------------------------------------------------------------
-
-Outputter::~Outputter()
-{
- // delete m_pLog;
-}
-
-void Outputter::writeToAll(const sal_Char* _sCharStr)
-{
- // std::cout << _sCharStr;
- if (m_pStream)
- {
- *m_pStream << _sCharStr;
- }
- if (m_pLog.get())
- {
- m_pLog->write(_sCharStr);
- }
-}
-
-void Outputter::write(const sal_Char* _sCharStr)
-{
- writeToAll(_sCharStr);
-}
-
-void Outputter::write(std::string const& _sStr)
-{
- writeToAll(_sStr.c_str());
-}
-
-void Outputter::write(sal_Int32 _nValue)
-{
- sal_Char cBuf[20];
- sal_Char* pBuf = cBuf;
- sprintf(pBuf, "%d", SAL_STATIC_CAST(int, _nValue));
- writeToAll(pBuf);
-}
-
-// -----------------------------------------------------------------------------
-
-Outputter& operator <<( Outputter &_aStreamWrapper, const sal_Char* _sValue)
-{
- _aStreamWrapper.write(_sValue);
- return _aStreamWrapper;
-}
-
-Outputter& operator <<( Outputter &_aStreamWrapper, std::string const& _sValue)
-{
- _aStreamWrapper.write(_sValue);
- return _aStreamWrapper;
-}
-
-Outputter& operator <<( Outputter &_aStreamWrapper, sal_Int32 _nValue)
-{
- _aStreamWrapper.write(_nValue);
- return _aStreamWrapper;
-}
-
-//# Outputter& operator <<( Outputter &_aStreamWrapper, double )
-//# {
-//# return _aStreamWrapper;
-//# }
-
-Outputter& operator <<( Outputter &_aStreamWrapper, Outputter::endl const&)
-{
- _aStreamWrapper.write("\n");
- return _aStreamWrapper;
-}
diff --git a/testshl2/source/cppunit/result/signal.cxx b/testshl2/source/cppunit/result/signal.cxx
deleted file mode 100644
index 7c96dcfe7589..000000000000
--- a/testshl2/source/cppunit/result/signal.cxx
+++ /dev/null
@@ -1,996 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#include <signal.h>
-#include <errno.h>
-#endif
-
-#include <fstream>
-#include <vector>
-#include <hash_map>
-
-#include <rtl/tres.h>
-#include <rtl/string.hxx>
-
-#include "testshl/autoregisterhelper.hxx"
-#include "testshl/getopt.hxx"
-#include "signal.hxx"
-#include <cppunit/tagvalues.hxx>
-#include <testshl/taghelper.hxx>
-#include <unistd.h>
-#include "testshl/filehelper.hxx"
-#include <testshl/result/TestResult.h>
-#include "testshl/signaltest.h"
-#include "cppunit/Exception.h"
-
-#ifdef WNT
-#include "testshl/winstuff.hxx"
-#endif
-
-// typedef std::vector<std::string> StringList;
-// StringList sCurrentNodeName;
-CppUnit::TestResult *pTestResult = NULL;
-std::string sSignalFile;
-
-typedef std::hash_map< std::string, int > HashMap;
-HashMap m_aSignalHash;
-bool bSignalsCached = false;
-bool bDoNotTouchSignalFile = false;
-
-// -----------------------------------------------------------------------------
-
-// return 'true' if signalfile doesn't exist.
-// else 'false'
-bool existsSignalFile(std::string const& _sSignalFilename)
-{
- FILE* pFile = fopen(_sSignalFilename.c_str(), "r");
- if (!pFile)
- {
- return false;
- }
- fprintf(stderr, "'%s' exists.\n", _sSignalFilename.c_str());
- fclose(pFile);
- return true;
-}
-
-// -----------------------------------------------------------------------------
-void createEmptySignalFile(std::string const& _sSignalFilename)
-{
- FILE* pFile = fopen(_sSignalFilename.c_str(), "w");
- if (!pFile)
- {
- fprintf(stderr, "error: Could not create signal helper file %s for signal info.\n", _sSignalFilename.c_str());
- }
- else
- {
- fprintf(pFile, "# This is an auto generated helper file for signal handling.\n");
- fprintf(pFile, "# An entry start by '#' is a comment.\n");
- fprintf(pFile, "# All other are test functions which have abort, before this line is removed.\n");
- fprintf(pFile, "# So you have to check this functions by hand.\n");
-
- fclose(pFile);
- }
-}
-
-// -----------------------------------------------------------------------------
-/** get Current PID.
-*/
-inline ::rtl::OUString getCurrentPID( )
-{
- //~ Get current PID and turn it into OUString;
- sal_uInt32 nPID = 0;
-#ifdef WNT
- nPID = WinGetCurrentProcessId();
-#else
- nPID = getpid();
-#endif
- return ( ::rtl::OUString::valueOf( static_cast<long>(nPID ) ) );
-}
-// -----------------------------------------------------------------------------
-static std::string integerToAscii(sal_uInt32 nValue)
-{
- sal_Char cBuf[30];
- sal_Char *pBuf = cBuf;
- sprintf(pBuf, "%d", static_cast<unsigned int>(nValue));
- return std::string(pBuf);
-}
-void my_sleep(int sec);
-
-// -----------------------------------------------------------------------------
-void setSignalFilename(GetOpt & opt)
-{
- if (opt.hasOpt("-dntsf") || opt.hasOpt("-donottouchsignalfile"))
- {
- // special feature, for debugging, so the signal file will not manipulate.
- // but create, if no one exist.
- bDoNotTouchSignalFile = true;
- }
-
- if (opt.hasOpt("-sf") || opt.hasOpt("-signalfile"))
- {
- if (opt.hasOpt("-sf"))
- {
- sSignalFile = opt.getOpt("-sf");
- }
- else if (opt.hasOpt("-signalfile"))
- {
- sSignalFile = opt.getOpt("-signalfile");
- }
- }
- else
- {
- std::string sPath;
- // std::string sPath(FileHelper::getTempPath());
- std::string sFilename("signalfile");
- std::string sFilenameExt(".txt");
- bool bCanQuitLoop = true;
- do
- {
-
-// #ifdef WNT
-// sPath += "\\";
-// #endif
-// #ifdef UNX
-// sPath += "/";
-// #endif
- sPath = sFilename;
- // BUG: i72675
- // add "_12345" where 12345 is the current process ID
-
- TimeValue aTimeValue;
- osl_getSystemTime(&aTimeValue);
-
- sPath += "_";
- sPath += integerToAscii(aTimeValue.Seconds);
- // rtl::OUString suPID = getCurrentPID();
- // rtl::OString sPID = rtl::OUStringToOString(suPID, RTL_TEXTENCODING_ASCII_US);
- // sPath += sPID.getStr();
- sPath += sFilenameExt;
- bCanQuitLoop = true;
- if (existsSignalFile(sPath))
- {
- // there is already a signal file, wait a second, choose an other one.
- my_sleep(1);
- bCanQuitLoop = false;
- }
- }
- while (!(bCanQuitLoop));
-
- sSignalFile = sPath;
- fprintf(stderr, "Use default signal file name '%s'\n", sSignalFile.c_str());
- }
-
- if (opt.hasOpt("-dnrmsf"))
- {
- fprintf(stderr, "'Don't remove signal file' (-dnrmsf) is set.\n");
- }
- else
- {
- if (bDoNotTouchSignalFile == true)
- {
- fprintf(stderr, "warning: 'Don't touch signal file' parameter (-dntsf) is set, will not remove existing signal file.\n");
- }
- else
- {
- // remove signalfile
- createEmptySignalFile(sSignalFile);
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-bool doNotTouchSignalFile() { return bDoNotTouchSignalFile; }
-
-// -----------------------------------------------------------------------------
-std::string buildTestFunctionName(std::string const& _sName)
-{
- std::string sName;
- if (pTestResult)
- {
- sName = pTestResult->getNodeName();
- sName += ".";
- }
-
-/*
- for (StringList::const_iterator it = sCurrentNodeName.begin();
- it != sCurrentNodeName.end();
- ++it)
- {
- sName += *it;
- sName += ".";
- }
-*/
- sName += _sName;
-
- return sName;
-}
-// -----------------------------------------------------------------------------
-// old: void executionPushName(std::string const& _sName)
-// old: {
-// old: sCurrentNodeName.push_back(_sName);
-// old: }
-// old: void executionPopName()
-// old: {
-// old: sCurrentNodeName.pop_back();
-// old: }
-// old:
-
-// -----------------------------------------------------------------------------
-// ------------------------------ Signal Handling ------------------------------
-// -----------------------------------------------------------------------------
-
-// std::string sLastTestFunctionName;
-
-std::string getSignalName(sal_Int32 nSignalNo);
-// -----------------------------------------------------------------------------
-
-std::string getSignalFilename()
-{
- return sSignalFile;
-}
-
-// -----------------------------------------------------------------------------
-// void storeNoSignal(std::string const& _sTestName)
-// {
- // sLastTestFunctionName = buildTestFunctionName(_sTestName);
- // std::ofstream out(getSignalFilename().c_str(), std::ios::out);
- // out << NO_SIGNAL << std::endl; // no signal!
-// }
-
-void markSignalAsAlreadyDone(sal_Int32 _nSignalNo)
-{
- // std::ofstream out(getSignalFilename().c_str(), std::ios::out | std::ios::app);
- FILE *out = fopen(getSignalFilename().c_str(), "a");
- if (out != NULL)
- {
-//# out << "# the previous test function creates signal: "
-//# << getSignalName(_nSignalNo)
-//# << " ("
-//# << _nSignalNo
-//# << ")" << std::endl;
-//# // out << sLastTestFunctionName << std::endl; // SIGNAL!
-
- fprintf(out, "# the previous test function creates signal: %s(%d)\n", getSignalName(_nSignalNo).c_str(), SAL_STATIC_CAST(int, _nSignalNo));
- // fprintf(out, "%s\n", sLastTestFunctionName );
- fclose(out);
- }
- else
- {
- fprintf(stderr, "error: Can't write signal info to file %s \n", getSignalFilename().c_str());
- }
-}
-
-// -----------------------------------------------------------------------------
-
-Signal hasSignaled(std::string const& _sTestName)
-{
- // BACK: true: signal
- // false: nothing
-
- if (bSignalsCached == true)
- {
-
- if (m_aSignalHash.find(buildTestFunctionName(_sTestName)) != m_aSignalHash.end())
- {
- return HAS_SIGNAL;
- }
- return NO_SIGNAL;
- }
-
- std::ifstream in(getSignalFilename().c_str(), std::ios::in);
-
- // std::cout << "Check for signal" << std::endl;
- std::string sLine, sLastLine;
- while (std::getline(in, sLine))
- {
- // std::cout << sTest << std::endl;
- char ch = sLine[0];
- if (isspace(ch) == 0 &&
- sLine.size() > 0)
- {
- if (ch == '#')
- {
- if (sLastLine.size() > 0)
- {
- rtl::OString aStrLine(sLine.c_str());
- sal_Int32 nIdx = aStrLine.indexOf("(") + 1;
- sal_Int32 nIdx2 = aStrLine.indexOf(")");
- sal_Int32 nSignalNo = 0;
- if (nIdx > 0 && nIdx2 > 0)
- {
- rtl::OString sSignalNo = aStrLine.copy(nIdx, nIdx2 - nIdx);
- nSignalNo = sSignalNo.toInt32();
- m_aSignalHash[sLastLine] = nSignalNo;
- }
- sLastLine.clear();
- }
- }
- else
- {
- // if (sTest == buildTestFunctionName(_sTestName))
- m_aSignalHash[sLine] = 1;
- sLastLine = sLine;
- // return HAS_SIGNAL;
- }
- }
- }
-
- bSignalsCached = true;
- return hasSignaled(_sTestName);
- // return NO_SIGNAL;
-}
-
-#ifdef UNX
-
-// -----------------------------------------------------------------------------
-
-void release_signal_Handling();
-
-//# void signalFunction(int value)
-//# {
-//# std::cout << "Signal caught: (" << value << "), please restart." << std::endl;
-//# markSignalAsAlreadyDone();
-//#
-//# release_signal_Handling();
-//# std::cout.flush();
-//# abort();
-//# }
-
-// -----------------------------------------------------------------------------
-extern "C" void SignalHandlerFunction(int _nSignalNo, siginfo_t *, void*)
-{
- // std::cout << "Signal caught: " << getSignalName(_nSignalNo) << " (" << _nSignalNo << "), please restart." << std::endl;
- fprintf(stderr, "Signal caught %s(%d)\n", getSignalName(_nSignalNo).c_str(), _nSignalNo);
- markSignalAsAlreadyDone(_nSignalNo);
-
- release_signal_Handling();
- // std::cout.flush();
- abort();
-}
-
-// -----------------------------------------------------------------------------
-// This is a copy of the osl/signal.c code
-#define ACT_IGNORE 1
-#define ACT_ABORT 2
-#define ACT_EXIT 3
-#define ACT_SYSTEM 4
-#define ACT_HIDE 5
-
-extern "C" {
-static struct SignalAction
-{
- int Signal;
- int Action;
- void (*Handler)(int);
-} Signals[] =
-{
- { SIGHUP, ACT_IGNORE, NULL }, /* hangup */
- { SIGINT, ACT_EXIT, NULL }, /* interrupt (rubout) */
- { SIGQUIT, ACT_ABORT, NULL }, /* quit (ASCII FS) */
- { SIGILL, ACT_SYSTEM, NULL }, /* illegal instruction (not reset when caught) */
-/* changed from ACT_ABOUT to ACT_SYSTEM to try and get collector to run*/
- { SIGTRAP, ACT_ABORT, NULL }, /* trace trap (not reset when caught) */
-#if ( SIGIOT != SIGABRT )
- { SIGIOT, ACT_ABORT, NULL }, /* IOT instruction */
-#endif
-// { SIGABRT, ACT_ABORT, NULL }, /* used by abort, replace SIGIOT in the future */
-#ifdef SIGEMT
- { SIGEMT, ACT_SYSTEM, NULL }, /* EMT instruction */
-/* changed from ACT_ABORT to ACT_SYSTEM to remove handler*/
-/* SIGEMT may also be used by the profiler - so it is probably not a good
- plan to have the new handler use this signal*/
-#endif
- { SIGFPE, ACT_ABORT, NULL }, /* floating point exception */
- { SIGKILL, ACT_SYSTEM, NULL }, /* kill (cannot be caught or ignored) */
- { SIGBUS, ACT_ABORT, NULL }, /* bus error */
- { SIGSEGV, ACT_ABORT, NULL }, /* segmentation violation */
-#ifdef SIGSYS
- { SIGSYS, ACT_ABORT, NULL }, /* bad argument to system call */
-#endif
- { SIGPIPE, ACT_HIDE, NULL }, /* write on a pipe with no one to read it */
- { SIGALRM, ACT_EXIT, NULL }, /* alarm clock */
- { SIGTERM, ACT_EXIT, NULL }, /* software termination signal from kill */
- { SIGUSR1, ACT_SYSTEM, NULL }, /* user defined signal 1 */
- { SIGUSR2, ACT_SYSTEM, NULL }, /* user defined signal 2 */
- { SIGCHLD, ACT_SYSTEM, NULL }, /* child status change */
-#ifdef SIGPWR
- { SIGPWR, ACT_IGNORE, NULL }, /* power-fail restart */
-#endif
- { SIGWINCH, ACT_IGNORE, NULL }, /* window size change */
- { SIGURG, ACT_EXIT, NULL }, /* urgent socket condition */
-#ifdef SIGPOLL
- { SIGPOLL, ACT_EXIT, NULL }, /* pollable event occured */
-#endif
- { SIGSTOP, ACT_SYSTEM, NULL }, /* stop (cannot be caught or ignored) */
- { SIGTSTP, ACT_SYSTEM, NULL }, /* user stop requested from tty */
- { SIGCONT, ACT_SYSTEM, NULL }, /* stopped process has been continued */
- { SIGTTIN, ACT_SYSTEM, NULL }, /* background tty read attempted */
- { SIGTTOU, ACT_SYSTEM, NULL }, /* background tty write attempted */
- { SIGVTALRM, ACT_EXIT, NULL }, /* virtual timer expired */
- { SIGPROF, ACT_SYSTEM, NULL }, /* profiling timer expired */
-/*Change from ACT_EXIT to ACT_SYSTEM for SIGPROF is so that profiling signals do
- not get taken by the new handler - the new handler does not pass on context
- information which causes 'collect' to crash. This is a way of avoiding
- what looks like a bug in the new handler*/
- { SIGXCPU, ACT_ABORT, NULL }, /* exceeded cpu limit */
- { SIGXFSZ, ACT_ABORT, NULL } /* exceeded file size limit */
-};
-}
-
-const int NoSignals = sizeof(Signals) / sizeof(struct SignalAction);
-
-#endif /* UNX */
-
-// -----------------------------------------------------------------------------
-void init_signal_Handling(CppUnit::TestResult *_pResult)
-{
- pTestResult = _pResult;
-#ifdef UNX
-
-// signal(SIGSEGV, signalFunction);
- // signal(SIGSEGV, signalFunction);
- // signal(SIGFPE, signalFunction);
-
-// signal(1, signalFunction);
- // struct sigaction action, oldaction;
- // action.sa_sigaction = signalFunction2;
- // action.sa_flags = SA_ONESHOT /* | SA_SIGINFO */;
-
- struct sigaction act;
- struct sigaction oact;
-
- // act.sa_handler = SignalHandlerFunction;
- act.sa_flags = SA_RESTART;
- // act.sa_flags = SA_ONESHOT /* | SA_SIGINFO */;
- act.sa_sigaction = SignalHandlerFunction;
-
- sigfillset(&(act.sa_mask));
-
- /* Initialize the rest of the signals */
- for (int i = 0; i < NoSignals; i++)
- {
- if (Signals[i].Action != ACT_SYSTEM)
- {
- if (Signals[i].Action == ACT_HIDE)
- {
- struct sigaction ign;
-
- ign.sa_handler = SIG_IGN;
- ign.sa_flags = 0;
- sigemptyset(&ign.sa_mask);
-
- if (sigaction(Signals[i].Signal, &ign, &oact) == 0)
- Signals[i].Handler = oact.sa_handler;
- else
- Signals[i].Handler = SIG_DFL;
- }
- else
- if (sigaction(Signals[i].Signal, &act, &oact) == 0)
- Signals[i].Handler = oact.sa_handler;
- else
- Signals[i].Handler = SIG_DFL;
- }
- }
-#endif
-
- // ------------ signal helper file must exist -----------------
- FILE* pFile = fopen(getSignalFilename().c_str(), "r");
- if (!pFile)
- {
- createEmptySignalFile( getSignalFilename() );
- }
- else
- {
- fclose(pFile);
- }
-}
-
-// -----------------------------------------------------------------------------
-void release_signal_Handling()
-{
- // frees all signals
-#ifdef UNX
- int i;
- struct sigaction act;
-
- act.sa_flags = 0;
- sigemptyset(&(act.sa_mask));
-
- /* Initialize the rest of the signals */
- for (i = NoSignals - 1; i >= 0; i--)
- {
- if (Signals[i].Action != ACT_SYSTEM)
- {
- act.sa_handler = Signals[i].Handler;
-
- sigaction(Signals[i].Signal, &act, NULL);
- }
- }
-#endif
-}
-
-// -----------------------------------------------------------------------------
-Signal signalCheck(CppUnit::TestResult* _pResult, std::string const& _sTestName)
-{
- // BACK: HAS_SIGNAL: the test has already done and signaled
- if (hasSignaled(_sTestName) == HAS_SIGNAL)
- {
- // std::cout << "The Test '" << buildTestFunctionName(_sTestName) << "' is marked as signaled." << std::endl;
- std::string sTestFunctionName = buildTestFunctionName(_sTestName);
- fprintf(stderr, "The Test '%s' is marked as signaled.\n", sTestFunctionName.c_str());
- if (_pResult)
- {
- CppUnit::SignalTest *pTest = new CppUnit::SignalTest(_sTestName);
-
- std::string sErrorText = "Function is marked as signaled: ";
- sal_Int32 nSignalNo = m_aSignalHash[sTestFunctionName];
- sErrorText += getSignalName(nSignalNo);
- sErrorText += " (";
- sErrorText += OptionHelper::integerToAscii(nSignalNo);
- sErrorText += ")";
-
- _pResult->addError(pTest, new CppUnit::SignalException(sErrorText), ErrorType::ET_SIGNAL);
- }
- return HAS_SIGNAL;
- }
-
- // storeNoSignal(_sTestName);
- return NO_SIGNAL;
-}
-
-// -----------------------------------------------------------------------------
-bool copyFile(std::string const& _sFrom, std::string const& _sTo)
-{
- bool bRetValue = false;
- const int MAXBUFSIZE = 1024;
- char buff[MAXBUFSIZE];
- FILE *in = fopen(_sFrom.c_str(), "r");
- if (in == NULL)
- {
- fprintf(stderr, "error: Can't open file %s for read to copy.\n", _sFrom.c_str());
- bRetValue = false;
- }
- else
- {
- FILE *out = fopen(_sTo.c_str(), "w");
- if (out == NULL)
- {
- fclose(in);
- fprintf(stderr, "error: Can't open file %s for write to copy.\n", _sTo.c_str());
- bRetValue = false;
- }
- else
- {
- int nRealGot = 0;
- while(!feof(in))
- {
- nRealGot = fread(buff, sizeof(char), MAXBUFSIZE, in);
- if (nRealGot > 0)
- {
- fwrite(buff, sizeof(char), nRealGot, out);
- }
- }
- bRetValue = true;
- fclose(out);
- fclose(in);
- }
- }
- return bRetValue;
-}
-
-// -----------------------------------------------------------------------------
-void signalStartTest(std::string const& _sName)
-{
- if (doNotTouchSignalFile()) return;
-
- // fprintf(stderr, "### signalStartTest!\n");
- // due to the fact, that functions are vicious, we write the name first.
- // if it isn't vivious, than we removed it.
- std::string sNewName = getSignalFilename();
- sNewName += ".bak";
- if (copyFile(getSignalFilename(), sNewName))
- {
- // std::ofstream out(getSignalFilename().c_str(), std::ios::out | std::ios::app);
- FILE *out = fopen(getSignalFilename().c_str(), "a");
- if (out != NULL)
- {
- // out << buildTestFunctionName(_sName) << std::endl;
- fprintf(out, "%s\n", buildTestFunctionName(_sName).c_str());
- fclose(out);
- }
- else
- {
- fprintf(stderr, "error: Can't open file %s for append.\n", getSignalFilename().c_str());
- }
- }
- else
- {
- fprintf(stderr, "error: Can't copy signal helper from file %s to file %s, %d\n", getSignalFilename().c_str(), sNewName.c_str(), errno);
- }
-}
-
-// -----------------------------------------------------------------------------
-void signalEndTest()
-{
- if (doNotTouchSignalFile()) return;
-
- // fprintf(stderr, "### signalEndTest!\n");
- if (0 != remove(getSignalFilename().c_str()))
- {
- fprintf(stderr, "error: Can't delete file %s\n", getSignalFilename().c_str());
- }
- else
- {
- std::string sNewName = getSignalFilename();
- sNewName += ".bak";
- if (0 != rename(sNewName.c_str(), getSignalFilename().c_str()))
- {
- fprintf(stderr, "error: Can't rename file %s to file %s errno: %d\n", sNewName.c_str(), getSignalFilename().c_str(), errno);
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-void removeSignalFile(GetOpt & opt)
-{
- // fprintf(stderr, "### remove signal file: '%s'\n", sSignalFile.c_str());
- if (opt.hasOpt("-dnrmsf"))
- {
- return;
- }
- if (bDoNotTouchSignalFile == true)
- {
- return;
- }
- remove(getSignalFilename().c_str());
-}
-
-// -----------------------------------------------------------------------------
-
-sal_Int32 SignalHandlerA( TagHelper const& _aTagItems )
-{
- sal_Int32 nRetValue = 0;
- TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0);
-// LLA: unused
-// hTestResult hResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */ );
-// CppUnit::TestResult* pResult = (CppUnit::TestResult*)hResult;
-
- try
- {
- switch(nTagType)
- {
- // old: case SIGNAL_PUSH_NAME:
- // old: {
- // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- // old: if (sName != NULL)
- // old: signalPushName(sName);
- // old: break;
- // old: }
- // old:
- // old: case SIGNAL_POP_NAME:
- // old: signalPopName();
- // old: break;
-
- // old: case SIGNAL_CHECK:
- // old: {
- // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- // old: if (sName != NULL)
- // old: {
- // old: nRetValue = signalCheck(sName);
- // old: }
- // old: break;
- // old: }
-
- // old: case INIT_SIGNAL_HANDLING:
- // old: init_signal_Handling();
- // old: break;
- // old:
- // old: case RELEASE_SIGNAL_HANDLING:
- // old: release_signal_Handling();
- // old: break;
-
- case SIGNAL_START_TEST:
- {
- // fprintf(stderr, "### SIGNAL_START_TEST!\n");
- const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- if (sName != NULL)
- {
- signalStartTest(sName);
- }
- break;
- }
-
- case SIGNAL_END_TEST:
- {
- // fprintf(stderr, "### SIGNAL_END_TEST!\n");
- const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- if (sName != NULL)
- {
- signalEndTest();
- }
- break;
- }
-
- default:
- fprintf(stderr, "error: SignalHandlerA: Can't handle the tag type %d\n", SAL_STATIC_CAST(int, nTagType));
- fflush(stderr);
- // throw std::exception(/*std::string("Unknown TYPE_TAG Exception.")*/);
- }
- }
- catch (std::exception &e)
- {
- fprintf(stderr, "error: SignalHandlerA: Exception caught: %s\n", e.what());
- fflush(stderr);
- // throw e;
- }
-
- return nRetValue;
-}
-// -----------------------------------------------------------------------------
-// This a little bit more abstract code, could be easier to modify or expand.
-
-sal_Int32 CheckExecution(CppUnit::TestResult* _pResult, std::string const& _sName)
-{
- // more checks in the corresponding job lists
- if (_pResult)
- {
- if (! _pResult->isAllowedToExecute(_sName))
- {
- return DO_NOT_EXECUTE;
- }
- }
-
- // Check if the given test should be executed.
- if (signalCheck(_pResult, _sName) == HAS_SIGNAL)
- {
- return DO_NOT_EXECUTE;
- }
-
- return GO_EXECUTE;
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 ExecutionA( TagHelper const& _aTagItems )
-{
- sal_Int32 nRetValue = 0;
- TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0);
- hTestResult hResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */ );
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)hResult;
-
- try
- {
- switch(nTagType)
- {
- case EXECUTION_CHECK:
- {
- const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- if (sName)
- {
- nRetValue = CheckExecution(pResult, sName);
- if (nRetValue == GO_EXECUTE)
- {
- if (pResult && pResult->isOptionWhereAmI())
- {
- printf("# This is: %s\n", buildTestFunctionName(sName).c_str());
- }
- }
- }
-
- break;
- }
-
- // old: case EXECUTION_PUSH_NAME:
- // old: {
- // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME);
- // old: if (sName != NULL)
- // old: executionPushName(sName);
- // old: break;
- // old: }
- // old:
- // old: case EXECUTION_POP_NAME:
- // old: executionPopName();
- // old: break;
-
- case INIT_TEST:
- init_signal_Handling(pResult);
- break;
-
- case RELEASE_TEST:
- release_signal_Handling();
- break;
-
- default:
- fprintf(stderr, "ExceptionA: Can't handle the tag type %d\n", SAL_STATIC_CAST(int, nTagType));
- break;
- }
- }
- catch (std::exception &e)
- {
- fprintf(stderr, "ExecutionA: exception caught: %s\n", e.what());
- fflush(stderr);
- // throw e;
- }
- return nRetValue;
-}
-
-// -----------------------------------------------------------------------------
-std::string getSignalName(sal_Int32 nSignalNo)
-{
- std::string sValue;
-#ifdef UNX
- switch(nSignalNo)
- {
- case SIGHUP:
- sValue = "SIGHUP";
- break;
-
- case SIGINT:
- sValue = "SIGINT";
- break;
-
- case SIGQUIT:
- sValue = "SIGQUIT";
- break;
-
- case SIGILL:
- sValue = "SIGILL";
- break;
-
- case SIGTRAP:
- sValue = "SIGTRAP";
- break;
-
-#if ( SIGIOT != SIGABRT )
- case SIGIOT:
- sValue = "SIGIOT";
- break;
-#endif
-// case SIGABRT:
-#ifdef SIGEMT
- case SIGEMT:
- sValue = "SIGEMT";
- break;
-#endif
- case SIGFPE:
- sValue = "SIGFPE";
- break;
-
- case SIGKILL:
- sValue = "SIGKILL";
- break;
-
- case SIGBUS:
- sValue = "SIGBUS";
- break;
-
- case SIGSEGV:
- sValue = "SIGSEGV";
- break;
-
-#ifdef SIGSYS
- case SIGSYS:
- sValue = "SIGSYS";
- break;
-#endif
- case SIGPIPE:
- sValue = "SIGPIPE";
- break;
-
- case SIGALRM:
- sValue = "SIGALRM";
- break;
-
- case SIGTERM:
- sValue = "SIGTERM";
- break;
-
- case SIGUSR1:
- sValue = "SIGUSR1";
- break;
-
- case SIGUSR2:
- sValue = "SIGUSR2";
- break;
-
- case SIGCHLD:
- sValue = "SIGCHLD";
- break;
-
-#ifdef SIGPWR
- case SIGPWR:
- sValue = "SIGPWR";
- break;
-#endif
- case SIGWINCH:
- sValue = "SIGWINCH";
- break;
-
- case SIGURG:
- sValue = "SIGURG";
- break;
-
-#ifdef SIGPOLL
- case SIGPOLL:
- sValue = "SIGPOLL";
- break;
-#endif
- case SIGSTOP:
- sValue = "SIGSTOP";
- break;
-
- case SIGTSTP:
- sValue = "SIGTSTP";
- break;
-
- case SIGCONT:
- sValue = "SIGCONT";
- break;
-
- case SIGTTIN:
- sValue = "SIGTTIN";
- break;
-
- case SIGTTOU:
- sValue = "SIGTTOU";
- break;
-
- case SIGVTALRM:
- sValue = "SIGVTALRM";
- break;
-
- case SIGPROF:
- sValue = "SIGPROF";
- break;
-
- case SIGXCPU:
- sValue = "SIGXCPU";
- break;
-
- case SIGXFSZ:
- sValue = "SIGXFSZ";
- break;
-
- default:
- sValue = "Unhandled Signal.";
- }
-#else
- (void) nSignalNo; // unused
-#endif
- return sValue;
-}
-
-// The following sets variables for GNU EMACS
-// Local Variables:
-// tab-width:4
-// End:
diff --git a/testshl2/source/cppunit/result/signal.hxx b/testshl2/source/cppunit/result/signal.hxx
deleted file mode 100644
index e3f448535014..000000000000
--- a/testshl2/source/cppunit/result/signal.hxx
+++ /dev/null
@@ -1,39 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SIGNAL_HXX
-#define SIGNAL_HXX
-
-#include <sal/types.h>
-
-#define HAS_SIGNAL 1
-#define NO_SIGNAL 0
-
-typedef sal_Int32 Signal;
-
-#endif
-
diff --git a/testshl2/source/cppunit/result/testshlTestResult.cxx b/testshl2/source/cppunit/result/testshlTestResult.cxx
deleted file mode 100644
index f80b999416ed..000000000000
--- a/testshl2/source/cppunit/result/testshlTestResult.cxx
+++ /dev/null
@@ -1,425 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-
-#include <map>
-#include <cppunit/Exception.h>
-#include <cppunit/NotEqualException.h>
-#include <cppunit/Test.h>
-#include <cppunit/TestFailure.h>
-#include <testshl/result/testshlTestResult.h>
-// #include <TextTestResult.h>
-//!io #include <iostream>
-#include <string>
-
-#include <rtl/string.hxx>
-#include "testshl/result/outputter.hxx"
-
-namespace CppUnit {
-
- testshlTestResult::testshlTestResult(GetOpt & _aOptions)
- :TestResult(_aOptions),
- m_aOptions(_aOptions),
- // m_aOptionHelper(_aOptions),
- m_aResulter(this)
- {
- addListener( &m_aResulter );
- }
-
- testshlTestResult::~testshlTestResult()
- {
- }
-
-//# void
-//# testshlTestResult::addFailure( const TestFailure &failure )
-//# {
-//# // TestResultCollector::addFailure( failure );
-//# // std::cerr << ( failure.isError() ? "E" : "F" );
-//# m_aResulter.addFailure(failure);
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::startTest( Test *test )
-//# {
-//# // TestResultCollector::startTest (test);
-//# m_aResulter.startTest(test);
-//# // std::cerr << ".";
-//# }
-//#
-//# void testshlTestResult::endTest( Test *test )
-//# {
-//# }
-
-// -----------------------------------------------------------------------------
-
-//# void
-//# testshlTestResult::printFailures( Outputter &stream )
-//# {
-//# TestFailures::const_iterator itFailure = failures().begin();
-//# int failureNumber = 1;
-//# while ( itFailure != failures().end() )
-//# {
-//# stream << std::endl;
-//# printFailure( *itFailure++, failureNumber++, stream );
-//# }
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailure( TestFailure *failure,
-//# int failureNumber,
-//# std::ostream &stream )
-//# {
-//# printFailureListMark( failureNumber, stream );
-//# stream << ' ';
-//# printFailureTestName( failure, stream );
-//# stream << ' ';
-//# printFailureType( failure, stream );
-//# stream << ' ';
-//# printFailureLocation( failure->sourceLine(), stream );
-//# stream << std::endl;
-//# printFailureDetail( failure->thrownException(), stream );
-//# stream << std::endl;
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailureListMark( int failureNumber,
-//# std::ostream &stream )
-//# {
-//# stream << failureNumber << ")";
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailureTestName( TestFailure *failure,
-//# std::ostream &stream )
-//# {
-//# Test* pTest = failure->failedTest();
-//# stream << "test: " << pTest->getName();
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailureType( TestFailure *failure,
-//# std::ostream &stream )
-//# {
-//# stream << "("
-//# << (failure->isError() ? "E" : "F")
-//# << ")";
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailureLocation( SourceLine sourceLine,
-//# std::ostream &stream )
-//# {
-//# if ( !sourceLine.isValid() )
-//# return;
-//#
-//# stream << "line: " << sourceLine.lineNumber()
-//# << ' ' << sourceLine.fileName();
-//# }
-//#
-//#
-//# void
-//# testshlTestResult::printFailureDetail( Exception *thrownException,
-//# std::ostream &stream )
-//# {
-//# if ( thrownException->isInstanceOf( NotEqualException::type() ) )
-//# {
-//# NotEqualException *e = (NotEqualException*)thrownException;
-//# stream << "expected: " << e->expectedValue() << std::endl
-//# << "but was: " << e->actualValue();
-//# if ( !e->additionalMessage().empty() )
-//# {
-//# stream << std::endl;
-//# stream << "additional message:" << std::endl
-//# << e->additionalMessage();
-//# }
-//# }
-//# else
-//# {
-//# stream << " \"" << thrownException->what() << "\"";
-//# }
-//# }
-
-
-// LLA: output format:
-// Header
-// # -- BEGIN
-// Error lines
-// No error lines
-// unknown lines
-// # -- END
-// Text 'Test #PASSED#' or 'Errors only'
-
-void
-testshlTestResult::print( Outputter& stream )
-{
- printHeader( stream );
- // stream << std::endl;
- // printFailures( stream );
-
- bool bPassed = false;
- if (isOnlyShowJobs())
- {
- JobList jl(m_aOptionHelper.getJobOnlyList());
- HashMap aJobList = jl.getHashMap();
- printLines(stream, aJobList);
- }
- else
- {
- stream << "# -- BEGIN:" << Outputter::endl();
-
- TestPtrList aFailedTests;
-
- // List of failures
- printFailedTests(stream, aFailedTests);
-
- if (! m_aOptionHelper.getOptions().hasOpt("-onlyerrors"))
- {
- // List of well done tests
- printTestLines(stream, aFailedTests);
-
- // List of unknown Tests
- JobList jl(m_aOptionHelper.getJobOnlyList());
- HashMap aJobList = jl.getHashMap();
- printUnknownLines(stream, aJobList);
-
- bPassed = true;
- }
- stream << "# -- END:" << Outputter::endl();
-
- if (bPassed)
- {
- stream << "Test #PASSED#" << Outputter::endl();
- }
-
- if (m_aOptionHelper.getOptions().hasOpt("-onlyerrors"))
- {
- stream << "Errors only." << Outputter::endl();
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-void
-testshlTestResult::printLines(Outputter &stream, HashMap & _aJobList)
-{
- int nCount = _aJobList.size();
- if (nCount != 0)
- {
- for (HashMap::const_iterator it = _aJobList.begin();
- it != _aJobList.end();
- ++it)
- {
- std::string aKey = (*it).first;
- if (_aJobList[aKey] == JOB_ACCESS)
- {
- stream << aKey;
- stream << Outputter::endl();
- }
- }
- }
-}
-
-void
-testshlTestResult::printFailedTests(Outputter &stream, TestPtrList &aFailedTests)
-{
- for (TestResultCollector::TestFailures::const_iterator it2 = m_aResulter.failures().begin();
- it2 != m_aResulter.failures().end();
- ++it2)
- {
- TestFailureEnvelope *pEnvelop = *it2;
- TestFailure *pFailure = pEnvelop->getTestFailure();
- std::string sNodeName = pEnvelop->getString();
-
- aFailedTests[ pFailure->failedTest() ] = true;
-
- printFailureLine(stream, pFailure, sNodeName);
- }
-}
-
-void
-testshlTestResult::printTestLines(Outputter &stream, TestPtrList &aFailedTests)
-{
- for (TestResultCollector::Tests::const_iterator it = m_aResulter.tests().begin();
- it != m_aResulter.tests().end();
- ++it)
- {
- TestEnvelope *pEnvelop = *it;
- Test* pTest = pEnvelop->getTest();
- std::string sNodeName = pEnvelop->getString();
-
- if (aFailedTests.find(pTest) == aFailedTests.end())
- {
- std::string sInfo = m_aResulter.getInfo(pTest);
- printTestLine(stream, pTest, sNodeName, sInfo);
- }
- }
-}
-
-void
-testshlTestResult::printUnknownLines(Outputter &stream, HashMap & _aJobList)
-{
- int nCount = _aJobList.size();
- if (nCount != 0)
- {
- for (HashMap::const_iterator it = _aJobList.begin();
- it != _aJobList.end();
- ++it)
- {
- std::string aKey = (*it).first;
- if (_aJobList[aKey] == JOB_UNKNOWN)
- {
- printUnknownLine(stream, aKey);
- }
- }
- }
-}
-
-void
-testshlTestResult::printHeader( Outputter &stream )
-{
- std::string sDate(m_aOptionHelper.createDateTag());
- if (isOnlyShowJobs())
- {
- stream << "# This is an automatically generated job file." << Outputter::endl();
- stream << "# ";
- }
- else
- {
- stream << sDate << Outputter::endl();
- }
-}
-
-void
-testshlTestResult::printFailureLine( Outputter &stream, TestFailure *_pFailure, std::string const& _sNodeName)
-{
- std::string aName;
- aName += _sNodeName;
- aName += ".";
- aName += _pFailure->failedTestName();
-
- SourceLine aLine = _pFailure->sourceLine();
- sal_Int32 nLine = -1;
- std::string sFilename;
- if (aLine.isValid())
- {
- nLine = aLine.lineNumber();
- sFilename = aLine.fileName();
- }
-
- Exception *pExp = _pFailure->thrownException();
- std::string sWhat;
- if (pExp)
- {
- sWhat = pExp->what();
- }
-
- ErrorType::num eErr = _pFailure->getErrorType();
-
- stream << aName;
- stream << ";";
-
- if (eErr == ErrorType::ET_FAILURE)
- stream << "FAILED";
-
- else if (eErr == ErrorType::ET_ERROR)
- stream << "ERROR";
-
- else if (eErr == ErrorType::ET_SIGNAL)
- stream << "SIGNAL";
-
- else
- stream << "UNKNOWN";
-
- stream << "#FAILED#";
-
- stream << sWhat;
- stream << Outputter::endl();
-}
-
-void
-testshlTestResult::printTestLine( Outputter &stream, Test* _pTest, std::string const& _sNodeName, std::string const& _sInfo)
-{
- std::string aName;
- aName += _sNodeName;
- aName += ".";
- aName += _pTest->getName();
-
- stream << aName;
- stream << ";";
- stream << _sInfo << "#";
- if (_sInfo == "PASSED")
- {
- stream << "OK#";
- }
- else
- {
- stream << "FAILED#";
- }
- stream << Outputter::endl();
-}
-
-void
-testshlTestResult::printUnknownLine( Outputter &stream, std::string const& _sTestName)
-{
- stream << _sTestName;
- stream << ";";
- stream << "UNKNOWN#";
- stream << "FAILED#";
- stream << Outputter::endl();
-}
-
-//# void
-//# testshlTestResult::printStatistics( Outputter &stream )
-//# {
-//# stream << "Test Results:" << std::endl;
-//#
-//# stream << "Run: " << runTests()
-//# << " Failures: " << testFailures()
-//# << " Errors: " << testErrors()
-//# << std::endl;
-//# }
-
-
-Outputter &
-operator <<( Outputter &stream,
- testshlTestResult &result )
-{
- result.print (stream); return stream;
-}
-
-
-} // namespace CppUnit
diff --git a/testshl2/source/cppunit/result/treswrapper.cxx b/testshl2/source/cppunit/result/treswrapper.cxx
deleted file mode 100644
index 50d0b7f8ebfe..000000000000
--- a/testshl2/source/cppunit/result/treswrapper.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <cstdarg>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <sal/types.h>
-#include <cppunit/Test.h>
-#include "testshl/autoregister/htestresult.h"
-#include "cppunit/callbackfunc_fktptr.h"
-#include "testshl/result/callbackfunc.h"
-#include "testshl/result/TestResult.h"
-#include <testshl/taghelper.hxx>
-
-#include <cppunit/tagvalues.hxx>
-
-namespace
-{
- void TestResult_startTest(hTestResult _pResult, hTest _pTest)
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
-
- std::string sName = pTest->getName();
- CallbackDispatch(0 /* NULL */, TAG_TYPE, SIGNAL_START_TEST, TAG_RESULT_PTR, _pResult, TAG_NODENAME, sName.c_str(), TAG_DONE);
-
- pResult->startTest(pTest);
- }
-
- void TestResult_endTest( hTestResult _pResult, hTest _pTest )
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- pResult->endTest(pTest);
-
- std::string sName = pTest->getName();
- CallbackDispatch(0 /* NULL */, TAG_TYPE, SIGNAL_END_TEST, TAG_RESULT_PTR, _pResult, TAG_NODENAME, sName.c_str(), TAG_DONE);
- }
-
-// -----------------------------------------------------------------------------
-
- void TestResult_addFailure( hTestResult _pResult, hTest _pTest, hException _pException )
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- CppUnit::Exception* pException = (CppUnit::Exception*)_pException;
- pResult->addFailure(pTest, pException);
- }
-
- void TestResult_addError( hTestResult _pResult, hTest _pTest, hException _pException )
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- CppUnit::Exception* pException = (CppUnit::Exception*)_pException;
- pResult->addError(pTest, pException);
- }
-
- sal_Int32 TestResult_shouldStop(hTestResult _pResult)
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- return pResult->shouldStop() == true ? 1 : 0;
- }
-
-// -----------------------------------------------------------------------------
- void TestResult_addInfo( hTestResult _pResult, hTest _pTest, const char* _sInfo )
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- // CppUnit::Exception* pException = (CppUnit::Exception*)_pException;
- pResult->addInfo(pTest, _sInfo);
- }
-// -----------------------------------------------------------------------------
- void TestResult_enterNode( hTestResult _pResult, const char* _sNode )
- {
- // signalPushName(getName());
- // CallbackDispatch(NULL, TAG_TYPE, EXECUTION_PUSH_NAME, TAG_RESULT_PTR, _pResult, TAG_NODENAME, _sNode, TAG_DONE);
-
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- // CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- // CppUnit::Exception* pException = (CppUnit::Exception*)_pException;
- pResult->enterNode(_sNode);
- }
- void TestResult_leaveNode( hTestResult _pResult, const char* _sNode )
- {
- CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult;
- // CppUnit::Test* pTest = (CppUnit::Test*)_pTest;
- // CppUnit::Exception* pException = (CppUnit::Exception*)_pException;
- pResult->leaveNode(_sNode);
-
- // CallbackDispatch(NULL, TAG_TYPE, EXECUTION_POP_NAME, TAG_RESULT_PTR, _pResult, TAG_DONE);
- }
-
-// -----------------------------------------------------------------------------
- sal_Int32 TestResult_StarterA(TagHelper const& _aTagItems)
- {
- sal_Int32 nRetValue = 0;
- TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0);
- hTestResult pResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */);
- CppUnit::Test* pTest = (CppUnit::Test*) _aTagItems.GetTagData(TAG_TEST_PTR, 0 /* NULL */);
-
- try
- {
- switch(nTagType)
- {
- case RESULT_START:
- TestResult_startTest(pResult, pTest);
- break;
-
- case RESULT_END:
- TestResult_endTest(pResult, pTest);
- break;
-
- case RESULT_ADD_FAILURE:
- {
- hException pException = (hException) _aTagItems.GetTagData(TAG_EXCEPTION, 0);
- TestResult_addFailure(pResult, pTest, pException);
- break;
- }
-
- case RESULT_ADD_ERROR:
- {
- hException pException = (hException) _aTagItems.GetTagData(TAG_EXCEPTION, 0);
- TestResult_addError(pResult, pTest, pException);
- break;
- }
-
- case RESULT_ADD_INFO:
- {
- const char* pInfo = (const char* ) _aTagItems.GetTagData(TAG_INFO, 0);
- TestResult_addInfo(pResult, pTest, pInfo);
- break;
- }
-
- case RESULT_ENTER_NODE:
- {
- const char* pNode = (const char* )_aTagItems.GetTagData(TAG_NODENAME, 0);
- TestResult_enterNode(pResult, pNode);
- break;
- }
-
- case RESULT_LEAVE_NODE:
- {
- const char* pNode = (const char* ) _aTagItems.GetTagData(TAG_NODENAME, 0);
- TestResult_leaveNode(pResult, pNode);
- break;
- }
-
- case RESULT_SHOULD_STOP:
- nRetValue = TestResult_shouldStop(pResult);
- break;
-
- default:
- fprintf(stderr, "TestResult_StarterA: Can't handle the tag type %8x\n", SAL_STATIC_CAST(int, nTagType));
- fflush(stderr);
- // throw std::exception(/*std::string("Unknown TYPE_TAG Exception.")*/);
- }
- }
- catch (std::exception &e)
- {
- fprintf(stderr, "TestResult_StarterA: Exception caught: %s\n", e.what());
- // throw e;
- }
-
- return nRetValue;
- }
-} // namespace anonymous
-
-// --------------------------------- Prototypes ---------------------------------
-
-sal_Int32 SignalHandlerA( TagHelper const& _aTagItems );
-sal_Int32 ExecutionA( TagHelper const& _aTagItems );
-
-// -----------------------------------------------------------------------------
-long CallbackDispatch(int x, ...)
-{
- (void) x; // avoid warning
-
- // The idea behind TagItems are from the Amiga OS.
- // Due to the fact that the following code does not find my ok
- // I decide to wrote a simple helper
- //
- // struct TagItem *tags = (struct TagItem *)&x + 1;
-
- TagHelper aTagItems;
-
- // the following code could also be in a #define, so other functions could
- // use this, but at the moment this function a the only one.
-
- // FILL_TAGS(aTagItems, x);
- std::va_list args;
- va_start( args, x );
- Tag nTag;
- do
- {
- nTag = va_arg(args, Tag);
- if (nTag != TAG_DONE)
- {
- TagData nValue = va_arg(args, TagData);
- // printf("Tag: %8x Value:%8x\n", nTag, nValue);
- aTagItems.insert(nTag, nValue);
- }
- } while (nTag != TAG_DONE);
-
- va_end ( args );
-
- // FILL_TAGS:END
-
- // printf(".\n");
-
- long nRetValue = 0;
- Tag nPreTag = aTagItems.GetTagData(TAG_TYPE);
- if ( (nPreTag & TAG_RESULT) == TAG_RESULT)
- {
- nRetValue = TestResult_StarterA( aTagItems );
- }
- else if ((nPreTag & TAG_SIGNAL) == TAG_SIGNAL)
- {
- nRetValue = SignalHandlerA(aTagItems);
- }
- else if (( nPreTag & TAG_EXECUTION) == TAG_EXECUTION)
- {
- nRetValue = ExecutionA(aTagItems);
- }
- else
- {
- fprintf(stderr, "CallbackDispatch: First tag is unknown %8x\n", SAL_STATIC_CAST(int, nPreTag));
- // unknown TAG_TYPE
- }
- return nRetValue;
-}
-
diff --git a/testshl2/source/cppunit/signaltest.cxx b/testshl2/source/cppunit/signaltest.cxx
deleted file mode 100644
index 0fbb24965699..000000000000
--- a/testshl2/source/cppunit/signaltest.cxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <typeinfo>
-
-#include "testshl/signaltest.h"
-
-namespace CppUnit
-{
-
-/** Constructs a test case for a suite.
- * This TestCase is intended for use by the TestCaller and should not
- * be used by a test case for which run() is called.
- **/
-SignalTest::SignalTest(std::string const& _sName)
- : m_sName( _sName )
-{
-}
-
-
-/// Destructs a test case
-SignalTest::~SignalTest()
-{
-}
-
-
-/// Returns a count of all the tests executed
-int
-SignalTest::countTestCases() const
-{
- return 1;
-}
-
-/// We never need to start this
-void SignalTest::run(hTestResult) {}
-
-
-/// Returns the name of the test case
-std::string
-SignalTest::getName() const
-{
- return m_sName;
-}
-
-
-/// Returns the name of the test case instance
-std::string
-SignalTest::toString() const
-{
- std::string className;
-
-#if CPPUNIT_USE_TYPEINFO_NAME
- const std::type_info& thisClass = typeid( *this );
- className = thisClass.name();
-#else
- className = "SignalTest";
-#endif
-
- return className + "." + getName();
-}
-
-} // namespace CppUnit
diff --git a/testshl2/source/cppunit/t_print.cxx b/testshl2/source/cppunit/t_print.cxx
deleted file mode 100644
index 367a97602012..000000000000
--- a/testshl2/source/cppunit/t_print.cxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <testshl/cmdlinebits.hxx>
-#include <rtl/tres.h>
-#include <osl/mutex.hxx>
-
-extern CmdLineBits st_nBits;
-
-sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag )
-{
- return( ( _nBits & _nFlag ) == _nFlag );
-}
-
-// -----------------------------------------------------------------------------
-// ----------------------------- own printf method -----------------------------
-// -----------------------------------------------------------------------------
-
-bool isVerbose()
-{
- if ( isBit( st_nBits, rtl_tres_Flag_VERBOSE ) )
- {
- return true;
- }
- return false;
-}
-
-bool isQuiet()
-{
- if ( isBit( st_nBits, rtl_tres_Flag_QUIET ) )
- {
- return true;
- }
- return false;
-}
-
-// ::osl::Mutex m_aTPrintMutex;
-
-void impl_t_print(const char* _pFormatStr, va_list &args)
-{
- if (! isQuiet())
- {
- // ::osl::MutexGuard g(m_aTPrintMutex);
- printf("# ");
- vprintf(_pFormatStr, args);
- }
-}
-
-void t_print(const char* _pFormatStr, ...)
-{
- va_list args;
- va_start( args, _pFormatStr );
- impl_t_print(_pFormatStr, args);
- va_end( args );
-}
-
-void t_print(T_Print_Params _eType, const char* _pFormatStr, ...)
-{
- if (_eType == T_VERBOSE && isVerbose())
- {
- // if T_VERBOSE and we should be verbose, print info
- va_list args;
- va_start( args, _pFormatStr );
- impl_t_print(_pFormatStr, args);
- va_end( args );
- }
-}
diff --git a/testshl2/source/cppunit/tresregister.cxx b/testshl2/source/cppunit/tresregister.cxx
deleted file mode 100644
index b43f2925b2c5..000000000000
--- a/testshl2/source/cppunit/tresregister.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <sal/types.h>
-#include <testshl/autoregister/registerfunc.h>
-#include <testshl/autoregister/callbackstructure.h>
-#include <testshl/cmdlinebits.hxx>
-
-//! is this global CallbackStructure need?
-CallbackStructure aGlobalStructure;
-CmdLineBits st_nBits;
-
-FktPtr_CallbackDispatch pCallbackFunc = NULL;
-
-// This function is called from the TestShl tool.
-extern "C" void SAL_CALL registerAllTestFunction(CallbackStructure* _pCallback)
-{
- aGlobalStructure = *_pCallback;
-
- st_nBits = aGlobalStructure.nBits;
-
- pCallbackFunc = _pCallback->aCallbackDispatch;
- FktRegFuncPtr pFunc = _pCallback->aRegisterFunction;
- if (pFunc)
- {
- RegisterTestFunctions(pFunc);
- }
- else
- {
- // error, should be echoed
- fprintf(stderr, "error: Callback Structure doesn't contain a test function ptr.\n");
- }
-
- // all is done, copy the magic value
- // this is only a simple internal invariant check,
- // if the called registerAllTestFunctions Function do, what we want.
- _pCallback->nMagic2 = _pCallback->nMagic;
-}
diff --git a/testshl2/source/cppunit/tresstatewrapper.cxx b/testshl2/source/cppunit/tresstatewrapper.cxx
deleted file mode 100644
index 580bb4dd1cf6..000000000000
--- a/testshl2/source/cppunit/tresstatewrapper.cxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-// this functions build the wrapper, to handle old function calls to rtl_tres_state
-// IMPORTANT: Due to the fact that rtl_tres_state is in the sal.lib
-// you have to rename rtl_tres_state to c_rtl_tres_state
-//
-// return c_rtl_tres_state
-// (
-// hRtlTestResult,
-// pData->length == 0 &&
-// ! *pData->buffer,
-// "New OString containing no characters",
-// "ctor_001"
-// )
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "cppunit/Test.h"
-#include "testshl/autoregister/htestresult.h"
-#include "cppunit/callbackfunc_fktptr.h"
-#include "cppunit/TestAssert.h"
-#include "testshl/checkboom.hxx"
-
-#define LOAD_TRESSTATEWRAPPER_LOCAL
-#include "testshl/tresstatewrapper.hxx"
-#undef LOAD_TRESSTATEWRAPPER_LOCAL
-
-#include "cppunit/tagvalues.hxx"
-#include "cppunit/externcallbackfunc.hxx"
-
-// -----------------------------------------------------------------------------
-// Wrapper class for the CppUnit::Test, because the new TestResult
-// expect a CppUnit::Test interface
-
-class WrappedTest : public CppUnit::Test
-{
- std::string m_sName;
-public:
- WrappedTest(std::string const& _sName)
- :m_sName(_sName){}
-
- virtual ~WrappedTest () {}
- virtual void run (hTestResult /*pResult*/){}
- virtual int countTestCases () const {return 1;}
- virtual std::string getName () const {return m_sName;}
- virtual std::string toString () const {return "WrappedTest";}
-};
-
-// -----------------------------------------------------------------------------
-rtl_tres_state_start::rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName)
- :m_pName(_pName),
- m_aResult(_aResult)
-{
- // (pTestResult_EnterNode)(m_aResult, m_pName);
- (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ENTER_NODE, TAG_RESULT_PTR, m_aResult, TAG_NODENAME, m_pName, TAG_DONE);
-}
-rtl_tres_state_start::~rtl_tres_state_start()
-{
- // (pTestResult_LeaveNode)(m_aResult, m_pName);
- (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_LEAVE_NODE, TAG_RESULT_PTR, m_aResult, TAG_NODENAME, m_pName, TAG_DONE);
-}
-
-// --------------------------------- C-Wrapper ---------------------------------
-typedef std::vector<rtl_tres_state_start*> rtl_tres_states;
-rtl_tres_states m_StateStack;
-
-extern "C" void c_rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName)
-{
- rtl_tres_state_start* pState = new rtl_tres_state_start(_aResult, _pName);
- m_StateStack.push_back(pState);
-}
-
-extern "C" void c_rtl_tres_state_end(hTestResult, const sal_Char*)
-{
- rtl_tres_state_start* pState = m_StateStack.back();
-
- delete pState;
- m_StateStack.pop_back();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// ------------------------- Wrapper for rtl_tres_state -------------------------
-// -----------------------------------------------------------------------------
-
-sal_Bool SAL_CALL c_rtl_tres_state(
- hTestResult pResult,
- sal_Bool bSuccess,
- char const * pTestMsg,
- char const * pFuncName)
-{
- CppUnit::Test* pTest = new WrappedTest(pFuncName);
-
- sal_Int32 nValue = (pCallbackFunc)(0 /* NULL */, TAG_TYPE, EXECUTION_CHECK, TAG_RESULT_PTR, pResult, TAG_NODENAME, pTest->getName().c_str(), TAG_DONE);
- if (nValue == DO_NOT_EXECUTE)
- {
- return false;
- }
-
- // This code is copied from CppUnit::TestCase and less adapted, to work with the
- // old test code.
- // (pTestResult_StartTest)(pResult, pTest);
- (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_START, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_DONE);
-
- try
- {
- CPPUNIT_ASSERT_MESSAGE( pTestMsg, bSuccess ? true : false );
- // (pTestResult_AddInfo)(pResult, pTest, "#PASSED#");
- (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ADD_INFO, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_INFO, "PASSED", TAG_DONE);
- }
- catch ( CppUnit::Exception &e )
- {
- CppUnit::Exception *copy = e.clone();
- // (pTestResult_AddFailure)( pResult, pTest, copy );
- (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_FAILURE, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, copy, TAG_DONE );
- }
- catch ( std::exception &e )
- {
- //(pTestResult_AddError)( pResult, pTest, new CppUnit::Exception( e.what() ) );
- (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, new CppUnit::Exception( e.what() ), TAG_DONE );
- }
- catch (...)
- {
- CppUnit::Exception *e = new CppUnit::Exception( "caught unknown exception" );
- // (pTestResult_AddError)( pResult, pTest, e );
- (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, e, TAG_DONE );
- }
-
-
- // (pTestResult_EndTest)( pResult, pTest );
- (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_END, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_DONE );
-
- return bSuccess;
-}
-
diff --git a/testshl2/source/cppunit/win32/makefile.mk b/testshl2/source/cppunit/win32/makefile.mk
deleted file mode 100644
index a7f7f037b738..000000000000
--- a/testshl2/source/cppunit/win32/makefile.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME=testshl2
-TARGET=c5t_winstuff
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-
-SLOFILES = \
- $(SLO)$/winstuff.obj
-
-#-------------------------------------------------------------------------------
-# This is a static lib
-LIB1TARGET= $(LB)$/$(TARGET).lib
-LIB1OBJFILES= \
- $(SLOFILES)
-
-.IF "$(GUI)"=="WNT"
-.IF "$(COM)"=="GCC"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-.ENDIF
-
-.IF "$(GUI)" == "UNX"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/source/cppunit/win32/winstuff.cxx b/testshl2/source/cppunit/win32/winstuff.cxx
deleted file mode 100644
index f9ffa0c5c972..000000000000
--- a/testshl2/source/cppunit/win32/winstuff.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#ifdef WIN32
-#include "testshl/winstuff.hxx"
-
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-#include <MAPIWin.h>
-
-void WinDebugBreak()
-{
- // forward to WinAPI. Note that the whole story is simply to
- // disentangle OOo headers from Windows headers (which are largely
- // incompatible, due to name clashes and macro mess-ups)
- DebugBreak();
-}
-
-void WinSleep( sal_uInt32 sec )
-{
- Sleep(sec * 1000);
-}
-
-sal_uInt32 WinGetCurrentProcessId()
-{
- return GetCurrentProcessId();
-}
-
-#define TA_FAILED 0
-#define TA_SUCCESS_CLEAN 1
-#define TA_SUCCESS_KILL 2
-#define TA_SUCCESS_16 3
-
- // Declare Callback Enum Functions.
-bool CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam );
-
-/*----------------------------------------------------------------
- DWORD WINAPI TerminateApp( DWORD dwPID, DWORD dwTimeout )
-
- Purpose:
- Shut down a 32-Bit Process (or 16-bit process under Windows 95)
-
- Parameters:
- dwPID
- Process ID of the process to shut down.
-
- dwTimeout
- Wait time in milliseconds before shutting down the process.
-
- Return Value:
- TA_FAILED - If the shutdown failed.
- TA_SUCCESS_CLEAN - If the process was shutdown using WM_CLOSE.
- TA_SUCCESS_KILL - if the process was shut down with
- TerminateProcess().
- NOTE: See header for these defines.
- ----------------------------------------------------------------*/
-void WinTerminateApp( sal_uInt32 dwPID, sal_uInt32 dwTimeout )
-{
- HANDLE hProc;
- DWORD dwRet;
-
- // If we can't open the process with PROCESS_TERMINATE rights,
- // then we give up immediately.
- hProc = OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, false,
- dwPID);
-
- if(hProc == NULL)
- return;
-
- // TerminateAppEnum() posts WM_CLOSE to all windows whose PID
- // matches your process's.
- EnumWindows((WNDENUMPROC)TerminateAppEnum, (LPARAM) dwPID);
-
- // Wait on the handle. If it signals, great. If it times out,
- // then you kill it.
- if (WaitForSingleObject(hProc, dwTimeout) != WAIT_OBJECT_0)
- dwRet= (TerminateProcess(hProc,0) ? TA_SUCCESS_KILL : TA_FAILED);
- else
- dwRet = TA_SUCCESS_CLEAN;
-
- CloseHandle(hProc);
-}
-
-bool CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam )
-{
- DWORD dwID;
-
- GetWindowThreadProcessId(hwnd, &dwID);
-
- if(dwID == (DWORD)lParam)
- {
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- }
-
- return true;
-}
-#else
-
-// this file is only need within Windows.
-// due to the fact that empty files don't create libraries
-// we store one function in it.
-int WinStuffDummy_this_function_will_never_need()
-{
- return 42; // we need some code
-}
-
-#endif /* WIN32 */
-
diff --git a/testshl2/source/dynamicregister.cxx b/testshl2/source/dynamicregister.cxx
deleted file mode 100644
index 8253fbcb5449..000000000000
--- a/testshl2/source/dynamicregister.cxx
+++ /dev/null
@@ -1,207 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include "testshl/dynamicregister.hxx"
-#include <osl/process.h>
-// #include <osl/mutex.hxx>
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-#include "testshl/filehelper.hxx"
-
-#include <unistd.h>
-
-#if defined(WIN32)
-#include <direct.h> /* w.g. _chdir() */
-#endif
-
-namespace fixes
-{
- int changedir(const char* _sPath)
- {
-#if defined(WIN32)
- // chdir(_sPath) is marked depricated since Visual C++ 2005
- // use _chdir instead
- return ::_chdir(_sPath);
-#else
- return ::chdir(_sPath);
-#endif
- }
-}
-
-// -----------------------------------------------------------------------------
-
-DynamicLibraryHelper::DynamicLibraryHelper(rtl::OUString const& _suDLLName, GetOpt & _aOptions)
- :m_pModule(new ::osl::Module()),
- m_suDLLName(_suDLLName),
- m_aOptions(_aOptions)
-{
- // create and load the module (shared library)
- m_suAbsolutePathFile = FileHelper::convertPath( _suDLLName );
-
- // due to some problems on mac OS
- // we split the absolute pathname to path and filename
- // change to the path and load the filename direct
- // then change back to the old path.
- rtl::OUString suPathSeparator = rtl::OUString( rtl::OUString::createFromAscii("/"));
- sal_Int32 nPos = m_suAbsolutePathFile.lastIndexOf(suPathSeparator);
- if (nPos != -1)
- {
- m_suAbsolutePath = m_suAbsolutePathFile.copy(0, nPos);
- m_suFilename = m_suAbsolutePathFile.copy(nPos + 1);
- }
- else
- {
- // Should never happen.
- rtl::OString sPath = rtl::OUStringToOString(m_suAbsolutePathFile, RTL_TEXTENCODING_ASCII_US);
- fprintf(stderr, "There is a problem with path '%s'.\n", sPath.getStr());
- exit(1);
- }
-
- if (getOptions().hasOpt("-absolutepath"))
- {
- fprintf(stderr, "Hint: Use absolute path to load test library.\n");
- loadLibraryFromAbsolutePath();
- }
- else if (getOptions().hasOpt("-localpath"))
- {
- fprintf(stderr, "Hint: make a chdir() to the test library, then try to load the test library without given path.\n");
- loadLibraryFromLocalPath();
- }
- else
- {
-
-// PLEASE DON'T CHANGE THIS STUPID STRUCTURE, JUST ADD YOUR ENVIRONMENT
-#if defined(LINUX)
- loadLibraryFromAbsolutePath();
- // will fail if load local
-
-#elif defined(SOLARIS)
- loadLibraryFromAbsolutePath();
- // will also be right if load local
-
-#elif defined(WIN32)
- loadLibraryFromAbsolutePath();
- // will fail if load local
-
-#elif defined(MACOSX)
- loadLibraryFromLocalPath();
- // will fail if local absolute
-#else
- // default is load absolute
- loadLibraryFromAbsolutePath();
-#endif
-}
-}
-
-void DynamicLibraryHelper::showFilenameIfVerbose()
-{
- if (getOptions().hasOpt("-verbose"))
- {
- rtl::OString sFilename = rtl::OUStringToOString(m_suFilename, RTL_TEXTENCODING_ASCII_US);
- rtl::OString sPath = rtl::OUStringToOString(m_suAbsolutePath, RTL_TEXTENCODING_ASCII_US);
- fprintf(stderr, "Try to load '%s' from '%s'.\n", sFilename.getStr(), sPath.getStr());
-
- // check filename
- }
-}
-
-void DynamicLibraryHelper::realLoadLibrary(rtl::OUString const& _suLibToLoad)
-{
- if (! m_pModule->load(_suLibToLoad, SAL_LOADMODULE_LAZY | SAL_LOADMODULE_GLOBAL))
- {
- rtl::OString sDLLName = rtl::OUStringToOString(m_suDLLName, RTL_TEXTENCODING_ASCII_US);
- fprintf(stderr, "warning: Can't load module '%s'.\n", sDLLName.getStr());
- }
-}
-
-void DynamicLibraryHelper::loadLibraryFromAbsolutePath()
-{
- showFilenameIfVerbose();
- realLoadLibrary(m_suAbsolutePathFile);
-}
-
-void DynamicLibraryHelper::loadLibraryFromLocalPath()
-{
- sal_Int32 nPos;
- rtl::OUString suPathSeparator = rtl::OUString( rtl::OUString::createFromAscii("/"));
-#if defined(WIN32)
- suPathSeparator = rtl::OUString( rtl::OUString::createFromAscii("\\"));
-#endif
- rtl::OUString suSystemPathFile;
- osl::FileBase::getSystemPathFromFileURL(m_suAbsolutePathFile, suSystemPathFile);
-
- nPos = suSystemPathFile.lastIndexOf(suPathSeparator);
- rtl::OUString suCurrentDirPath;
- if (nPos != -1)
- {
- // the filename only, no '/' in the path
- rtl::OUString suNewPath = suSystemPathFile.copy(0, nPos );
- if (suNewPath.getLength() > 0)
- {
- rtl::OString sPath = rtl::OUStringToOString(suNewPath, RTL_TEXTENCODING_ASCII_US);
- osl_getProcessWorkingDir( &suCurrentDirPath.pData );
-
- fixes::changedir(sPath.getStr());
-
- // curNewDirPath should be suPath, small self test
- rtl::OUString curNewDirPath;
- osl_getProcessWorkingDir( &curNewDirPath.pData );
- if (! curNewDirPath.equals(m_suAbsolutePath))
- {
- fprintf(stderr, "There is a problem with path '%s'.\n", sPath.getStr());
- }
- }
- }
-
- showFilenameIfVerbose();
- realLoadLibrary(m_suFilename);
-
- // change back to old directory
- if (suCurrentDirPath.getLength() > 0)
- {
- rtl::OString sCurrentDirPath = rtl::OUStringToOString(suCurrentDirPath, RTL_TEXTENCODING_ASCII_US);
- fixes::changedir(sCurrentDirPath.getStr());
- }
-}
-
-DynamicLibraryHelper::~DynamicLibraryHelper()
-{
- if (getOptions().hasOpt("-verbose"))
- {
- fprintf(stderr, "Dtor DynamicLibraryHelper.\n");
- fprintf(stderr, "Delete loaded module.");
- }
- delete m_pModule;
- if (getOptions().hasOpt("-verbose"))
- {
- fprintf(stderr, " [done].\n");
- }
-}
-
diff --git a/testshl2/source/file.cxx b/testshl2/source/file.cxx
deleted file mode 100644
index ca7ec3ad79f4..000000000000
--- a/testshl2/source/file.cxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string>
-
-// -----------------------------------------------------------------------------
-// taken from setup2
-std::string getTempPath()
-{
- std::string sTempDir;
-
- char* pTmp = getenv( "TEMP" );
- if (pTmp == NULL) pTmp = getenv("temp");
- if (pTmp == NULL) pTmp = getenv("TMP");
- if (pTmp == NULL) pTmp = getenv("tmp");
-
- if( pTmp && strlen(pTmp) >= 2 )
- {
- sTempDir = std::string( pTmp );
- }
- else
- {
-#if (defined UNX) || (defined OS2)
- int nLen;
- pTmp = P_tmpdir;
- nLen = strlen(pTmp);
- if (pTmp[ nLen - 1] == '/')
- {
- char cBuf[256];
- char* pBuf = cBuf;
- strncpy( pBuf, pTmp, nLen - 1 );
- pBuf[nLen - 1] = '\0';
- sTempDir = std::string( pBuf );
- }
- else
- {
- sTempDir = std::string( pTmp );
- }
-#else
- fprintf(stderr, "error: No temp dir found.\n");
-#endif
- }
- return sTempDir;
-}
diff --git a/testshl2/source/filehelper.cxx b/testshl2/source/filehelper.cxx
deleted file mode 100644
index ef2d78dd99ee..000000000000
--- a/testshl2/source/filehelper.cxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string>
-
-#include "testshl/filehelper.hxx"
-#include "testshl/getopt.hxx"
-
-#include <osl/process.h>
-#include <osl/file.hxx>
-
-#ifndef _SAL_TRES_H_
-#include <rtl/tres.h>
-#endif
-
-namespace FileHelper
-{
-// -----------------------------------------------------------------------------
-// taken from setup2
-std::string getTempPath()
-{
- std::string sTempDir;
-
- char const * pTmp = getenv( "TEMP" );
- if (pTmp == NULL) pTmp = getenv("temp");
- if (pTmp == NULL) pTmp = getenv("TMP");
- if (pTmp == NULL) pTmp = getenv("tmp");
-
- if( pTmp && strlen(pTmp) >= 2 )
- {
- sTempDir = std::string( pTmp );
- }
- else
- {
-#if (defined UNX) || (defined OS2)
- int nLen;
- pTmp = P_tmpdir;
- nLen = strlen(pTmp);
- if (pTmp[ nLen - 1] == '/')
- {
- char cBuf[256];
- char* pBuf = cBuf;
- strncpy( pBuf, pTmp, nLen - 1 );
- pBuf[nLen - 1] = '\0';
- sTempDir = std::string( pBuf );
- }
- else
- {
- sTempDir = std::string( pTmp );
- }
-#else
- fprintf(stderr, "error: No temp dir found.\n");
-#endif
- }
- return sTempDir;
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString convertPath( rtl::OUString const& _suSysPath )
-{
- // PRE: String should contain a filename, relativ or absolut
- rtl::OUString suURL;
- bool bRelativ = false;
-#ifdef WNT
- sal_Char cFileSep[] = "\\";
-#endif
-#if (defined UNX) || (defined OS2)
- sal_Char cFileSep[] = "/";
-#endif
-
- if ( _suSysPath.indexOf(rtl::OUString::createFromAscii("..")) == 0 )
- {
- bRelativ = true;
- }
- else if ( _suSysPath.indexOf(rtl::OUString::createFromAscii(cFileSep)) != 0 )
- {
- // no fileseparator found at first position found, must be relative
- bRelativ = true;
- }
-
- if (bRelativ)
- {
- // filepath contains '..' so it's a relative path make it absolut.
- rtl::OUString curDirPth;
- osl_getProcessWorkingDir( &curDirPth.pData );
-
- // rtl::OString sCurDirPath = rtl::OUStringToOString(curDirPth, RTL_TEXTENCODING_ASCII_US);
- // fprintf(stderr, "Current Dir '%s'.\n", sCurDirPath.getStr());
-
- osl::FileBase::getAbsoluteFileURL( curDirPth, _suSysPath, suURL );
-
- // rtl::OString sURL = rtl::OUStringToOString(suURL, RTL_TEXTENCODING_ASCII_US);
- // fprintf(stderr, " File URL: '%s'.\n", sURL.getStr());
- }
- else
- {
- osl::FileBase::getFileURLFromSystemPath( _suSysPath, suURL );
- }
- return suURL;
-}
-// -----------------------------------------------------------------------------
-rtl::OUString convertPath( rtl::OString const& sysPth )
-{
- rtl::OUString sysPath( rtl::OUString::createFromAscii( sysPth.getStr() ) );
- return convertPath(sysPath);
-}
-
-/**
- * create bitmap of comandline parameters
- */
-
-//# CmdLineBits createFlags( vector< sal_Char* > const& cmdln )
-//# {
-//# CmdLineBits retflags = rtl_tres_Flag_OK;
-//#
-//# vector< sal_Char* >::const_iterator iter = cmdln.begin();
-//# while( iter != cmdln.end() )
-//# {
-//# fprintf( stderr, "%s\n", *iter );
-//# if ( *iter[0] == '-' )
-//# {
-//# rtl::OString item( *iter );
-//# if ( item == "-boom" ) // stop near error position, exception only
-//# retflags |= rtl_tres_Flag_BOOM;
-//#
-//# if ( item == "-verbose" )
-//# retflags |= rtl_tres_Flag_VERBOSE;
-//#
-//# if ( item == "-skip" )
-//# retflags |= rtl_tres_Flag_SKIP;
-//#
-//# if ( item == "-log" )
-//# retflags |= rtl_tres_Flag_LOG;
-//#
-//# if ( item == "-his" )
-//# retflags |= rtl_tres_Flag_HIS;
-//#
-//# if ( item == "-time" )
-//# retflags |= rtl_tres_Flag_TIME;
-//#
-//# if ( item == "-msg" )
-//# retflags |= rtl_tres_Flag_MSG;
-//# }
-//# iter++;
-//# }
-//#
-//# return retflags;
-//# }
-//#
-//# CmdLineBits createFlags(int argc, char* argv[])
-//# {
-//# vector< sal_Char* > cmdln;
-//# sal_Int32 i;
-//#
-//# /* collect comandline */
-//# for ( i = 1; i < argc; i++ )
-//# cmdln.push_back( argv[i] );
-//#
-//# return createFlags(cmdln);
-//# }
-
-CmdLineBits createFlags( GetOpt & _aOptions )
-{
- CmdLineBits retflags = rtl_tres_Flag_OK;
-
- if (_aOptions.hasOpt("-boom")) // stop near error position, exception only
- {
- retflags |= rtl_tres_Flag_BOOM;
- }
-
- if (_aOptions.hasOpt("-verbose"))
- {
- retflags |= rtl_tres_Flag_VERBOSE;
- }
-
- if (_aOptions.hasOpt("-quiet"))
- {
- retflags |= rtl_tres_Flag_QUIET;
- }
- return retflags;
-}
-// -----------------------------------------------------------------------------
-
-/**
- * display usage screen
- */
-
-//# void usage()
-//# {
-//# fprintf( stdout,
-//# "USAGE: testshl shlname [-boom][-verbose][-log][-his][-msg]\n" );
-//# exit(0);
-//# }
-
-
-} // namespace FileHelper
-
-
diff --git a/testshl2/source/getopt.cxx b/testshl2/source/getopt.cxx
deleted file mode 100644
index 844a151276e1..000000000000
--- a/testshl2/source/getopt.cxx
+++ /dev/null
@@ -1,919 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include "testshl/getopt.hxx"
-
-#include "testshl/filehelper.hxx"
-
-using namespace std;
-//----------------------------------------------------------------------------
-// OptDsc
-//----------------------------------------------------------------------------
-//> createOptDsc
-void OptDsc::createOptDsc( const rtl::OString& opt ) {
-
- // analyze type of option
- // in case of flag indicate and set name and hint
- if ( ( opt.indexOf("=") == -1 ) && ( opt.indexOf(":") == -1 ) ) {
- m_type = OT_BOOL;
-
- // extract options dokumentation if any
- sal_Int32 index = opt.indexOf(",");
- if ( index == -1 ) {
- m_name = opt;
- }
- else {
- m_name = opt.copy( 0, index );
- m_hint = ( opt.copy( index + 1 ) ).trim();
- }
- return;
- }
-
- vector < rtl::OString > optLine;
-
- // ':' indicates that option has optional parameter(s)
- if ( opt.indexOf(":") != -1 ) {
- m_type |= OT_OPTIONAL;
- // create optionline tokenvector
- split( opt, ":,", optLine );
- }
- else {
- // create optionline tokenvector
- split( opt, "=,", optLine );
- }
-
- // extract name of option
- m_name = optLine[0];
-
- // parameter(s) of string type
- if ( optLine[1].indexOf("s") != -1 ) {
- m_type |= OT_STRING;
- m_legend += "arg";
- }
- // parameter(s) of numeric type
- if ( optLine[1].indexOf("n") != -1 ) {
- m_type |= OT_NUMBER;
- m_legend += "arg";
- }
- // multiple parameters allowed
- if ( optLine[1].indexOf("@") != -1 ) {
- m_type |= OT_MULTI;
- m_legend += "#1,[arg#n]";
- }
- else {
- m_type |= OT_SINGLE;
- }
-
- // extract options dokumentation if any
- m_hint = optLine[optLine.size()-1].trim();
-
-} ///< createOptDsc
-
-//> split
-void OptDsc::split( const rtl::OString& opt, const rtl::OString& cSet,
- vector< rtl::OString >& optLine ) {
-
- const sal_Int32 cSetLen = cSet.getLength();
- const sal_Char* pcSet = cSet.getStr();
- sal_Int32 index = 0;
- sal_Int32 oldIndex = 0;
-
- sal_Int32 i;
- for ( i = 0; i < cSetLen; i++ ) {
- index = opt.indexOf( pcSet[i] );
- if( index != -1 ) {
- optLine.push_back( opt.copy( oldIndex, index - oldIndex ) );
- oldIndex = index + 1;
- }
- }
- optLine.push_back( opt.copy( oldIndex ) );
-} ///< split
-
-//----------------------------------------------------------------------------
-// GetOpt
-//----------------------------------------------------------------------------
-//> ~GetOpt
-GetOpt::~GetOpt() {
- vector< OptDsc* >::iterator iter = m_optionset.begin();
- while ( iter != m_optionset.end() ) {
- delete (*iter);
- (*iter) = 0;
- iter++;
- }
- m_optionset.clear();
-} ///< ~GetOpt
-
-/**
- * private
- * initialization of GetOpt class means to fill the vector members
- * representing the commandline and optionset
- * @param char* cmdLine[] = comandline
- * @param char* optSet[] = optionset
- *
- * @return void
- */
-//> initialize
-void GetOpt::initialize( char* cmdLine[], char const * optSet[] ) {
-
- while ( *cmdLine ) {
- m_cmdline.push_back( rtl::OString( *cmdLine ) );
- *cmdLine++;
- }
- // insert an empty OString, to mark the end.
- m_cmdline.push_back(rtl::OString());
-
- while ( *optSet && ( rtl::OString( optSet[0] ).indexOf("-") == 0 ) ) {
- m_optionset.push_back( new OptDsc( *optSet ) );
- *optSet++;
- }
-
-} ///< initialize
-
-/**
- * public
- * returns a pointer to an object of type optiondescription (OptDsc)
- *
- * @param rtl::OString& opt = name of option
- *
- * @return OptDsc* = pointer to requested optiondescription
- * or NULL if not found
- */
-//> getOptDsc
-OptDsc* GetOpt::getOptDsc( rtl::OString& opt ) {
-
- vector< OptDsc* >::iterator iter = m_optionset.begin();
- while ( iter != m_optionset.end() ) {
- if ( (*iter)->getName() == opt ) {
- return (*iter);
- }
- iter++;
- }
- return NULL;
-
-} ///< getOptDsc
-
-/**
- * public
- * check if option is already present in optionhash
- * @param const rtl::OString& opt = name of option
- * @return sal_Bool
- */
-//> hasOpt
-sal_Bool GetOpt::hasOpt( const rtl::OString& opt ) const {
-
- if ( m_opthash.find( opt ) != m_opthash.end() ) {
- return sal_True ;
- }
- return sal_False ;
-
-} ///< hasOpt
-
-/**
- * private
- * handles the initialized comandline vector
- * and fill the optionhash with evaluated options
- * @param none
- * @return void
- */
-//> createCmdLineOptions
-void GetOpt::createCmdLineOptions() {
-
- // get iterator of comandline vector
- vector< rtl::OString >::iterator iter = m_cmdline.begin();
-
- // extract first comandlineparameter as program name
- m_prgname = (*iter);
- iter++;
-
- // process the whole vector
- while ( iter != m_cmdline.end() ) {
- // extract following comandline parameter(s) as program parameter(s)
- // int nIdxOfMinus = (*iter).indexOf("-");
- if ( (*iter).indexOf("-") != 0 ) /* start without '-' */
- {
- if ((*iter).getLength() > 0 ) /* is not empty */
- {
- m_param.push_back(*iter);
- }
- iter++;
- continue;
- }
- // option occured
- if ( (*iter).indexOf("-") == 0 )
- {
- // ignore invalid options
- if ( ! evaluateOpt( iter ) )
- {
- iter++;
- // check if wrong option has got a parameter
- // and skip that, too
- if( (iter + 1) != m_cmdline.end() )
- {
- if ( (*(iter + 1)).indexOf("-") != 0 )
- {
- iter++;
- }
- }
- continue;
- }
- rtl::OString opt( (*iter) );
- vector< rtl::OString > optValues;
-
- // option is no flag
- if ( ! getOptDsc( opt )->isFlag() ) {
- // but has optional parameters
- if ( getOptDsc( opt )->isOptional() ) {
- // no parameters present
- if ( ! hasParam( iter ) ) {
- m_opthash[ opt ] = optValues;
- optValues.clear();
- iter++;
- continue;
- }
- }
- iter++;
- // more than one option parameters occured
- if ( (*iter).indexOf( "," ) != -1 ) {
- tokenize( (*iter), "," , optValues );
- }
- else {
- optValues.push_back( (*iter) );
- }
- }
- // create key/value pair in optionhash and clear value vector
- m_opthash[ opt ] = optValues;
- optValues.clear();
- }
- iter++;
- }
-} ///< createCmdLineOptions
-
-/**
- * public
- * check if option has parameter(s)
- * @param vector< rtl::OString >::iterator iter = iterator of
- * comandline vector
- *
- * @return sal_Bool
- */
-//> hasParam
-sal_Bool GetOpt::hasParam( vector< rtl::OString >::iterator iter ) {
- if ( iter+1 == m_cmdline.end() ) {
- return sal_False;
- }
- if ( (*(iter+1)).indexOf("-") == 0 ) {
- return sal_False;
- }
- if ( (*(iter+1)) == "" ) {
- return sal_False;
- }
-
- return sal_True;
-} ///< hasParam
-
-/**
- * public
- * option evaluation in general means to verify if the option occur is
- * a member of optionset say an admitted option, if so does it appear with
- * the right or tolerable usage
- *
- * @param vector< rtl::OString >::iterator iter = iterator of
- * comandline vector
- *
- * @return sal_Bool
- */
-//> evaluateOpt
-sal_Bool GetOpt::evaluateOpt( vector< rtl::OString >::iterator iter ) {
-
- // option is no member of optionset
- if ( ! exist( (*iter) ) ) {
- cout << "Unknown option " << (*iter).getStr()
- << " occurred !" << endl;
- return sal_False;
- }
-
- // option is a flag
- if ( getOptDsc( (*iter) )->isFlag() ) {
- return sal_True;
- }
-
- // parameter not optional
- if ( ! getOptDsc( (*iter) )->isOptional() ) {
-
- // verify that next vectoritem is present and no option
- if ( ( *( iter + 1 ) ).getLength() &&
- ( ( *( iter + 1 ) ).indexOf( "-" ) != 0 ) ) {
-
- // if we are waiting for one single parameter
- if ( getOptDsc( *iter )->isSingle() ) {
- // but find multiple parameters
- if( ( *( iter + 1 ) ).indexOf(",") != -1 ) {
- cout << "Wrong use of option " << (*iter).getStr()
- << " too many parameters !" << endl;
- return sal_False;
- }
- return sal_True;
- }
- return sal_True;
- }
-
- cout << "Wrong use of option " << (*iter).getStr()
- << " parameter missing !" << endl;
- return sal_False;
- }
- // parameter optional
- if ( getOptDsc( *iter )->isSingle() ) {
-
- if ( hasParam( iter ) ) {
- if( ( *( iter + 1 ) ).indexOf(",") != -1 ) {
- cout << "Wrong use of option " << (*iter).getStr()
- << " too many parameters !" << endl;
- return sal_False;
- }
- }
- }
- return sal_True;
-
-} ///< evaluateOpt
-
-
-//> createOpt
-void GetOpt::createOpt( rtl::OString& optDscStr ) {
- m_optionset.push_back( new OptDsc( optDscStr ) );
-} ///< createOpt
-
-/**
- * public
- * conditional addition of an option to optionhash
- * overriding options, already present in optionhash, is not permitted
- *
- * @param rtl::OString& optStr = optionstring which is to break in a
- * key/value pair and to add to optionhash
- *
- * @return void
- */
-//> addOpt
-void GetOpt::addOpt( rtl::OString& optStr, sal_Bool eval ) {
-
- vector< rtl::OString > optTok;
- tokenize( optStr, "=", optTok );
-
- // prevent override of commandline options
- // by options from ini file
- if( hasOpt( optTok[0] ) ) {
- return;
- }
-
- // evaluate rigth usage of option
- if( eval ) {
- if ( ! evaluateOpt( optTok.begin() ) ) {
- return;
- }
- }
- vector< rtl::OString > optValues;
-
- if ( optTok.size() > 1 ) {
- rtl::OString oValStr( optTok[1] );
- // found a variable
- if ( oValStr.indexOf(",") == -1 ) {
- optValues.push_back( oValStr );
- }
- else {
- tokenize( oValStr, ",", optValues );
- }
- }
- m_opthash[ optTok[0] ] = optValues;
- optValues.clear();
- return;
-} ///< addOpt
-
-/**
- * public
- * verify the existance of an option in optionset
- * @param rtl::OString& opt = option name
- * @return sal_Bool
- */
-//> exist
-sal_Bool GetOpt::exist( rtl::OString& opt ) {
- if ( getOptDsc( opt ) ) {
- return sal_True;
- }
- return sal_False;
-} ///< exist
-
-/**
- * public
- * verify the existance of variables inside options
- * @param none
- * @return sal_Bool
- */
-//> hasVars
-sal_Bool GetOpt::hasVars() {
- if ( m_varvec.size() ) {
- return sal_True;
- }
- return sal_False;
-} ///< hasVars
-
-
-/**
- * public
- * proceeds a buffer representing the content of an ini file and adds the
- * options to optionhash. The optionstrings in the file are allowed to contain
- * variables indicated by delimiters described with varDelim
- *
- * @param rtl::OString iOpts = raw filecontent
- * @param const rtl::OString& varDelim = delimiter indicating a variable
- *
- * @return void
- */
-//> str2Opt
-void GetOpt::str2Opt( rtl::OString iOpts ) {
-
- // tokenize filecontent by '\n' to create a vector of lines
- vector< rtl::OString > iniLines;
- tokenize( iOpts, "\n", iniLines );
-
- sal_uInt32 tCnt = iniLines.size();
-
- // process all lines
- sal_uInt32 i;
- for ( i = 1; i < tCnt; i++ ) {
- rtl::OString optLine( iniLines[i] );
- // ignore comments
- if ( ! ( optLine.indexOf("#") == 0 ) ) {
- // filter valid options after trim
- if ( ( optLine.indexOf("-") == 0 ) ) {
- // line contains a variable
- if ( ( optLine.indexOf( m_vardelim ) != -1 ) ) {
- // push to var vector for later process
- m_varvec.push_back( optLine );
- continue;
- }
- addOpt( optLine );
- }
- }
- }
-} ///< str2opt
-
-void GetOpt::replVars() {
-
- // process vector of lines containing variables
- vector< rtl::OString >::iterator iter = m_varvec.begin();
- while ( iter != m_varvec.end() ) {
- sal_Int32 index = 0;
- while ( ( index = (*iter).indexOf( m_vardelim ) ) != -1 ) {
- vector< rtl::OString > varLineTok;
- rtl::OString varKey( "-" );
- tokenize( *iter, m_vardelim, varLineTok );
- varKey += varLineTok[1];
- vector< rtl::OString > keyValues = getOptVec( varKey );
-
- if ( keyValues.size() > 1 ) {
- rtl::OString rplStr;
-
- vector< rtl::OString >::iterator kvi = keyValues.begin();
- while ( kvi != keyValues.end() ) {
- rplStr += (*kvi);
- kvi++;
- if ( kvi != keyValues.end() ) {
- rplStr += ",";
- }
- }
- (*iter ) = (*iter).replaceAt(
- index, varKey.getLength()+1, rplStr );
- }
- else {
- if( *(keyValues[0])) {
- (*iter) = (*iter).replaceAt(
- index, varKey.getLength()+1, keyValues[0] );
- }
- }
- }
- addOpt( (*iter) );
- iter++;
- }
-
-}
-
-/**
- * public
- * displays a formatted usagescreen
- * @param none
- * @return void
- */
-//> showUsage
-void GetOpt::showUsage() {
-
- sFormat frm;
- frm.fCol = getMaxNameLength() + 2;
- frm.sCol = frm.fCol + getMaxLegendLength() + 2 ;
- frm.len = 79;
-
- vector< rtl::OString > nameVec;
- vector< rtl::OString > paramVec;
-
- tokenize( getName(), "/\\", nameVec );
- if ( m_param.empty() ) {
- if ( hasOpt( "-db" ) ) {
- tokenize( getOpt( "-db" ), "/\\", paramVec );
- }
- else {
- paramVec.push_back( rtl::OString( "not available" ) );
- }
- }
- else {
- tokenize( getFirstParam(), "/\\", paramVec );
- }
-
- cout << "\n\n\n\n\nUsage: prgname param [options]\n\nPRGNAME = [path]";
-
- if ( !nameVec.empty() ) {
- cout << (*(nameVec.end()-1)).getStr();
- }
- cout << "\nPARAM = [path]";
- if ( !paramVec.empty() ) {
- cout << (*(paramVec.end()-1)).getStr() << endl;
- }
-
- cout << "\nOPTIONS = [" << flush;
-
- vector< OptDsc* >::iterator iter = m_optionset.begin();
-
- while ( iter != m_optionset.end() ) {
- cout << (*iter)->getName().getStr() << "," << flush;
- iter++;
- }
- cout << "]\n\nOPTIONS:\n" << flush;
-
- iter = m_optionset.begin();
-
- while ( iter != m_optionset.end() ) {
- cout << optDsc2Str( *iter, frm ).getStr() << endl << flush;
-
- iter++;
- }
-
-} ///< showUsage
-
-/**
- * public
- * displays the actual option/parameter status
- * @param none
- * @return void
- */
-//> printStatus
-void GetOpt::printStatus( void ) {
-
- sal_uInt32 maxlen = getMaxNameLength();
- optHashMap::iterator iter = m_opthash.begin();
- cout << endl;
-
- while ( iter != m_opthash.end() ) {
- rtl::OString option( (*iter).first );
-
- cout.setf(ios::left);
- cout.width( maxlen+1 );
- cout << option.getStr() << "= ";
-
- if ( ! getOptDsc( option )->isFlag() ) {
- if ( ! getOptVec( option ).empty() ) {
- sal_uInt32 j;
- for ( j = 0; j < (*iter).second.size(); j++ ) {
- cout << (( (*iter).second )[j]).getStr() << " ";
- }
- cout << endl;
- }
- else {
- cout << "FALSE\n";
- }
- }
- else {
- cout << "TRUE\n";
- }
- iter++;
- }
-}
-
-/**
- * private
- * converts an object of type optiondescription (OptDsc) to a formatted
- * displayable string for usagescreen needs
- * @param OptDsc* optDsc = pointer to option description
- * @param sFormat frm = format structur
- *
- * @return const rtl::OString = formatted string for display purposes
- */
-//> optDsc2Str >>> to be replaced by intelliget algorythm <<<
-const rtl::OString GetOpt::optDsc2Str( OptDsc* optDsc , sFormat frm ) {
-
- sal_Char* buf = new sal_Char[ frm.len + 1 ];
- sal_Char* pBuf = buf;
-
- sal_uInt32 i;
- for ( i = 0; i < frm.len; i++ ) {
- *pBuf++ = ' ';
- }
- *pBuf = '\0';
-
- rtl::OStringBuffer strBuf( buf );
- rtl::OString oStr = strBuf.makeStringAndClear();
-
- oStr = oStr.replaceAt( 0, optDsc->getName().getLength(),
- optDsc->getName() );
- if ( optDsc->isOptional() ) {
- oStr = oStr.replaceAt( frm.fCol-1, 1, "[" );
- }
- oStr = oStr.replaceAt( frm.fCol, optDsc->getLegend().getLength(),
- optDsc->getLegend() );
- if ( optDsc->isOptional() ) {
- oStr = oStr.replaceAt( frm.fCol + optDsc->getLegend().getLength() ,
- 1, "]" );
- }
- if ( ( frm.sCol + optDsc->getHint().getLength() ) >= frm.len ) {
-
- oStr = oStr.replaceAt( frm.sCol, frm.len - frm.sCol,
- optDsc->getHint() );
- }
- else {
- oStr = oStr.replaceAt( frm.sCol,
- optDsc->getHint().getLength(), optDsc->getHint() );
- }
-
- delete [] buf;
-
- return oStr;
-
-} ///< optDsc2Str
-
-/**
- * private
- * returns the maximum length of all optionnames for format purposes
- * @param none
- * @return sal_uInt32 length of longest optionname
- */
-//> getMaxNameLength
-sal_uInt32 GetOpt::getMaxNameLength() {
-
- sal_Int32 len = 0;
- vector< OptDsc* >::iterator iter = m_optionset.begin();
-
- while ( iter != m_optionset.end() ) {
- if( len < (*iter)->getName().getLength() ){
- len = (*iter)->getName().getLength();
- }
- iter++;
- }
- return len;
-} ///< getMaxNameLength
-
-/**
- * private
- * returns the maximum length of all option legends for format purposes
- * @param none
- * @return sal_uInt32 length of longest optionlegend
- */
-//> getMaxLegendLength
-sal_uInt32 GetOpt::getMaxLegendLength() {
-
- sal_Int32 len = 0;
- vector< OptDsc* >::iterator iter = m_optionset.begin();
-
- while ( iter != m_optionset.end() ) {
- if( len < (*iter)->getLegend().getLength() ){
- len = (*iter)->getLegend().getLength();
- }
- iter++;
- }
- return len;
-
-} ///< getMaxLegendLength
-
-/**
- * public
- * reads the filecontent and pass it to str2opt to add valid options
- * to optionhash
- * @param rtl::OString iniPth = full qualified filename
- * @return ::osl::FileBase::RC = to indicate errors
- */
-//> getIniOptions
-::osl::FileBase::RC GetOpt::getIniOptions( rtl::OString iniPth ) {
-
- ::osl::FileStatus fState( FileStatusMask_All );
- ::osl::DirectoryItem dItem;
- rtl::OUString nrmPath( FileHelper::convertPath( iniPth ) );
-
- ::osl::DirectoryItem::get( nrmPath, dItem );
- dItem.getFileStatus( fState );
- rtl::OUString fName( fState.getFileURL() );
- ::osl::File iniFile( fName );
-
- const sal_uInt32 filesize = (sal_uInt32)fState.getFileSize();
-
- ::osl::FileBase::RC ret;
- sal_uInt64 bytesread;
-
- if ( ( ret = iniFile.open( OpenFlag_Read ) ) != ::osl::FileBase::E_None ) {
- return ret;
- }
- char* buf = new char[ filesize + 1 ];
- ret = iniFile.read( buf, filesize, bytesread );
- buf[ filesize ] = '\0';
-
- str2Opt( buf );
- delete [] buf;
- return ret;
-
-} ///< getIniOptions
-
-/**
- * private
- * tokenize a string in dependance of a character set and stores the tokens
- * to a token vector
- * @param const rtl::OString& opt = optionstring to tokenize
- * @param const rtl::OString& cSet = characterset of delimiters
- * @param vector< rtl::OString >& optLine = vector of tokens
- * @param sal_Bool strip = indicates if CR,LF and TAB should be stripped off
- * the token
- * @return void
- */
-//> tokenize
-void GetOpt::tokenize( const rtl::OString& opt, const rtl::OString& cSet,
- vector< rtl::OString >& optLine, sal_Bool strip ) {
-
- const sal_Char* pText; // pointer f. text,
- const sal_Char* pcSet; // charset and
- vector< const sal_Char* > delimVec; // vector of delimiters
-
- // parametercheck for opt ...
- if( ! opt.getLength() ) {
- return;
- }
- // ... and charSet
- if( ! cSet.getLength() ) {
- return;
- }
- // pointer to begin of textinstance
- pText = opt.getStr();
-
- // text
- while( *pText ) {
- // charset-pointer to begin of charset
- pcSet = cSet.getStr();
- // charset
- while( *pcSet ) {
- // delimiter found
- if( ( ( *pText == *pcSet ) ) && ( pText != opt ) ) {
- delimVec.push_back( pText );
- // increment counter
- }
- pcSet++;
- }
- // increment pointer
- pText++;
- }
-
- // save endpointer
- delimVec.push_back( opt + opt.getLength() );
-
- sal_Char* pToken; // ptr to token chars
- const sal_Char* pBegin; // ptr to begin of current,
- const sal_Char* pEnd=opt; // and begin of prev. token
- sal_uInt32 i=0;
-
- while ( pEnd < delimVec[delimVec.size()-1] ) {
-
- pBegin = pEnd;
- if( pBegin > opt.getStr() ) {
- pBegin += 1;
- }
- pEnd = delimVec[i];
- // initialize size
- sal_uInt32 nSize = pEnd - pBegin;
- // allocate memory
-
- // allocate memory for token
- sal_Char* cToken = new sal_Char[ nSize + 1 ];
-
- // get address of allocated memory
- pToken = cToken;
-
- // copy token from text
- sal_uInt32 j;
- for ( j = 0; j < nSize ; ++j ) {
- *pToken++ = *pBegin++;
- }
- // append string end
- *pToken = '\0';
-
- rtl::OString oTok(cToken);
-
- if( strip ) {
- // strip off CR,LF and TAB
- oTok = oTok.replace( 0x0a, 0x20 );
- oTok = oTok.replace( 0x0d, 0x20 );
- oTok = oTok.replace( 0x09, 0x20 );
- oTok = oTok.trim();
- }
- if( oTok != "" ) {
- // push to vector
- optLine.push_back( oTok );
- }
-
- // free memory where cToken points to
- delete [] cToken;
- i++;
- }
- return ;
-} ///< tokenize
-
-// -----------------------------------------------------------------------------
-rtl::OString& GetOpt::getOpt( const rtl::OString& opt )
-{
- if (m_opthash.find( opt ) != m_opthash.end())
- {
- if (!m_opthash[opt].empty())
- {
- return *( m_opthash[opt].begin() );
- }
- rtl::OString aStr;
- aStr = "GetOpt( ";
- aStr += opt;
- aStr += " ): Value not found.";
- throw ValueNotFoundException(aStr.getStr());
- }
- else
- throw ValueNotFoundException(opt);
-}
-
-
-// -----------------------------------------------------------------------------
-
-Exception::Exception()
- : m_sAsciiMessage()
-{
-}
-//---------------------------------------------------------------------
-Exception::Exception(char const* sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
-{
-}
-//---------------------------------------------------------------------
-Exception::Exception(rtl::OString const& sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
-{
-}
-//---------------------------------------------------------------------
-
-rtl::OUString Exception::message() const
-{
- return rtl::OStringToOUString( m_sAsciiMessage, RTL_TEXTENCODING_ASCII_US );
-}
-//---------------------------------------------------------------------
-char const* Exception::what() const
-{
- return m_sAsciiMessage.getLength() ? m_sAsciiMessage.getStr() : "FAILURE in REGSCAN: No description available";
-}
-
-// -----------------------------------------------------------------------------
-static const char c_sValueNotFoundException[] = "GetOpt: Value not Found Exception: ";
-//---------------------------------------------------------------------
-ValueNotFoundException::ValueNotFoundException()
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sValueNotFoundException)) )
-{
-}
-//---------------------------------------------------------------------
-
-ValueNotFoundException::ValueNotFoundException(char const* sException)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sValueNotFoundException)) + sException)
-{
-}
-
-
-
diff --git a/testshl2/source/makefile.mk b/testshl2/source/makefile.mk
deleted file mode 100644
index 86a6dc2ca1bc..000000000000
--- a/testshl2/source/makefile.mk
+++ /dev/null
@@ -1,130 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=testshl2
-TARGET=testshl2
-TARGETTYPE=CUI
-PRJINC=.
-
-ENABLE_EXCEPTIONS=TRUE
-#USE_LDUMP2=TRUE
-#LDUMP2=LDUMP3
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-
-COMMON_OBJFILES=\
- $(OBJ)$/getopt.obj \
- $(OBJ)$/filehelper.obj \
- $(OBJ)$/dynamicregister.obj
-
-TESTSHL_OBJFILES=\
- $(OBJ)$/autoregisterhelper.obj \
- $(OBJ)$/testshl.obj
-
-VERSIONINFO_OBJFILES=\
- $(OBJ)$/versionhelper.obj \
- $(OBJ)$/versioner.obj
-
-BMSMA_OBJFILES=\
- $(OBJ)$/bmsma.obj
-
-# for right dependencies
-# OBJFILES= $(COMMON_OBJFILES) $(TESTSHL_OBJFILES) $(VERSIONINFO_OBJFILES)
-
-# ------------------------------------------------------------------
-APP1TARGET= $(TARGET)
-APP1OBJS= $(COMMON_OBJFILES) $(TESTSHL_OBJFILES)
-APP1RPATH=NONE
-
-APP1STDLIBS=$(SALLIB)
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)" == "GCC"
-APP1STDLIBS+= \
- $(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a \
- $(LB)$/libc5t_testresult$(DLLPOSTFIX).a \
- $(LB)$/libc5t_no_regallfkt$(DLLPOSTFIX).a \
- $(LB)$/libc5t_winstuff$(DLLPOSTFIX).a
-.ELSE
-APP1LIBS= \
- $(SOLARLIBDIR)$/cppunit.lib \
- $(LB)$/c5t_testresult.lib \
- $(LB)$/c5t_no_regallfkt.lib \
- $(LB)$/c5t_winstuff.lib
-.ENDIF
-.ENDIF
-
-.IF "$(GUI)" == "OS2"
-APP1LIBS= \
- $(SOLARLIBDIR)$/cppunit.lib \
- $(LB)$/c5t_no_regallfkt.lib \
- $(LB)$/c5t_testresult.lib
-.ENDIF
-
-.IF "$(GUI)" == "UNX"
-APP1STDLIBS+= \
- $(LB)$/libc5t_testresult$(DLLPOSTFIX).a \
- $(LB)$/libc5t_no_regallfkt$(DLLPOSTFIX).a \
- $(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-.ENDIF
-
-#
-# ------------------------------------------------------------------
-APP2TARGET= versioninfo
-APP2OBJS= $(COMMON_OBJFILES) $(VERSIONINFO_OBJFILES)
-
-APP2STDLIBS=$(SALLIB)
-
-APP2DEPN=
-APP2LIBS=
-
-# ------------------------------------------------------------------
-APP3TARGET= $(TARGET)_timeout
-APP3OBJS= $(OBJ)$/getopt.obj $(OBJ)$/filehelper.obj $(OBJ)$/terminate.obj
-
-APP3STDLIBS=$(SALLIB)
-
-APP3DEPN=
-APP3LIBS=
-
-.IF "$(GUI)" == "WNT"
-.IF "$(COM)" == "GCC"
-APP3STDLIBS+= \
- $(LB)$/libc5t_winstuff$(DLLPOSTFIX).a
-.ELSE
-APP3LIBS += $(LB)$/c5t_winstuff.lib
-.ENDIF
-.ENDIF
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/source/terminate.cxx b/testshl2/source/terminate.cxx
deleted file mode 100644
index fcc9f75f83f0..000000000000
--- a/testshl2/source/terminate.cxx
+++ /dev/null
@@ -1,289 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#ifdef SOLARIS
-#include <sys/time.h>
-#include <sys/types.h>
-#endif
-
-#include <signal.h>
-
-#include <iostream>
-#include <string>
-
-#include "testshl/getopt.hxx"
-
-#if (defined UNX) || (defined OS2)
-#include <unistd.h> /* usleep */
-#include <sys/types.h>
-#include <signal.h>
-#endif
-
-#ifdef WNT
-# include "testshl/winstuff.hxx"
-#endif
-
-using namespace std;
-
-// -----------------------------------------------------------------------------
-class ProcessHandler
-{
- std::string m_sProcessIDFilename;
- int m_nPID;
-
- int getPID();
- int readPIDFromFile();
- void sendSignal(int _nPID);
- void write(int);
-public:
- ProcessHandler();
- void setName(std::string const& _sFilename);
-
- ~ProcessHandler();
-
- void waitForPIDFile(int);
- void waitForTimeout(int);
-};
-
-void my_sleep(int sec)
-{
-#ifdef WNT
- WinSleep(sec * 1000);
-#else
- usleep(sec * 1000000); // 10 ms
-#endif
-}
-
-// ------------------------------- ProcessHelper -------------------------------
-ProcessHandler::ProcessHandler():m_nPID(0) {}
-
-void ProcessHandler::setName(std::string const& _sPIDFilename)
-{
- m_sProcessIDFilename = _sPIDFilename;
-}
-
-int ProcessHandler::getPID()
-{
- return m_nPID;
-}
-
-int ProcessHandler::readPIDFromFile()
-{
- // get own PID
- int nPID = 0;
- if (m_sProcessIDFilename.size() > 0)
- {
- FILE* in;
- in = fopen(m_sProcessIDFilename.c_str(), "r");
- if (!in)
- {
- // fprintf(stderr, "warning: (testshl.cxx) can't read own pid.\n");
- return 0;
- // exit(0);
- }
- // if file exist, wait short, maybe the other tool writes it down.
- if (fscanf(in, "%d", &nPID) != 1)
- {
- // fprintf(stderr, "warning: (testshl.cxx) can't read own pid.\n");
- fclose(in);
- return 0;
- // exit(0);
- }
- fclose(in);
- }
- else
- {
- fprintf(stderr, "error: (terminate.cxx) PID Filename empty, must set.\n");
- exit(0);
- }
- return nPID;
-}
-
-ProcessHandler::~ProcessHandler()
-{
-}
-
-void ProcessHandler::sendSignal(int _nPID)
-{
- if (_nPID != 0)
- {
-#ifdef WNT
- WinTerminateApp(_nPID, 100);
-#else
- kill(_nPID, SIGKILL);
-#endif
- }
-}
-
-// -----------------------------------------------------------------------------
-void ProcessHandler::waitForPIDFile(int _nTimeout)
-{
- int nWaitforTimeout = _nTimeout;
- while (getPID() == 0 && nWaitforTimeout > 0)
- {
- int nPID = readPIDFromFile();
- if (nPID != 0)
- {
- m_nPID = nPID;
- break;
- }
-
- my_sleep(1);
- fprintf(stderr, "wait for pid file\n");
- nWaitforTimeout--;
- }
-
- if (nWaitforTimeout <= 0)
- {
- fprintf(stderr, "No PID found, time runs out\n");
- exit(1);
- }
-}
-// -----------------------------------------------------------------------------
-void ProcessHandler::waitForTimeout(int _nTimeout)
-{
- int nTimeout = _nTimeout;
- while (nTimeout > 0)
- {
- my_sleep(1);
- fprintf(stderr, "%d \r", nTimeout);
-
- int nNewPID = readPIDFromFile();
- if ( nNewPID != getPID() )
- {
- fprintf(stderr, "PID has changed.\n");
- if ( nNewPID != 0)
- {
- fprintf(stderr, "new PID is not 0, maybe forgotten to delete old PID file, restart timeout.\n");
- m_nPID = nNewPID;
- nTimeout = _nTimeout;
- }
- else
- {
- break;
- }
- }
- nTimeout --;
- }
- if (nTimeout <= 0)
- {
- fprintf(stderr, "PID: %d\n", getPID());
- sendSignal(getPID());
- write(0);
- }
-}
-
-void ProcessHandler::write(int _nPID)
-{
- // get own PID
-
- if (m_sProcessIDFilename.size() > 0)
- {
- FILE* out;
- out = fopen(m_sProcessIDFilename.c_str(), "w");
- if (!out)
- {
- fprintf(stderr, "warning: (testshl.cxx) can't write own pid.\n");
- return;
- // exit(0);
- }
- fprintf(out, "%d", _nPID);
- fclose(out);
- }
- else
- {
- fprintf(stderr, "warning: (testshl.cxx) PID Filename empty, must set.\n");
- }
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int, char* argv[] )
-#else
-int _cdecl main( int, char* argv[] )
-#endif
-{
- static char const * optionSet[] = {
- "-version, shows current program version and exit.",
- "-pid=s, write current process id to file",
- "-time=s, timeout [default is 10 sec]",
- "-h:s, display help or help on option",
- "-help:s, see -h",
- NULL
- };
-
- ProcessHandler aCurrentProcess;
-
- GetOpt opt( argv, optionSet );
- if ( opt.hasOpt("-pid") )
- {
- aCurrentProcess.setName(opt.getOpt("-pid").getStr());
- }
-
- int nTimeout = 10;
- if ( opt.hasOpt("-time"))
- {
- //
- nTimeout = opt.getOpt("-time").toInt32();
- if (nTimeout == 0)
- {
- nTimeout = 10;
- }
- }
-
- if ( opt.hasOpt("-version") )
- {
- fprintf(stderr, "testshl2_timeout $Revision: 1.9 $\n");
- exit(0);
- }
-
- // someone indicates that he needs help
- if ( opt.hasOpt( "-h" ) || opt.hasOpt( "-help" ) )
- {
- opt.showUsage();
- exit(0);
- }
-
- // wait until pid file exist ==============================
-
- aCurrentProcess.waitForPIDFile(10);
-
- printf("Found PID file, wait for timeout %d sec.\n", nTimeout);
-
- // timeout ==================================================
- aCurrentProcess.waitForTimeout(nTimeout);
-
- return 0;
-}
-
diff --git a/testshl2/source/testshl.cxx b/testshl2/source/testshl.cxx
deleted file mode 100644
index 22b90a0f7002..000000000000
--- a/testshl2/source/testshl.cxx
+++ /dev/null
@@ -1,396 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#ifdef SOLARIS
-#include <sys/time.h>
-#endif
-
-#ifdef WNT
-# include "testshl/winstuff.hxx"
-#endif
-
-#include <iostream>
-#include <vector>
-#include <memory> /* auto_ptr */
-#include "sal/main.h"
-#include <rtl/string.hxx>
-
-// #include <rtl/tres.h>
-#include "testshl/autoregisterhelper.hxx"
-// #include "cmdlinebits.hxx"
-#include "testshl/log.hxx"
-#include "testshl/filehelper.hxx"
-#include "testshl/getopt.hxx"
-#include "testshl/result/outputter.hxx"
-#include "testshl/joblist.hxx"
-
-// #include <osl/time.h>
-
-using namespace std;
-
-#include "testshl/result/testshlTestResult.h"
-#include "testshl/result/emacsTestResult.hxx"
-
-// Prototype for signal handling
-void setSignalFilename(GetOpt & opt);
-void removeSignalFile(GetOpt & opt);
-CmdLineBits st_nBits;
-
-void initTPrint(GetOpt & _aOptions)
-{
- st_nBits = FileHelper::createFlags(_aOptions);
-}
-
-void my_sleep(int nCount)
-{
-#ifdef WNT
- WinSleep(nCount * 2);
-#else
- usleep(nCount * 2000);
-#endif
-}
-
-// -----------------------------------------------------------------------------
-class ProcessHandler
-{
- std::string m_sProcessIDFilename;
- void write(int);
- int getPID();
-public:
- ProcessHandler();
- void setName(std::string const& _sFilename);
- ~ProcessHandler();
-};
-
-// ------------------------------- ProcessHelper -------------------------------
-ProcessHandler::ProcessHandler() {}
-
-void ProcessHandler::setName(std::string const& _sPIDFilename)
-{
- m_sProcessIDFilename = _sPIDFilename;
- write(getPID());
-}
-
-int ProcessHandler::getPID()
-{
- int nPID = 0;
-#ifdef WNT
- nPID = WinGetCurrentProcessId();
-#else
- nPID = getpid();
-#endif
-
- return nPID;
-}
-
-void ProcessHandler::write(int _nPID)
-{
- // get own PID
-
- if (m_sProcessIDFilename.size() > 0)
- {
- FILE* out;
- out = fopen(m_sProcessIDFilename.c_str(), "w");
- if (!out)
- {
- fprintf(stderr, "warning: (testshl.cxx) can't write own pid.\n");
- return;
- // exit(0);
- }
- fprintf(out, "%d", _nPID);
- fclose(out);
- my_sleep(2); // short wait, so testshl2_timeout can find this pid.
- }
- else
- {
- fprintf(stderr, "warning: (testshl.cxx) PID Filename empty, must set.\n");
- }
-}
-
-ProcessHandler::~ProcessHandler()
-{
- if (m_sProcessIDFilename.size() > 0)
- {
- write(0);
- my_sleep(2);
- fprintf(stderr, "hint: it is save to remove PID file.\n");
- }
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<CppUnit::TestResult> initResult(GetOpt & _aOptions)
-{
- std::auto_ptr<CppUnit::TestResult> pResult;
- if (_aOptions.hasOpt("-mode"))
- {
- if (_aOptions.getOpt("-mode").equals("emacs") == sal_True)
- {
- pResult.reset(new CppUnit::emacsTestResult(_aOptions));
- }
- }
- else
- {
- pResult.reset(new CppUnit::testshlTestResult(_aOptions));
- }
- return pResult;
-}
-
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<Outputter> initOutputter(GetOpt & _aOptions)
-{
- std::auto_ptr<Outputter> pOutputter;
-
- if (_aOptions.hasOpt("-log"))
- {
- rtl::OString sLogFile = _aOptions.getOpt("-log");
-
- Log* pLog = new Log( FileHelper::convertPath( sLogFile ) );
- if ( pLog->open() != osl::FileBase::E_None )
- {
- // cerr << "could not open LogFile: " << pLog->getName().getStr() << endl;
- fprintf(stderr, "could not open LogFile: %s\n", pLog->getName().getStr());
- exit(1);
- }
- pOutputter.reset(new Outputter(pLog));
- }
- else
- {
- pOutputter.reset(new Outputter(std::cout));
- }
-
- return pOutputter;
-}
-
-int starttest(GetOpt & opt, AutomaticRegisterHelper const& aHelper);
-
-void makeslow()
-{
- sal_Int32 n = 0;
- for (sal_Int32 i=0;i<1024 * 1024;i++)
- {
- ++n;
- }
-}
-// void endless()
-// {
-// sal_Int64 n = 0;
-// while(1)
-// {
-// n++;
-// makeslow();
-// my_sleep(1);
-// }
-// }
-
-// ----------------------------------- Main -----------------------------------
-
-SAL_IMPLEMENT_MAIN_WITH_ARGS(, argv)
-{
- static char const * optionSet[] = {
- "-boom, stop near error position, exception only",
- "-mode=s, the output mode, emacs, xml, old. Default is -mode old",
- "-log=s, destination file for logging",
- "-noerrors, shows all tests, but not it's errors.",
- "-onlyerrors, shows only the failed test functions",
-/* "-tc=s@, name(s) of testcase(s) to generate", */
- "-sf=s, absolute path and name to the signal file.",
-//! new (helpful if at debug time)
- "-dntsf, if given, do not touch signal file, also if one exist.",
- "-dnrmsf, do not remove signalfile. ",
- "-jobonly=s, job control file, these jobs should only executed.",
- "-jobexclude=s, job control file, but contains only job, they not execute.",
- "-jobfilter=s, use a filter for just some tests.",
- "-onlyshowjobs, show only all jobs, do no tests.",
- "-forward=s, this string will forwarded to the test libraries.",
- "-projectid=s, this text is added to the date output line.",
- "-buildid=s, this text is added to the date output line.",
- "-waitforkey, wait until key pressed.",
- "-verbose, be verbose.",
- "-quiet, be quiet. No t_print(...) will create output.",
- "-pid=s, write current process id to file",
- "-endless, testshl runs endless, for test only!!!",
- "-whereami, shows at runtime, which function is tested next.",
- "-noerroronexit, if this is given the program exits with return code 0 even if runtime errors occurs.",
- "-hardexit, Exit the tests without call any dtor.",
- "-absolutepath, Use the given absolute path to local the test library.",
- "-localpath, Make a chdir() to the test library path, then try to load the library without given path.",
- "-h:s, display help or help on option",
- "-help:s, see -h",
- NULL
- };
-
- ProcessHandler aCurrentProcess;
-
- GetOpt opt( argv, optionSet );
- initTPrint(opt);
-
- if ( opt.hasOpt("-pid") )
- {
- aCurrentProcess.setName(opt.getOpt("-pid").getStr());
- }
-
- if ( opt.hasOpt("-verbose") )
- {
- fprintf(stderr, "testshl2 $Revision: 1.25 $\n");
- }
-
- if ( opt.hasOpt("-endless")) // this exists only for self test issues
- {
-// endless();
-
-// With parameter -endless a test is attachable by debuggers
-// Attach to testshl2.exe set a breakpoint in this while (1) loop
-
-// Then you have to set the process pointer (Set next Statement) to
-// the next line outside the while loop.
-// Now it is possible to debug the whole code.
-// Never source this code to a function, because you will
-// lost the variables like opt.
-
- sal_Int64 n = 0;
- while(1)
- {
- n++;
- makeslow();
- my_sleep(1);
- }
- }
-
- int nExitCode = 0;
- bool bLibrary = true;
-
- // someone indicates that he needs help
- if ( opt.hasOpt( "-h" ) || opt.hasOpt( "-help" ) )
- {
- opt.showUsage();
- nExitCode = 0;
- }
- else
- {
- if (opt.getParams().empty())
- {
- // no library is given, but if a jobonly list is given, we should generate UNKNOWN errors.
- if (! opt.hasOpt("-jobonly"))
- {
- // std::cerr << "error: At least a library or a job file should given." << std::endl;
- fprintf(stderr, "error: At least a library or a job file should given.\n");
- opt.showUsage();
- nExitCode = 2;
- }
- else
- {
- bLibrary = false;
- }
- }
- else
- {
- setSignalFilename(opt);
-
- rtl::OUString suLibraryName;
- if (bLibrary)
- {
- suLibraryName = rtl::OStringToOUString(opt.getFirstParam(), osl_getThreadTextEncoding() /* RTL_TEXTENCODING_ASCII_US */ );
- }
-
- AutomaticRegisterHelper aHelper(suLibraryName, opt /*, &aJobs*/);
-
- if (aHelper.isOkToStartTests())
- {
- // start the tests
- nExitCode = starttest(opt, aHelper);
- }
- else
- {
-
- fprintf(stderr, "error: The library '%s' can't initialised, must quit.\n", opt.getFirstParam().getStr());
- nExitCode = 1;
- }
- }
- }
-
- if (opt.hasOpt("-noerroronexit"))
- {
- nExitCode = 0;
- }
- return nExitCode;
-}
-
-// -----------------------------------------------------------------------------
-// this function is only inserted to give a better startpoint for breakpoints
-
-int starttest(GetOpt & _opt, AutomaticRegisterHelper const& aHelper)
-{
- // create a TestResult
- std::auto_ptr<CppUnit::TestResult> pResult = initResult(_opt);
-
- // call all test functions
- aHelper.CallAll(pResult.get());
-
- // create and open log
- std::auto_ptr<Outputter> pOutput = initOutputter(_opt);
-
- // give the output
- pResult->print(*pOutput.get());
-
- // this is a debug extension, so you can read the output and after a key is pressed the program will end.
- if (_opt.hasOpt("-waitforkey"))
- {
- fprintf(stderr, "Press return key.");
- fflush(stderr);
- getchar();
- }
-
- if (_opt.hasOpt("-verbose"))
- {
- fprintf(stderr, "Remove signal handlers");
- }
-
- removeSignalFile(_opt);
-
- if (_opt.hasOpt("-verbose"))
- {
- fprintf(stderr, " [done]\n");
- }
-
- if (_opt.hasOpt("-hardexit"))
- {
- fprintf(stderr, "Hardexit forced.\n");
- abort();
- }
-
- int nExit = pResult->getExitValue();
- return nExit;
-}
-
diff --git a/testshl2/source/testshlrunner/ProcessHandler.java b/testshl2/source/testshlrunner/ProcessHandler.java
deleted file mode 100644
index 373b482d7825..000000000000
--- a/testshl2/source/testshlrunner/ProcessHandler.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-import java.io.InputStream;
-import java.io.File;
-import java.io.FileFilter;
-import java.util.ArrayList;
-import java.io.PrintWriter;
-import java.io.PrintStream;
-import java.io.LineNumberReader;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-
-/**
- * Class collect information from input stream in
- * background (sparate thread) and outputs it to
- * some log stream. I helps to avoid buffer overflow
- * when output stream has small buffer size (e.g.
- * in case when handling stdout from external
- * <code>Process</code>)
- *
- * This class is currently used by ProcesHandler
- * internally only.
- */
-class Pump extends Thread {
- private LineNumberReader reader;
- private String pref ;
- private Pump thread ;
- private StringBuffer buf = new StringBuffer(256);
- private PrintWriter log ;
-
- /**
- * Creates Pump for specified <code>InputStream</code>.
- * This Pump also synchronously output text read to
- * log by prefixed lines. Constructor immediately
- * starts reading in a separate thread.
- *
- * @param is Stream which requires permanent reading.
- * @param log Writer where prefixed text lines to be output
- * @param outPrefix A prefix which is printed at the
- * beginning of each output line.
- */
- public Pump(InputStream is, PrintWriter log, String outPrefix) {
- this.pref = outPrefix == null ? "" : outPrefix ;
- reader = new LineNumberReader(new InputStreamReader(is));
- this.log = log ;
- start() ;
- }
-
- public void run() {
- try {
- String line = reader.readLine() ;
- while (line != null) {
- log.println(pref + line);
- log.flush();
- buf.append(line).append('\n');
- line = reader.readLine() ;
- }
- } catch (java.io.IOException e) {
- log.println(pref + "Exception occured: " + e) ;
- }
- }
-
- /**
- * Returns the text collected from input stream.
- */
- public String getStringBuffer() {
- return buf.toString();
- }
-}
-
-/**
- * Class provides convenient way for running external program
- * handle its standard streams, control execution and check results.
- * Instance of this class must be created only for a single
- * execution. If you need to execute the same command again you
- * should create a new instance for this.
- */
-public class ProcessHandler {
- private String cmdLine;
- private String[] envVars = null;
- private File workDir = null;
- private PrintWriter log;
-
- private int exitValue = -1;
- private boolean isFinished = false;
- private boolean isStarted = false;
-
- private String stdInBuff = "";
- private Pump stdout = null ;
- private Pump stderr = null ;
- private PrintStream stdIn = null ;
-
- private Process proc = null ;
-
- /**
- * Creates instance with specified external command and
- * log stream where debug info is printed and output
- * of external command.
- */
- public ProcessHandler(String cmdLine, PrintWriter log) {
- this(cmdLine, log, null, null);
- }
- /**
- * Creates instance with specified external command.
- * Debug info and output
- * of external commandis printed to stdout.
- */
- public ProcessHandler(String cmdLine) {
- this(cmdLine, null, null, null);
- }
- /**
- * Creates instance with specified external command which
- * will be executed in the some work directory and
- * log stream where debug info and output
- * of external command is printed .
- * The specified environment variables are set for the new process.
- * If log stream is null, logging is printed to stdout.
- */
- public ProcessHandler(String cmdLine, PrintWriter log,
- File workDir, String[] envVars) {
- this.cmdLine = cmdLine ;
- this.workDir = workDir;
- this.log = log;
- this.cmdLine = cmdLine ;
- this.envVars = envVars;
- if (log == null)
- this.log = new PrintWriter(new OutputStreamWriter(System.out));
- else
- this.log = log;
- }
- /**
- * Creates instance with specified external command which
- * will be executed in the some work directory.
- * Debug info and output
- * of external commandis printed to stdout.
- */
- public ProcessHandler(String cmdLine, File workDir) {
- this(cmdLine, null, workDir, null);
- }
-
- /**
- * Executes the command and returns only when the process
- * exits.
- *
- * @return <code>true</code> if process was successfully
- * started and correcly exits (exit code doesn't affect
- * to this result).
- */
- public boolean executeSynchronously() {
- execute() ;
- return waitFor() ;
- }
-
- /**
- * Executes the command immediately returns. The process
- * remains in running state. Control of its state should
- * be made by <code>waitFor</code> methods.
- *
- * @return <code>true</code> if process was successfully
- * started.
- */
- public boolean executeAsynchronously() {
- execute() ;
- return isStarted() ;
- }
-
- public void kill() {
- if (!isStarted()) return;
- proc.destroy();
- isStarted = false;
- }
-
- protected void execute() {
- if (isStarted()) {
- throw new RuntimeException(
- "The process handler has already been executed.") ;
- }
- Runtime runtime = Runtime.getRuntime() ;
- try {
- log.println("Starting command: " + cmdLine) ;
- if (workDir != null) {
- proc = runtime.exec(cmdLine, envVars, workDir) ;
- } else {
- proc = runtime.exec(cmdLine, envVars) ;
- }
-
- isStarted = true ;
- } catch (java.io.IOException e) {
- log.println("The command "+cmdLine+" can't be started: " + e);
- return;
- }
- stdout = new Pump(proc.getInputStream(), log, "out > ");
- stderr = new Pump(proc.getErrorStream(), log, "err > ");
- stdIn = new PrintStream(proc.getOutputStream()) ;
-
- flushInput() ;
- }
-
- /**
- * This method is useful when the process was executed
- * asynchronously. Waits for process to exit and return
- * its result.
- *
- * @return <code>true</code> if process correctly exited
- * (exit code doesn't affect to this result).
- */
- public boolean waitFor() {
- return waitFor(0) ;
- }
-
- /**
- * This method is useful when the process was executed
- * asynchronously. Waits during specified time for process
- * to exit and return its status.
- *
- * @return <code>true</code> if process correctly exited
- * (exit code doesn't affect to this result).
- */
- public boolean waitFor(long timeout) {
- if (isFinished()) return true ;
- if (!isStarted()) return false ;
-
- if (timeout == 0) {
- try {
- proc.waitFor() ;
- } catch (InterruptedException e) {
- log.println("The process was interrupted: " + e);
- }
- isFinished = true ;
- try {
- exitValue = proc.exitValue() ;
- } catch (IllegalThreadStateException e) {}
- } else {
- try {
- while (!isFinished && timeout > 0) {
- isFinished = true ;
- Thread.sleep(1000);
- timeout -= 1000 ;
- try {
- exitValue = proc.exitValue() ;
- } catch (IllegalThreadStateException e) {
- isFinished = false ;
- }
- }
- } catch (InterruptedException ex) {
- log.println("The process was interrupted: " + ex);
- }
- }
-
- if (!isFinished) {
- proc.destroy();
- }
-
- try {
- stdout.join();
- stderr.join();
- } catch (InterruptedException e) {}
-
- return isFinished() ;
- }
-
- protected void flushInput() {
- if (stdIn == null) return ;
-
- synchronized(stdInBuff) {
- stdIn.print(stdInBuff);
- stdIn.flush();
- stdInBuff = "" ;
- }
- }
-
- /**
- * Returns the text output by external command to stdout.
- */
- public String getOutputText() {
- return stdout.getStringBuffer();
- }
- /**
- * Returns the text output by external command to stderr.
- */
- public String getErrorText() {
- return stderr.getStringBuffer();
- }
-
- /**
- * Prints the string specified to sdtin of external
- * command. '\n' is not added so if you need you
- * should terminate the string with '\n'. <p>
- *
- * The method can also be called before the command
- * starts its execution. Then the text is buffered
- * and transfered to command when it will be started.
- */
- public void printInputText(String str) {
- stdInBuff += str ;
- flushInput();
- }
-
- /**
- * Returns information about was the command started or
- * not.
- *
- * @return <code>true</code> if the external command was
- * found and successfully started.
- */
- public boolean isStarted() {
- return isStarted ;
- }
-
- /**
- * Returns the information about the final state of command
- * execution.
- *
- * @return <code>true</code> if the command correctly starts,
- * exits and was not interrupted due to timeout.
- */
- public boolean isFinished() {
- return isFinished ;
- }
-
- /**
- * Returns exit code of the external command.
- *
- * @return exit code of command if it was finished,
- * -1 if not.
- */
- public int getExitCode() {
- return exitValue ;
- }
-}
diff --git a/testshl2/source/testshlrunner/TestShl2Runner.java b/testshl2/source/testshlrunner/TestShl2Runner.java
deleted file mode 100644
index 295648121042..000000000000
--- a/testshl2/source/testshlrunner/TestShl2Runner.java
+++ /dev/null
@@ -1,937 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// package main;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.RandomAccessFile;
-import java.io.PrintWriter;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.sql.ResultSet;
-
-import java.util.HashMap;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.Properties;
-
-import java.io.FileInputStream;
-
-// -----------------------------------------------------------------------------
-/**
- * This class offers helper function, to easily connect to a database
- * delete values and insert values.
- */
-
-class PropertyHelper
-{
- public static Properties getProperties(String name)
- {
- Properties prop = new Properties();
- FileInputStream propFile = null;
- try {
- propFile = new FileInputStream(name);
- prop.load(propFile);
- propFile.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return prop;
- }
-
- public static void setProperties(Properties prop, String name) {
- FileOutputStream propFile = null;
- try {
- propFile = new FileOutputStream(name);
- prop.store(propFile,"");
- propFile.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
-
-class DBHelper
-{
- /**
- * This method inserts given values into<br>
- * the table 'states'
- * @param values a set of comma separated values to be inserted
- */
-
- public static void SQLinsertValues(String values)
- {
- Statement oStmt = null;
- Connection oCon = null;
- try
- {
- oCon = getMySQLConnection();
- oStmt = oCon.createStatement();
- ResultSet oResult = oStmt.executeQuery("insert into states values ("
- + values + ")");
- }
- catch(Exception e)
- {
- System.out.println("Couldn't insert values to db");
- e.printStackTrace();
- } finally
- {
- try
- {
- oCon.close();
- oCon = null;
- }
- catch (Exception e) {}
- }
- }
- /**
- * This method establishes a Connection<br>
- * with the database 'module_unit' on jakobus
- */
-
- public static Connection getMySQLConnection() throws Exception
- {
- Class.forName("org.gjt.mm.mysql.Driver");
- Connection mysql = DriverManager.getConnection(
- "jdbc:mysql://jakobus:3306/module_unit","admin","admin");
- return mysql;
- }
- /**
- * This method removes all entries of the given<br>
- * module/platform combination
- * @param mdl the name of the module, e.g. sal
- * @param os the name of the platform, e.g. unxsols
- */
-
- public static void SQLdeleteValues(String _sModulName, String _sEnvironment)
- {
- Statement oStmt = null;
- Connection oCon = null;
- try
- {
- oCon = getMySQLConnection();
- oStmt = oCon.createStatement();
- ResultSet oResult = oStmt.executeQuery("delete from states where mdl='"
- + _sModulName + "' AND pf='" + _sEnvironment + "'");
- }
- catch(Exception e)
- {
- System.out.println("Couldn't delete values from db");
- }
- finally
- {
- try
- {
- oCon.close();
- oCon = null;
- }
- catch (Exception e) {}
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-
-/**
- * This class helps to build only one output line if the classname and the methodname are the same.
- */
-
-class CurrentEntry
-{
- public String m_sDate;
- public String m_sClassName;
- public String m_sMethodName;
-
- ArrayList m_sMethodTestNames = new ArrayList();
- ArrayList m_sComments = new ArrayList();
- ArrayList m_sStates = new ArrayList();
-
- public String m_sCommentContainer = "";
-
- CurrentEntry()
- {}
-
- public String getState()
- {
- // build the right State
- String sAllIsRight = "PASSED#OK#";
- ArrayList sFailedStates = new ArrayList();
- boolean bFailed = false;
- for (int i=0; i<m_sStates.size();i++)
- {
- String sStatus = (String) m_sStates.get(i);
- if (!sStatus.equals(sAllIsRight))
- {
- bFailed = true;
- sFailedStates.add(sStatus);
- }
- }
- if (bFailed == false)
- {
- return "PASSED#OK#";
- }
-
- // interpret the failures
- return "PASSED#FAILED#";
- }
-
- public void add(String _sDate, String _sClassName, String _sMethodName, String _sMethodTestName, String _sState, String _sComment)
- {
- m_sDate = _sDate;
- m_sClassName = _sClassName;
- m_sMethodName = _sMethodName;
- m_sMethodTestNames.add(_sMethodTestName);
- m_sStates.add(_sState);
-
- if (_sComment.length() > 0)
- {
- String sComment = _sComment.replace('\'',' ');
-
- m_sComments.add(sComment);
-
- if (m_sCommentContainer.length() > 0)
- {
- m_sCommentContainer += ";<BR>";
- }
- m_sCommentContainer += _sMethodTestName + "(): " + _sComment;
- }
- }
-
-}
-// -----------------------------------------------------------------------------
-
-/**
- * HashMap Helper. At the moment classname and Methodname build a key value
- * if they already exist, we store additional information into the already existing value
- * if not, build an new entry.
- */
-
-class DatabaseEntry
-{
- HashMap aMap = new HashMap();
-
- public DatabaseEntry()
- {
- }
-
- public String Quote(String _sToQuote)
- {
- String ts = "'";
- return ts + _sToQuote + ts;
- }
-
- /**
- * Write down all collected lines into the database.
- */
- public void writeDown(String _sProjectName, String _sEnvironment)
- {
- System.out.println(" ");
- Set aSet = (Set)aMap.keySet();
- Iterator aIter = aSet.iterator();
- String sComma = ",";
-
- while (aIter.hasNext())
- {
- String sKey = (String)aIter.next();
- CurrentEntry aEntry = (CurrentEntry)aMap.get(sKey);
-
- String db_line= Quote(_sProjectName) + sComma +
- Quote( aEntry.m_sClassName) + sComma +
- Quote( aEntry.m_sMethodName) + sComma +
- Quote( aEntry.getState()) + sComma +
- Quote( _sEnvironment) + sComma +
- Quote( aEntry.m_sDate) + sComma +
- Quote( aEntry.m_sCommentContainer);
- System.out.println(db_line);
- DBHelper.SQLinsertValues(db_line);
- }
- }
-
-
- public void add(String _sDate, String _sClassName,
- String _sMethodName, String _sMethodTestName,
- String _sState, String _sComment)
- {
- String sKey = _sClassName + "." + _sMethodName;
- if (aMap.containsKey(sKey))
- {
- CurrentEntry aEntry = (CurrentEntry)aMap.get(sKey);
- aEntry.add(_sDate, _sClassName, _sMethodName, _sMethodTestName, _sState, _sComment);
- }
- else
- {
- CurrentEntry aEntry = new CurrentEntry();
- aEntry.add(_sDate, _sClassName, _sMethodName, _sMethodTestName, _sState, _sComment);
- aMap.put(sKey, aEntry);
- }
- }
-}
-
-/**
- *
- * This class will run the testshl2 script
- *
- * According to a given baseDir it'll first
- * get all scenario files, clean them up<br>
- * Then all sources will be compiled and
- * the scenarios started.<br>
- * After the a scenarios are finished the result
- * will be stored in the database.
- * @version 0.1
- */
-public class TestShl2Runner
-{
-
- Properties m_aProps;
-
- String m_sVersion = "udk399";
- String m_sExtension = "";
- String m_sProjectDir = "";
- String m_sEnvironment = "";
- String m_sProjectName = "";
- String m_sShellExecutable="";
- String m_sLocalEnv="";
-
- /**
- * The constructor to use this class from any other java-class
- * @param bdir the base directory where the qa-subfolder can be found
- * @param pf the platform e.g. unxsols
- * @param mod the module e.g. sal
- * @param ver the version e.g. udk304
- * @param pre the path to the shell, may be "", but is needed on Windows<br>
- * Systems to ensure that the created scripts run in an 4NT-shell
- */
-
-// public TestShl2Runner(String bdir, String pf, String project, String ver, String pre, String localenv)
- public TestShl2Runner(String filename)
- {
- String fs = System.getProperty("file.separator");
-
- m_aProps = PropertyHelper.getProperties(filename);
-
- m_sEnvironment = m_aProps.getProperty("ENV"); // unxsols3.pro
- m_sProjectName = m_aProps.getProperty("PROJECTNAME"); // sal
- m_sProjectDir = m_aProps.getProperty("BASEDIR") + fs + m_sProjectName; // /usr/qaapi/projects/udk/sal
- m_sVersion = m_aProps.getProperty("BUILD"); // udk305
- m_sShellExecutable = m_aProps.getProperty("SHELL"); // /bin/tcsh
- m_sLocalEnv = m_aProps.getProperty("LOCALENV"); // /usr/qaapi/projects/solartmp
-
- // if (m_sVersion.indexOf("-pro") > 1) m_sExtension=".pro";
-
- startAll();
- }
-
- /**
- * The main Method makes it possible to run this class standalone
- * @param args the command line arguments
- */
- public static void main(String args[])
- {
- if (args.length != 1)
- {
- System.out.println("Usage: TestShl2Runner <config.file>");
- System.out.println("Example: TestShl2Runner /usr/qaapi/projects/udk/sal/qa/configfile");
- System.exit(1);
- }
-
- TestShl2Runner aRunner = new TestShl2Runner(args[0]);
- }
-
- // -----------------------------------------------------------------------------
-
- ArrayList getJobs()
- {
- String fs = System.getProperty("file.separator");
- String sJobFile = m_sProjectDir + fs + m_aProps.getProperty("INPUT") + fs + m_aProps.getProperty("JOBFILE");
- ArrayList aLines = getLines(sJobFile);
- return aLines;
- }
-
- // -----------------------------------------------------------------------------
-
- public void startAll()
- {
- String fs = System.getProperty("file.separator");
-
- //get all scenario-files
- System.out.println("Getting jobs");
- ArrayList aJobList = getJobs();
-
- //cleanup scenorio-files and return a working array
- // Object[] the_array = cleanup(m_sProjectDir + fs + "qa" + fs + "sce" + fs,scene_files);
- // System.out.println("...done");
-
- //create a script to build the sources and run the tests
- System.out.println("creating start script for testprocess");
- String scriptName = createScript(aJobList);
- System.out.println("...done");
-
- //start the script
- System.out.println("starting script for testprocess");
- String sScript = m_sShellExecutable + " " + getOutputDir() + fs + scriptName;
- executeScript(sScript);
- System.out.println("...done");
-
- //remove old values from db-table
- DBHelper.SQLdeleteValues(m_sProjectName,m_sEnvironment);
- DBHelper.SQLdeleteValues(m_sProjectName,m_sEnvironment);
-
- //parse the output and store it
- parseOut (aJobList, m_sProjectName, m_sEnvironment, m_sProjectDir);
- }
-
- /**
- * This method reads the lines of a file and puts<br>
- * them into an ArrayList
- * @param filename the name of the file to be read
- */
-
- public ArrayList getLines(String filename)
- {
- File the_file = new File(filename);
- ArrayList the_lines = new ArrayList();
- if (! the_file.exists())
- {
- System.out.println("couldn't find file " + filename);
- return the_lines;
- }
- RandomAccessFile the_reader = null;
- try
- {
- the_reader = new RandomAccessFile(the_file,"r");
- String aLine = "";
- while (aLine != null)
- {
- aLine = the_reader.readLine();
- if ( (aLine != null) &&
- (! (aLine.length() < 2) ) &&
- (! aLine.startsWith("#")))
- {
- the_lines.add(aLine);
- }
- }
- }
- catch (java.io.FileNotFoundException fne)
- {
- System.out.println("couldn't open file " + filename);
- System.out.println("Message: " + fne.getMessage());
- }
- catch (java.io.IOException ie)
- {
- System.out.println("Exception while reading file " + filename);
- System.out.println("Message: " + ie.getMessage());
- }
- try
- {
- the_reader.close();
- }
- catch (java.io.IOException ie)
- {
- System.out.println("Couldn't close file " + filename);
- System.out.println("Message: " + ie.getMessage());
- }
- return the_lines;
- }
-
-
-
- /**
- * This method calls the createScript-methods<br>
- * for the given platform
- * @param basedir the name of the base-directory, e.g. /usr/qaapi/projects/udk/sal
- * @param qajobs jobs to be done
- */
-
- public String createScript(ArrayList _aJobList)
- {
- String res = "";
- if (m_sEnvironment.startsWith("wnt"))
- {
- try
- {
- res = createwntmsci(_aJobList);
- }
- catch (IOException ioe)
- {
- System.out.println("Couldn't create Script");
- }
- }
- else if (m_sEnvironment.startsWith("unx"))
- {
- try
- {
- res = createunx(_aJobList);
- }
- catch (IOException ioe)
- {
- System.out.println("Couldn't create Script");
- }
- }
- else
- {
- // can't handle unknown environment
- }
- return res;
- }
-
- public String getSignalFileParameter()
- {
- String sParameter;
- sParameter = " -sf /var/tmp/signalfile_" + m_sProjectName + "_" + m_sEnvironment + ".txt ";
- return sParameter;
- }
-
- public String getLogParameter(String job)
- {
- String sParameter = " -log " + getLogName(job) + " ";
- return sParameter;
- }
-
- public String getLogName(String job)
- {
- // create the ' -log file '
- String fs = System.getProperty("file.separator");
- String sLogName = getOutputDir() + fs + job + ".log";
- return sLogName;
- }
-
- public String getInputDir()
- {
- String fs = System.getProperty("file.separator");
- String sInputDir = m_sProjectDir + fs + m_aProps.getProperty("INPUT");
- return sInputDir;
- }
-
-
- public String getOutputDir()
- {
- String fs = System.getProperty("file.separator");
- String sOutputDir = m_sProjectDir + fs + m_sEnvironment + fs + m_aProps.getProperty("OUTPUT");
-
- File aFile = new File(sOutputDir);
- aFile.mkdirs();
- return sOutputDir;
- }
-
- public String getCAXParameter()
- {
- String sCAX = " ";
- // Due to the fu....g java that we havn't access to our well formed ;-)
- // environment variables the simple switch -cax do not longer work :-(
-
- // String sSolTmp = System.getenv("SOL_TMP");
- if (m_sLocalEnv.length() > 0)
- {
- sCAX = " -cax -tmp " + m_sLocalEnv;
- }
- // else
- // {
- // due to the fact that we don't want to get hole lokal env if no one exist, do nothing here.
- // }
- return sCAX;
- }
-
- public String getProParameter()
- {
- String sPro = " ";
- if (m_sEnvironment.endsWith(".pro"))
- {
- sPro = " -pro ";
- }
- return sPro;
- }
-
- public String getCompEnvName()
- {
- String sCompEnv;
- if (m_sEnvironment.endsWith(".pro"))
- {
- sCompEnv = String.copyValueOf(m_sEnvironment.toCharArray(), 0, 8);
- }
- else
- {
- sCompEnv = m_sEnvironment;
- }
- return " " + sCompEnv;
- }
-
- /**
- * This method create the script needed to compile and run the<br>
- * the tests on the Windows platform
- * @param basedir the name of the base-directory, e.g. /usr/qaapi/projects/udk/sal
- * @param qajobs jobs to be done
- */
-
- public void PreNPost(FileWriter out, String _sWhat) throws IOException
- {
- String ls = System.getProperty("line.separator");
-
- out.write(getRemark() + " do " + _sWhat + ls);
- for (int i = 1;i<9;i++)
- {
- String sWhat = m_aProps.getProperty(_sWhat + i);
- if (sWhat != null)
- {
- out.write(sWhat + ls);
- }
- }
- out.write(ls);
- }
-
- public String getChangeDirFkt()
- {
- if (m_sEnvironment.startsWith("wnt"))
- {
- return "cdd";
- }
- return "cd";
- }
- public String getRemark()
- {
- if (m_sEnvironment.startsWith("wnt"))
- {
- return "rem ";
- }
- return "# ";
- }
-
- public void do_setsolar(FileWriter out, String _sPreExec) throws IOException
- {
- String ls = System.getProperty("line.separator");
-
- out.write(getRemark() + " do a setsolar" + ls);
- out.write(_sPreExec + " setsolar -" + m_sVersion + getCAXParameter() + getProParameter() + getCompEnvName() + ls);
- out.write(ls);
- }
-
- public void do_cvs(FileWriter out, String _sPreExec, ArrayList _aJobList) throws IOException
- {
- String fs = System.getProperty("file.separator");
- String ls = System.getProperty("line.separator");
- out.write(getChangeDirFkt() + " " + getInputDir() + ls);
- out.write(getRemark() + " do a cvs and a dmake" + ls);
-
- out.write(_sPreExec + " " + "cvs -d" + m_aProps.getProperty("CVSROOT") + " update -d" + ls);
-
- for (int i=0; i<_aJobList.size();i++)
- {
- String sJob = (String) _aJobList.get(i);
-
- out.write(getChangeDirFkt() + " " + getInputDir() + fs + sJob + ls);
- // setenv VCSID lla
- // set VCSID=lla
- out.write(_sPreExec + " " + "dmake -u" + ls);
- }
- out.write(ls);
- }
-
- public void do_testtool(FileWriter out, String _sPreExec, ArrayList _aJobList) throws IOException
- {
- String ls = System.getProperty("line.separator");
- out.write(getRemark() + " call the test tool" + ls);
- out.write(getChangeDirFkt() + " " + getOutputDir() + ls);
- if (m_sEnvironment.startsWith("wnt"))
- {
- out.write("set DISABLE_SAL_DBGBOX=t" + ls);
- }
-
- for (int i=0; i<_aJobList.size();i++)
- {
- String sLine = (String) _aJobList.get(i);
- // String sJob = getJob(sLine);
- out.write(_sPreExec + " " + m_aProps.getProperty("TESTTOOL") + " " + getLibName(sLine, m_sEnvironment) + getLogParameter(sLine) + getSignalFileParameter() + ls);
- }
- out.write(ls);
- }
-
- public String createwntmsci(ArrayList _aJobList) throws IOException
- {
- String fs = System.getProperty("file.separator");
- String ls = System.getProperty("line.separator");
-
- String sBatchFile = m_aProps.getProperty("BATCHFILE");
- File outputFile = new File(getOutputDir(), sBatchFile);
- FileWriter out = new FileWriter(outputFile.toString());
-
- out.write("rem do not edit, will be created automatically by TestShl2Runner.java" + ls);
-
- // String sBuildEnvironment = "wntmsci9";
- PreNPost(out, "PRE");
-
- String sBatchPreExec = "call";
- do_setsolar(out, sBatchPreExec);
- do_cvs(out, sBatchPreExec, _aJobList);
- do_testtool(out, sBatchPreExec, _aJobList);
-
- PreNPost(out, "POST");
-
- // the exit is alsolute need here, because we do not get back, until
- // shell is stopped with exit.
- out.write("exit" + ls);
- out.close();
- return sBatchFile;
- }
-
- /**
- * This method create the script needed to compile and run the<br>
- * the tests on the Unix platform
- * @param basedir the name of the base-directory, e.g. /usr/qaapi/projects/udk/sal
- * @param qajobs jobs to be done
- */
-
- public String createunx(ArrayList _aJobList) throws IOException
- {
- String fs = System.getProperty("file.separator");
- String ls = System.getProperty("line.separator");
-
- String sBatchFile = m_aProps.getProperty("BATCHFILE");
- File outputFile = new File(getOutputDir(), sBatchFile);
- FileWriter out = new FileWriter(outputFile.toString());
-
- out.write("#!/bin/tcsh" + ls); // shebang
- out.write("# do not edit, will be created automatically by TestShl2Runner.java" + ls);
-
- PreNPost(out, "PRE");
-
- String sBatchPreExec = "";
- do_setsolar(out, sBatchPreExec);
- do_cvs(out, sBatchPreExec, _aJobList);
- do_testtool(out, sBatchPreExec, _aJobList);
-
- PreNPost(out, "POST");
-
- out.write("exit" + ls);
- out.close();
-
- // set excution bits
- String sExec = "chmod u+x " + getOutputDir() + fs + sBatchFile;
- Runtime.getRuntime().exec(sExec);
- return sBatchFile;
- }
-
- // -----------------------------------------------------------------------------
-
- /**
- * This method extracts the libname from a given<br>
- * job and adds a relative path based on the platform
- * @param job the job to be done
- * @param os the platform
- */
-
- public String getLibName(String job, String _sEnvironment)
- {
- String fs = System.getProperty("file.separator");
- // BACK: String like "../wntmsci9.pro/bin/rtl_OString.dll"
-
- String res = "";
- int nIndex = job.indexOf(".");
- // if (nIndex > 0)
- // {
- // }
- String sPureFilename = job;
- String purelibname = "";
- if (_sEnvironment.startsWith("wnt"))
- {
- purelibname = "bin" + fs + sPureFilename + ".dll";
- }
- else if (_sEnvironment.startsWith("unx"))
- {
- purelibname = "lib" + fs + "lib" + sPureFilename + ".so";
- }
- else
- {
- // _sEnvironment unknown
- // throw ...
- }
-
- // we are in the wntmsci9[.pro]/qa directory
- // to go to the bin directory we have to go to
- // ../bin or ../lib
- res = m_sProjectDir + fs + m_sEnvironment + fs + purelibname;
- return res;
- }
-
- // -----------------------------------------------------------------------------
-
-/*
- public Object[] cleanup(String sceneDir, String[] scene_files)
- {
- ArrayList res = new ArrayList();
- for (int j=0;j<scene_files.length;j++)
- {
- if (scene_files[j].endsWith(".sce"))
- {
- try
- {
- removeRemark(sceneDir,scene_files[j]);
- }
- catch (IOException ioe)
- {
- System.out.println("Couldn't cleanup Scene-File " + scene_files[j]);
- }
- String pure = scene_files[j].substring(0,
- scene_files[j].indexOf("."));
- res.add(pure + ".qadev");
- }
- }
- return res.toArray();
- }
-
-
- public void removeRemark(String sceneDir,String scene_file)
- throws IOException
- {
- ArrayList org = getLines(sceneDir + scene_file);
- String pure = scene_file.substring(0,scene_file.indexOf("."));
- String ls = System.getProperty("line.separator");
- File outputFile = new File(sceneDir,pure + ".qadev");
- FileWriter out = new FileWriter(outputFile.toString());
- for (int k=0;k<org.size();k++)
- {
- String toWrite = (String)org.get(k);
- if (toWrite.startsWith("#"))
- {
- toWrite=toWrite.substring(1);
- }
- out.write(toWrite + ls);
- }
- out.close();
- }
-*/
-
- public void parseOut (ArrayList sJobList, String _sProjectName, String _sEnvironment, String basedir)
- {
- //parse the out-files and store the data
- String fs = System.getProperty("file.separator");
- for (int i=0; i<sJobList.size();i++)
- {
- String sJob = (String) sJobList.get(i);
- String outFile = getLogName(sJob);
- ArrayList out_lines = getLines(outFile);
- String date="";
-
- DatabaseEntry aEntry = new DatabaseEntry();
-
- for (int j=0;j<out_lines.size();j++)
- {
- String sLine = (String)out_lines.get(j);
- if (sLine.startsWith("["))
- {
- date = sLine.substring(1, 11);
- date = date.replace('.','-');
- }
- else
- {
- if (sLine.startsWith("Test #PASSED#")) break;
- // if (out_lines.get(j).equals(
- // " ---------- ")) break;
-
- try
- {
- String sName = sLine.substring(0, sLine.indexOf(';'));
-
- // count dot's
- int nFirstDot = sName.indexOf('.');
- int nSecondDot = sName.indexOf('.', nFirstDot + 1);
- String sClassName = "";
- String sMethodName = "";
- String sMethodTestName = "";
-
- if (nFirstDot > 0)
- {
- sClassName = sName.substring(0, nFirstDot);
- if (nSecondDot > 0)
- {
- sMethodName = sName.substring(nFirstDot + 1, nSecondDot);
- sMethodTestName = sName.substring(nSecondDot + 1);
- }
- else
- {
- sMethodName = sName.substring(nFirstDot);
- }
- }
- else
- {
- // no FirstDot, also no secondDot!
- sClassName = sName;
- }
-
- String sComment = sLine.substring(sLine.lastIndexOf('#') + 1);
-
- // get state
- int nSecondNo = sLine.indexOf('#');
- nSecondNo = sLine.indexOf('#', nSecondNo + 1);
- String sState = sLine.substring(sLine.indexOf(";") + 1, nSecondNo + 1);
-
- aEntry.add(date, sClassName, sMethodName, sMethodTestName, sState, sComment);
- }
- catch(IndexOutOfBoundsException e)
- {
- System.out.println("IndexOutOfBoundException: caught in parseOut()");
- }
- }
- }
- aEntry.writeDown(_sProjectName, _sEnvironment);
- }
- }
-
- // -----------------------------------------------------------------------------
-
- private void shortWait(int nMilliSec)
- {
- try
- {
- Thread.sleep(nMilliSec);
- }
- catch (InterruptedException ex)
- {
- }
-
- }
-
- // -----------------------------------------------------------------------------
-
- public boolean executeScript(String scriptFile)
- {
- System.out.println("Running " + scriptFile);
-
- // Process testshl = Runtime.getRuntime().exec(scriptFile);
- ProcessHandler aHandler = new ProcessHandler(scriptFile);
- boolean bBackValue = aHandler.executeSynchronously();
- return bBackValue;
- // return false;
- }
-}
-
diff --git a/testshl2/source/testshlrunner/makefile.mk b/testshl2/source/testshlrunner/makefile.mk
deleted file mode 100644
index c29ff16e7c08..000000000000
--- a/testshl2/source/testshlrunner/makefile.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ = ..$/..
-
-PRJNAME = TestShl2Runner
-TARGET = TestShl2Runner
-
-# --- Settings -----------------------------------------------------
-.INCLUDE: settings.mk
-
-# JARFILES = ridl.jar unoil.jar jurt.jar juh.jar
-# Tip:
-# why 'grep java$$' the $$ is for a real $ and this is for regexp and stays for line end,
-# so we prevent us for compiling *.java~
-JAVAFILES = $(foreach,j,$(shell @ls | grep java$$) $j)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/source/versioner.cxx b/testshl2/source/versioner.cxx
deleted file mode 100644
index 10040ff8cd5f..000000000000
--- a/testshl2/source/versioner.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string>
-
-#include "testshl/versionhelper.hxx"
-
-#include <rtl/ustring.hxx>
-#include <iostream>
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int, char* argv[] )
-#else
-int _cdecl main( int, char* argv[] )
-#endif
-{
- static char const * optionSet[] = {
- "-time, display time only",
- "-date, display date only",
- "-upd, display UPD only",
- "-minor, display minor only",
- "-build, display build only",
- "-inpath, display inpath only",
- "-verbose, be verbose",
- "-h:s, display help or help on option",
- "-help:s, see -h",
- NULL
- };
-
- GetOpt opt( argv, optionSet );
-
- // someone indicates that he needs help
- if ( opt.hasOpt( "-h" ) || opt.hasOpt( "-help" ) )
- {
- opt.showUsage();
- exit(0);
- }
-
- if (opt.getParams().empty())
- {
- // std::cerr << "error: At least a library should given." << std::endl;
- fprintf(stderr, "error: At least a library should given.\n");
- opt.showUsage();
- exit(0);
- }
-
- rtl::OUString suLibraryName = rtl::OStringToOUString(opt.getFirstParam(), RTL_TEXTENCODING_ASCII_US );
- VersionHelper aHelper(suLibraryName, opt);
-
- if (! aHelper.isOk() )
- {
- fprintf(stderr, "error: No version info found.\n");
- exit(1);
- }
-
- if (opt.hasOpt("-time"))
- {
- fprintf(stdout, "%s\n", aHelper.getTime().getStr());
- }
- else if (opt.hasOpt("-date"))
- {
- fprintf(stdout, "%s\n", aHelper.getDate().getStr());
- }
- else if (opt.hasOpt("-upd"))
- {
- fprintf(stdout, "%s\n", aHelper.getUpd().getStr());
- }
- else if (opt.hasOpt("-minor"))
- {
- fprintf(stdout, "%s\n", aHelper.getMinor().getStr());
- }
- else if (opt.hasOpt("-build"))
- {
- fprintf(stdout, "%s\n", aHelper.getBuild().getStr());
- }
- else if (opt.hasOpt("-inpath"))
- {
- fprintf(stdout, "%s\n", aHelper.getInpath().getStr());
- }
- else
- {
- // std::cout << aHelper << std::endl;
- aHelper.printall(stdout);
- }
-
- return 0;
-}
diff --git a/testshl2/source/versionhelper.cxx b/testshl2/source/versionhelper.cxx
deleted file mode 100644
index 2a2f77fbbc6e..000000000000
--- a/testshl2/source/versionhelper.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-#include "testshl/versionhelper.hxx"
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-
-// -----------------------------------------------------------------------------
-VersionHelper::VersionHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions)
- :DynamicLibraryHelper(_sDLLName, _aOptions),
- m_pInfo(NULL)
-{
- // try to get the entry pointer
- FktGetVersionInfoPtr pFunc = (FktGetVersionInfoPtr)
- m_pModule->getFunctionSymbol(
- rtl::OUString::createFromAscii( "GetVersionInfo" ) );
-
- if (pFunc)
- {
- const VersionInfo *pVersion = (pFunc)();
- m_pInfo = pVersion;
- }
-}
-
-//# void VersionHelper::print(std::ostream &stream)
-//# {
-//# stream << " Time:" << getTime() << std::endl;
-//# stream << " Date:" << getDate() << std::endl;
-//# stream << " Upd:" << getUpd() << std::endl;
-//# stream << " Minor:" << getMinor() << std::endl;
-//# stream << " Build:" << getBuild() << std::endl;
-//# stream << "Inpath:" << getInpath() << std::endl;
-//# }
-//#
-//# std::ostream & operator <<( std::ostream &stream, VersionHelper &_aVersion )
-//# {
-//# _aVersion.print (stream);
-//# return stream;
-//# }
-//#
-// -----------------------------------------------------------------------------
-
-bool VersionHelper::isOk() const
-{
- if (m_pInfo != NULL) return true;
- return false;
-}
-
-rtl::OString VersionHelper::getTime() const
-{
- return m_pInfo->pTime;
-}
-rtl::OString VersionHelper::getDate() const
-{
- return m_pInfo->pDate;
-}
-rtl::OString VersionHelper::getUpd() const
-{
- return m_pInfo->pUpd;
-}
-rtl::OString VersionHelper::getMinor() const
-{
- return m_pInfo->pMinor;
-}
-rtl::OString VersionHelper::getBuild() const
-{
- return m_pInfo->pBuild;
-}
-rtl::OString VersionHelper::getInpath() const
-{
- return m_pInfo->pInpath;
-}
-
-
-
-void VersionHelper::printall(FILE * out)
-{
- if (isOk())
- {
- rtl::OString aStr = getTime();
- fprintf(out, " Time:%s\n", aStr.getStr() );
- fprintf(out, " Date:%s\n", getDate().getStr() );
- fprintf(out, " Upd:%s\n", getUpd().getStr() );
- fprintf(out, " Minor:%s\n", getMinor().getStr() );
- fprintf(out, " Build:%s\n", getBuild().getStr() );
- fprintf(out, "Inpath:%s\n", getInpath().getStr());
-
- fflush(out);
- }
- else
- {
- fprintf(stderr, "error: No version info found.\n");
- }
-}
-
diff --git a/testshl2/util/makefile.mk b/testshl2/util/makefile.mk
deleted file mode 100644
index 57eb9d546beb..000000000000
--- a/testshl2/util/makefile.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=testshl2
-TARGET=testshl2
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/codegen/README b/testshl2/workben/codegen/README
deleted file mode 100644
index 0c24b4a05856..000000000000
--- a/testshl2/workben/codegen/README
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory contains a simple code generator self test.
-Within UNIX simply start ./selftest
-
-You will get lot of output.
-The code generator creates some files,
-dmake compiles the generated code,
-testshl2 checks the code.
-
-If something goes wrong, you will hopefully get an informal error message.
diff --git a/testshl2/workben/codegen/checkfile b/testshl2/workben/codegen/checkfile
deleted file mode 100644
index 228642da52af..000000000000
--- a/testshl2/workben/codegen/checkfile
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/csh
-
-if ( -e $1 ) then
- echo "$1 exist."
-else
- echo "$1 doesn't exist."
-endif
diff --git a/testshl2/workben/codegen/cleanup b/testshl2/workben/codegen/cleanup
deleted file mode 100644
index a3fb82312cdf..000000000000
--- a/testshl2/workben/codegen/cleanup
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/csh
-
-# cleanup
-rm -f *.cxx *.new *.exp
-
-if ( -e makefile.mk_orig ) then
- rm -f makefile.mk
- # rename original makefile back
- mv makefile.mk_orig makefile.mk
-endif
diff --git a/testshl2/workben/codegen/makefile.mk b/testshl2/workben/codegen/makefile.mk
deleted file mode 100644
index 24039e69a548..000000000000
--- a/testshl2/workben/codegen/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=testshl2
-TARGET=codegen
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-#------------------------------- All object files -------------------------------
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/codegen/selftest b/testshl2/workben/codegen/selftest
deleted file mode 100644
index cf5e80e513ce..000000000000
--- a/testshl2/workben/codegen/selftest
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/csh
-
-echo "========== Generate code =========="
-echo
-
-perl ../../source/codegen/codegen.pl test.job
-
-echo
-echo "========== check files =========="
-echo
-
-./checkfile makefile.new
-./checkfile export.exp
-./checkfile skeleton.cxx
-./checkfile nomethod.cxx
-
-echo
-echo "========== backup makefile =========="
-echo
-
-# backup original makefile
-mv makefile.mk makefile.mk_orig
-mv makefile.new makefile.mk
-
-echo
-echo "========== build new sources =========="
-echo
-
-dmake debug=t
-
-echo
-echo "========== call testshl2 =========="
-echo
-
-
-if ( -e ../../${INPATH}/bin/testshl2 ) then
- ../../${INPATH}/bin/testshl2 -jobonly test.job
-
- echo
- ../../${INPATH}/bin/testshl2 ../../${INPATH}/lib/libtest.so
-else
- echo "testshl2 doesn't exist, test canceled."
-endif
-
-echo
-echo "========== cleanup =========="
-echo
-
-./cleanup
diff --git a/testshl2/workben/codegen/test.job b/testshl2/workben/codegen/test.job
deleted file mode 100644
index 07c47329705b..000000000000
--- a/testshl2/workben/codegen/test.job
+++ /dev/null
@@ -1,17 +0,0 @@
-# Jobfile
-# this is a job file which contain functions, which should exist
-
-skeleton.bones.bone_001
-skeleton.bones.bone_002
-
-skeleton.bones2.bone_001
-skeleton.bones2.bone_002
-
-nomethod.blah
-illegal
-
-# blah.fasel.suelz
-
-
-# rtl_OUStringBuffer.*
-
diff --git a/testshl2/workben/codegen/w32/checkfile.btm b/testshl2/workben/codegen/w32/checkfile.btm
deleted file mode 100644
index 091ecfbf9faf..000000000000
--- a/testshl2/workben/codegen/w32/checkfile.btm
+++ /dev/null
@@ -1,7 +0,0 @@
-rem %1 is the filename
-
-iff exist %1 then
-echo Ok: %1 exist.
-else
-echo ERROR: %1 does not exist.
-endiff
diff --git a/testshl2/workben/codegen/w32/cleanup.btm b/testshl2/workben/codegen/w32/cleanup.btm
deleted file mode 100644
index 5073ef887bac..000000000000
--- a/testshl2/workben/codegen/w32/cleanup.btm
+++ /dev/null
@@ -1,9 +0,0 @@
-rem cleanup
-del *.cxx *.new *.exp
-
-iff exist makefile.mk_orig then
- del makefile.mk
- rem rename original makefile back
- ren makefile.mk_orig makefile.mk
-endiff
-
diff --git a/testshl2/workben/codegen/w32/makefile.mk b/testshl2/workben/codegen/w32/makefile.mk
deleted file mode 100644
index d0ab5baf4afb..000000000000
--- a/testshl2/workben/codegen/w32/makefile.mk
+++ /dev/null
@@ -1,45 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME=testshl2
-TARGET=codegen
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-#------------------------------- All object files -------------------------------
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/codegen/w32/selftest.btm b/testshl2/workben/codegen/w32/selftest.btm
deleted file mode 100644
index e181ecc3158b..000000000000
--- a/testshl2/workben/codegen/w32/selftest.btm
+++ /dev/null
@@ -1,47 +0,0 @@
-
-rem demo
-
-echo "========== Generate code =========="
-echo
-
-perl ..\..\..\source\codegen\codegen.pl test.job
-
-echo
-echo "========== check files =========="
-echo
-
-call checkfile makefile.new
-call checkfile export.exp
-call checkfile skeleton.cxx
-call checkfile nomethod.cxx
-
-echo
-echo "========== backup makefile =========="
-echo
-
-ren makefile.mk makefile.mk_orig
-ren makefile.new makefile.mk
-
-echo
-echo "========== build new sources =========="
-echo
-
-call dmake debug=t
-
-echo
-echo "========== call testshl2 =========="
-echo
-
-iff exist ..\..\..\%INPATH%\bin\testshl2.exe then
-call ..\..\..\%INPATH%\bin\testshl2 -jobonly test.job
-call ..\..\..\%INPATH%\bin\testshl2 ..\..\..\%INPATH%\bin\test.dll
-else
- echo "testshl2 doesn't exist, test canceled."
-endiff
-
-echo
-echo "========== cleanup =========="
-echo
-
-call cleanup.btm
-
diff --git a/testshl2/workben/codegen/w32/test.job b/testshl2/workben/codegen/w32/test.job
deleted file mode 100644
index 07c47329705b..000000000000
--- a/testshl2/workben/codegen/w32/test.job
+++ /dev/null
@@ -1,17 +0,0 @@
-# Jobfile
-# this is a job file which contain functions, which should exist
-
-skeleton.bones.bone_001
-skeleton.bones.bone_002
-
-skeleton.bones2.bone_001
-skeleton.bones2.bone_002
-
-nomethod.blah
-illegal
-
-# blah.fasel.suelz
-
-
-# rtl_OUStringBuffer.*
-
diff --git a/testshl2/workben/dlltest/export.exp b/testshl2/workben/dlltest/export.exp
deleted file mode 100644
index a13529da5876..000000000000
--- a/testshl2/workben/dlltest/export.exp
+++ /dev/null
@@ -1 +0,0 @@
-registerAllTestFunction
diff --git a/testshl2/workben/dlltest/makefile.mk b/testshl2/workben/dlltest/makefile.mk
deleted file mode 100644
index fdbd8ce4b456..000000000000
--- a/testshl2/workben/dlltest/makefile.mk
+++ /dev/null
@@ -1,126 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-PRJINC=
-
-PRJNAME=testshl2
-TARGET=onefunc
-TARGETTYPE=CUI
-
-ENABLE_EXCEPTIONS=TRUE
-#USE_LDUMP2=TRUE
-#LDUMP2=LDUMP3
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-#--------------------------------- Objectfiles ---------------------------------
-OBJFILES=$(OBJ)$/onefuncstarter.obj
-SLOFILES=$(SLO)$/onefunc.obj
-
-# -------------------------------------------------------------------------------
-
-LIB1TARGET= $(LB)$/$(TARGET)_libfile.lib
-LIB1OBJFILES= $(SLOFILES)
-
-.IF "$(GUI)" == "UNX"
-LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-
-# ------------------------------------------------------------------
-SHL2OBJS = $(SLOFILES)
-
-SHL2TARGET= $(TARGET)_DLL
-SHL2STDLIBS+=\
- $(SALLIB)
-
-SHL2DEPN=
-SHL2IMPLIB= i$(SHL2TARGET)
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-
-DEF2NAME =$(SHL2TARGET)
-DEF2EXPORTFILE= export.exp
-
-#----------------------------- prog with *.lib file -----------------------------
-
-APP1TARGET= $(TARGET)starter
-APP1OBJS=$(OBJFILES)
-
-APP1STDLIBS=$(SALLIB)
-
-APP1DEPN= $(APP1OBJS) $(LIB1TARGET)
-APP1LIBS= $(LIB1TARGET)
-
-#-------------------------- executable with LIBARCHIV --------------------------
-
-APP2TARGET= $(TARGET)starter2
-APP2OBJS= $(OBJFILES)
-
-APP2STDLIBS=$(SALLIB)
-.IF "$(GUI)" == "UNX"
-APP2STDLIBS+=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a
-.ENDIF
-.IF "$(GUI)" == "WNT"
-APP2STDLIBS+=$(LIB1TARGET)
-.ENDIF
-
-APP2DEPN= $(APP1OBJS) $(LIB1TARGET)
-APP2LIBS=
-
-#----------------------- executable with dynamic library -----------------------
-
-APP3TARGET= $(TARGET)starter3
-APP3OBJS= $(OBJFILES)
-
-APP3STDLIBS=$(SALLIB)
-
-.IF "$(GUI)" == "WNT"
-APP3STDLIBS+=i$(SHL2TARGET).lib
-.ENDIF
-.IF "$(GUI)" == "UNX"
-APP3STDLIBS+=-l$(SHL2TARGET)
-.ENDIF
-
-APP3DEPN= $(APP1OBJS) $(LIB1TARGET)
-APP3LIBS=
-# APP3DEF=
-
-#----------------------- executable without any other files -----------------------
-
-APP4TARGET= $(TARGET)starter4
-APP4OBJS= $(OBJFILES)
-
-APP4STDLIBS=$(SALLIB)
-
-APP4DEPN= $(APP1OBJS)
-APP4LIBS=
-# APP3DEF=
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
diff --git a/testshl2/workben/dlltest/onefunc.cxx b/testshl2/workben/dlltest/onefunc.cxx
deleted file mode 100644
index 081018cab85f..000000000000
--- a/testshl2/workben/dlltest/onefunc.cxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <sal/types.h>
-#include "registerfunc.h"
-
-extern "C" void SAL_CALL firstfunc()
-{
- printf("first func called.\n");
-}
-extern "C" void SAL_CALL secondfunc()
-{
- printf("second func called.\n");
-}
-
-extern "C" void SAL_CALL registerAllTestFunction(FktRegFuncPtr _pFunc)
-{
- if (_pFunc)
- {
- (_pFunc)(&firstfunc, "firstfunc");
- (_pFunc)(&secondfunc, "secondfunc");
- }
-}
diff --git a/testshl2/workben/dlltest/onefuncstarter.cxx b/testshl2/workben/dlltest/onefuncstarter.cxx
deleted file mode 100644
index b62a1169d15a..000000000000
--- a/testshl2/workben/dlltest/onefuncstarter.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <vector>
-#include <stdio.h>
-#include "registerfunc.h"
-#include <osl/module.hxx>
-#include <osl/process.h>
-#include <osl/file.hxx>
-
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-
-typedef std::vector<FktPtr> FunctionList;
-FunctionList m_Functions;
-
-extern "C" bool SAL_CALL registerFunc(FktPtr _pFunc, const char* _sFuncName)
-{
- printf("Function register call for func(%s) successful.\n", _sFuncName);
- m_Functions.push_back(_pFunc);
- // FktPtr pFunc = _pFunc;
- // if (_pFunc)
- // {
- // (_pFunc)();
- // }
-
- return true;
-}
-
-void callAll()
-{
- for(FunctionList::const_iterator it = m_Functions.begin();
- it != m_Functions.end();
- ++it)
- {
- FktPtr pFunc = *it;
- if (pFunc)
- {
- (pFunc)();
- }
- }
-}
-
-// void test_link_at_compiletime()
-// {
-// FktRegFuncPtr pRegisterFunc = &registerFunc;
-// registerAll(pRegisterFunc);
-// callAll();
-// }
-
-
-// -----------------------------------------------------------------------------
-rtl::OUString convertPath( rtl::OString const& sysPth )
-{
- // PRE: String should contain a filename, relativ or absolut
- rtl::OUString sysPath( rtl::OUString::createFromAscii( sysPth.getStr() ) );
- rtl::OUString fURL;
- if ( sysPth.indexOf("..") == 0 )
- {
- // filepath contains '..' so it's a relative path make it absolut.
- rtl::OUString curDirPth;
- osl_getProcessWorkingDir( &curDirPth.pData );
- osl::FileBase::getAbsoluteFileURL( curDirPth, sysPath, fURL );
- }
- else
- {
- osl::FileBase::getFileURLFromSystemPath( sysPath, fURL );
- }
- return fURL;
-}
-// -----------------------------------------------------------------------------
-
-void test_link_at_runtime()
-{
- ::osl::Module* pModule;
- pModule = new ::osl::Module();
- // create and load the module (shared library)
- // pModule = new ::osl::Module();
-#if (defined WNT) || (defined OS2)
- pModule->load( convertPath( rtl::OString( "onefunc_DLL.dll" ) ) );
-#endif
-#ifdef UNX
- pModule->load( convertPath( rtl::OString( "libonefunc_DLL.so" ) ) );
-#endif
-
- // get entry pointer
- FktRegAllPtr pFunc = (FktRegAllPtr) pModule->getSymbol( rtl::OUString::createFromAscii( "registerAllTestFunction" ) );
-
- if (pFunc)
- {
- FktRegFuncPtr pRegisterFunc = &registerFunc;
- pFunc(pRegisterFunc);
- callAll();
- }
-
- delete pModule;
-}
-
-
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char* argv[] )
-#else
-int _cdecl main( int argc, char* argv[] )
-#endif
-{
- (void) argc;
- (void) argv;
-// test_link_at_compiletime();
- test_link_at_runtime();
- return 0;
-}
diff --git a/testshl2/workben/dlltest/registerfunc.h b/testshl2/workben/dlltest/registerfunc.h
deleted file mode 100644
index 805b84bc7ddd..000000000000
--- a/testshl2/workben/dlltest/registerfunc.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _register_h
-#define _register_h
-
-#include <sal/types.h>
-
-typedef void (* FktPtr)(void);
-// register the given void* as a function pointer, true, if successful
-extern "C" bool SAL_CALL registerFunc(FktPtr aFunc, const char* aFuncName);
-
-typedef bool (* FktRegFuncPtr)(FktPtr aFunc, const char* aFuncName);
-extern "C" void SAL_CALL registerAllTestFunction(FktRegFuncPtr aFunc);
-
-typedef void (* FktRegAllPtr)(FktRegFuncPtr aFunc);
-#endif
diff --git a/testshl2/workben/examples/makefile.mk b/testshl2/workben/examples/makefile.mk
deleted file mode 100644
index 3ab358d2dc92..000000000000
--- a/testshl2/workben/examples/makefile.mk
+++ /dev/null
@@ -1,64 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-PRJINC=
-
-PRJNAME=testshl2
-TARGET=demotest
-TARGETTYPE=CUI
-
-ENABLE_EXCEPTIONS=TRUE
-#USE_LDUMP2=TRUE
-#LDUMP2=LDUMP3
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-
-#--------------------------------- Objectfiles ---------------------------------
-SLOFILES=$(SLO)$/testshl_test.obj
-
-# ------------------------------------------------------------------
-SHL2OBJS = $(SLOFILES)
-
-SHL2TARGET= $(TARGET)
-SHL2STDLIBS=\
- $(SALLIB) \
- $(SOLARLIBDIR)$/cppunit.lib
-
-SHL2DEPN=
-SHL2IMPLIB= i$(SHL2TARGET)
-SHL2DEF= $(MISC)$/$(SHL2TARGET).def
-
-DEF2NAME =$(SHL2TARGET)
-DEF2EXPORTFILE= export.exp
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/examples/testshl_test.cxx b/testshl2/workben/examples/testshl_test.cxx
deleted file mode 100644
index 2452f8310660..000000000000
--- a/testshl2/workben/examples/testshl_test.cxx
+++ /dev/null
@@ -1,286 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-
-#ifdef WNT
-// #define UNDER_WINDOWS_DEBUGGING
-// Nice feature, to debug under windows, install msdev locally and use DebugBreak() to stop a new process at a point you want.
-#ifdef UNDER_WINDOWS_DEBUGGING
-#include <tools/presys.h>
-#include <windows.h>
-#include <tools/postsys.h>
-
-#define VCL_NEED_BASETSD
-
-#endif /* UNDER_WINDOWS_DEBUGGING */
-#endif /* WNT */
-
-
-#include <vector>
-
-
-#ifndef _SAL_TRES_H_
-#include <rtl/tres.h>
-#endif
-
-#ifndef _TESTSHL_TSTMGR_H_
-#include "tstmgr.h"
-#endif
-
-#ifndef _RTL_STRING_HXX_
- #include <rtl/string.hxx>
-#endif
-
-#include <osl/time.h>
-
-using namespace std;
-
-
-/**
- * create bitmap of comandline parameters
- */
-sal_uInt32 createFlags( vector< sal_Char* > const& cmdln )
-{
- sal_uInt32 retflags = rtl_tres_Flag_OK;
-
- vector< sal_Char* >::const_iterator iter = cmdln.begin();
- while( iter != cmdln.end() )
- {
- fprintf( stderr, "%s\n", *iter );
- if ( *iter[0] == '-' )
- {
- rtl::OString item( *iter );
- if ( item == "-boom" )
- retflags |= rtl_tres_Flag_BOOM;
-
- if ( item == "-verbose" )
- retflags |= rtl_tres_Flag_VERBOSE;
-
- if ( item == "-skip" )
- retflags |= rtl_tres_Flag_SKIP;
-
- if ( item == "-log" )
- retflags |= rtl_tres_Flag_LOG;
-
- if ( item == "-his" )
- retflags |= rtl_tres_Flag_HIS;
-
- if ( item == "-time" )
- retflags |= rtl_tres_Flag_TIME;
-
- if ( item == "-msg" )
- retflags |= rtl_tres_Flag_MSG;
-
- if ( item == "-quiet" )
- retflags |= rtl_tres_Flag_QUIET;
- }
- iter++;
- }
-
- return retflags;
-}
-
-sal_uInt32 createFlags(int argc, char* argv[])
-{
- vector< sal_Char* > cmdln;
- sal_Int32 i;
-
- /* collect comandline */
- for ( i = 1; i < argc; i++ )
- cmdln.push_back( argv[i] );
-
- return createFlags(cmdln);
-}
-
-// -----------------------------------------------------------------------------
-
-/**
- * display usage screen
- */
-
-void usage()
-{
- fprintf( stdout,
- "USAGE: testshl shlname scename [-boom][-verbose][-log][-his][-msg]\n" );
- exit(0);
-}
-
-
-#include <fstream>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCaller.h>
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TestAssert.h>
-#include <cppunit/TextTestResult.h>
-
-namespace CppunitTest
-{
- class AStringTest : public CppUnit::TestCase
- {
- rtl::OString *m_pStr;
- public:
- AStringTest()
- :m_pStr(NULL) {}
-
- void setUp()
- {
- m_pStr = new rtl::OString("test1");
- // throw std::exception("initialization failed.");
- }
-
- void tearDown()
- {
- delete m_pStr;
- }
-
- void testEquality()
- {
- CPPUNIT_ASSERT( *m_pStr == "test1" );
- CPPUNIT_ASSERT( (*m_pStr).equalsIgnoreAsciiCase("Test1") );
- CPPUNIT_ASSERT( (*m_pStr).equalsIgnoreAsciiCase("Test2") );
- CPPUNIT_ASSERT( *m_pStr == "test1" );
- CPPUNIT_ASSERT( *m_pStr == "must also fail" );
- }
- void testEquality2()
- {
- rtl::OString aStr("test2");
- CPPUNIT_ASSERT( aStr == "test2" );
- CPPUNIT_ASSERT_MESSAGE("ein vergleichstest", aStr == "test2");
- CPPUNIT_ASSERT( aStr == "must also fail" );
- }
- void testThrow()
- {
- throw std::exception("an own exception!");
- CPPUNIT_ASSERT( *m_pStr == "test2" );
- }
- };
-
- CppUnit::TestSuite *suite1()
- {
- CppUnit::TestSuite *suite = new CppUnit::TestSuite( "AStringTest" );
-
- // CppUnit::TestSuite suite;
- // CppUnit::TextTestResult result;
-
- suite->addTest( new CppUnit::TestCaller<AStringTest>( "throw test", &AStringTest::testThrow ));
-// suite->addTest( new CppUnit::TestCaller<AStringTest>( "test op eq", &AStringTest::testEquality ));
-// suite->addTest( new CppUnit::TestCaller<AStringTest>( "test op eq", &AStringTest::testEquality2 ));
-
- return suite;
- }
-
- // -----------------------------------------------------------------------------
-
- class ASimpleTest : public CppUnit::TestCase
- {
- public:
- void testEqual()
- {
- CPPUNIT_ASSERT( 1 == 1 );
- }
- };
-
- CppUnit::TestSuite *suite2()
- {
- CppUnit::TestSuite *suite = new CppUnit::TestSuite( "A simple test" );
-
- // CppUnit::TestSuite suite;
- // CppUnit::TextTestResult result;
-
- suite->addTest( new CppUnit::TestCaller<ASimpleTest>( "1 == 1", &ASimpleTest::testEqual ));
-
- return suite;
- }
-
- // -----------------------------------------------------------------------------
-
- CppUnit::TestSuite *suite()
- {
- CppUnit::TestSuite *suite = new CppUnit::TestSuite( "A simple test" );
-
- // CppUnit::TestSuite suite;
- // CppUnit::TextTestResult result;
-
- suite->addTest( suite1() );
-// suite->addTest( suite2() );
-
- return suite;
- }
-}
-
-void cppunitbased_test()
-{
- {
- // ofstream out("c:\\temp\\output.txt", ios::out);
- CppUnit::TextTestResult aResult;
-
- CppUnit::TestSuite* pSuite = CppunitTest::suite();
-
- int nTests = pSuite->countTestCases();
- pSuite->run(&aResult);
-
- // aResult.print(out);
- cout << aResult;
-
- delete pSuite;
- }
-
- exit(1);
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char* argv[] )
-#else
-int _cdecl main( int argc, char* argv[] )
-#endif
-{
- cppunitbased_test();
-
- tslTestManager hMgr = 0;
-
- /* show usage screen if too less parameters */
- if ( argc < 3 )
- usage();
-
-#ifdef UNDER_WINDOWS_DEBUGGING
- DebugBreak();
-#endif
-
- sal_uInt32 nCmdlinebitflags = createFlags( argc, argv );
-
- hMgr = tsl_TestManager_create( argv, argc, nCmdlinebitflags );
- tsl_TestManager_run( hMgr );
- tsl_TestManager_destroy( hMgr );
- return 0;
-}
diff --git a/testshl2/workben/garbage_dump/float.cxx b/testshl2/workben/garbage_dump/float.cxx
deleted file mode 100644
index 30b5b7c2aebd..000000000000
--- a/testshl2/workben/garbage_dump/float.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <stdio.h>
-#include <double>
-#include <math.h> // fabs()
-// #include <sal/types.h>
-
-#define sal_Int16 short
-#define SAL_CALL
-
-// LLA: from kernel.h
-/*
- * min()/max() macros that also do
- * strict type-checking.. See the
- * "unnecessary" pointer comparison.
- */
-#define MIN(x,y) ({ \
- const typeof(x) _x = (x); \
- const typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x < _y ? _x : _y; })
-
-#define MAX(x,y) ({ \
- const typeof(x) _x = (x); \
- const typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x > _y ? _x : _y; })
-
-//------------------------------------------------------------------------
-// testing the method toDouble()
-//------------------------------------------------------------------------
-template<class T>
-sal_Int16 SAL_CALL test_rtl_OString_checkPrecisionSize()
-{
- sal_Int16 nSize = sizeof(T);
- T nCalcValue = 1.0;
-
- // (i + 1) is the current precision
- sal_Int16 i = 0;
- for (i=0;i<50;i++)
- {
- nCalcValue *= 10;
- T nValue = nCalcValue + 0.1;
- T dSub = nValue - nCalcValue;
- // ----- 0.11 ---- 0.1 ---- 0.09 -----
- if (0.11 > dSub && dSub < 0.09)
- {
- // due to the fact, that the value is break down we sub 1 from the precision value
- // but to suppress this, we start at zero, precision is i+1 till here --i;
- break;
- }
- }
-
- sal_Int16 j= 0;
- nCalcValue = 1.0;
- for (j=0;j<50;j++)
- {
- nCalcValue /= 10;
- T nValue = nCalcValue + 1.0;
- T dSub = nValue - 1.0;
- // ---- 0.02 ----- 0.01 ---- 0 --- -0.99 ---- -0.98 ----
- T dSubAbsolut = fabs(dSub);
- // ---- 0.02 ----- 0.01 ---- 0 (cut)
- if ( dSub == 0)
- break;
- }
- if (i != j)
- {
- // hmmm....
- // imho i +- 1 == j is a good value
- int n = i - j;
- if (n < 0) n = -n;
- if (n <= 1)
- {
- return MIN(i,j);
- }
- else
- {
- printf("warning: presision differs more than 1");
- }
- }
-
- return i;
-}
-
-void SAL_CALL test_precision( )
-{
- sal_Int16 nPrecision;
- nPrecision = test_rtl_OString_checkPrecisionSize<float>();
- nPrecision = test_rtl_OString_checkPrecisionSize<double>();
- nPrecision = test_rtl_OString_checkPrecisionSize<long double>();
- nPrecision = test_rtl_OString_checkPrecisionSize<Double>();
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char* argv[] )
-#else
-int main( int argc, char* argv[] )
-#endif
-{
- test_precision();
- return 0;
-}
-
-// The following sets variables for GNU EMACS
-// Local Variables:
-// tab-width:4
-// End:
diff --git a/testshl2/workben/garbage_dump/nippondir.cxx b/testshl2/workben/garbage_dump/nippondir.cxx
deleted file mode 100644
index 8cde8c227f22..000000000000
--- a/testshl2/workben/garbage_dump/nippondir.cxx
+++ /dev/null
@@ -1,316 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <iostream>
-#include<osl/file.hxx>
-
-#include<osl/thread.hxx>
-#include <tools/string.hxx>
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#ifndef ASCII
-#define ASCII(x) OUString::createFromAscii(x)
-#endif
-
-using namespace osl;
-using namespace rtl;
-using namespace std;
-
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-/*
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-*/
-
-inline void operator <<= (::rtl::OString& _rAsciiString, ::rtl::OUString const& _rUnicodeString )
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString, RTL_TEXTENCODING_ASCII_US).getStr();
-}
-// -----------------------------------------------------------------------------
-
-namespace FileHelper
-{
- rtl::OUString createOSLErrorString(FileBase::RC eError)
- {
- rtl::OUString aRet;
- switch(eError)
- {
- case osl_File_E_None:
- break;
-
- case osl_File_E_PERM:
- aRet = ASCII("Operation not permitted");
- break;
-
- case osl_File_E_NOENT:
- aRet = ASCII("No such file or directory");
- break;
-
- case osl_File_E_SRCH:
- aRet = ASCII("unknown error: osl_File_E_SRCH");
- break;
-
- case osl_File_E_INTR:
- aRet = ASCII("function call was interrupted");
- break;
-
- case osl_File_E_IO:
- aRet = ASCII("I/O error");
- break;
-
- case osl_File_E_NXIO:
- aRet = ASCII("No such device or address");
- break;
-
- case osl_File_E_2BIG:
- aRet = ASCII("unknown error: osl_File_E_2BIG");
- break;
-
- case osl_File_E_NOEXEC:
- aRet = ASCII("unknown error: osl_File_E_NOEXEC");
- break;
-
- case osl_File_E_BADF:
- aRet = ASCII("Bad file");
- break;
-
- case osl_File_E_CHILD:
- aRet = ASCII("unknown error: osl_File_E_CHILD");
- break;
-
- case osl_File_E_AGAIN:
- aRet = ASCII("Operation would block");
- break;
-
- case osl_File_E_NOMEM:
- aRet = ASCII("not enough memory for allocating structures");
- break;
-
- case osl_File_E_ACCES:
- aRet = ASCII("Permission denied");
- break;
-
- case osl_File_E_FAULT:
- aRet = ASCII("Bad address");
- break;
-
- case osl_File_E_BUSY:
- aRet = ASCII("Text file busy");
- break;
-
- case osl_File_E_EXIST:
- aRet = ASCII("File exists");
- break;
-
- case osl_File_E_XDEV:
- aRet = ASCII("unknown error: osl_File_E_XDEV");
- break;
-
- case osl_File_E_NODEV:
- aRet = ASCII("No such device");
- break;
-
- case osl_File_E_NOTDIR:
- aRet = ASCII("Not a directory");
- break;
-
- case osl_File_E_ISDIR:
- aRet = ASCII("Is a director");
- break;
-
- case osl_File_E_INVAL:
- aRet = ASCII("the format of the parameters was not valid");
- break;
-
- case osl_File_E_NFILE:
- aRet = ASCII("too many open files in the system");
- break;
-
- case osl_File_E_MFILE:
- aRet = ASCII("too many open files used by the process");
- break;
-
- case osl_File_E_NOTTY:
- aRet = ASCII("unknown error: osl_File_E_NOTTY");
- break;
-
- case osl_File_E_FBIG:
- aRet = ASCII("File too large");
- break;
-
- case osl_File_E_NOSPC:
- aRet = ASCII("No space left on device");
- break;
-
- case osl_File_E_SPIPE:
- aRet = ASCII("unknown error: osl_File_E_SPIPE");
- break;
-
- case osl_File_E_ROFS:
- aRet = ASCII("Read-only file system");
- break;
-
- case osl_File_E_MLINK:
- aRet = ASCII("Too many links");
- break;
-
- case osl_File_E_PIPE:
- aRet = ASCII("unknown error: osl_File_E_PIPE");
- break;
-
- case osl_File_E_DOM:
- aRet = ASCII("unknown error: osl_File_E_DOM");
- break;
-
- case osl_File_E_RANGE:
- aRet = ASCII("unknown error: osl_File_E_RANGE");
- break;
-
- case osl_File_E_DEADLK:
- aRet = ASCII("unknown error: osl_File_E_DEADLK");
- break;
-
- case osl_File_E_NAMETOOLONG:
- aRet = ASCII("File name too long");
- break;
-
- case osl_File_E_NOLCK:
- aRet = ASCII("No record locks available");
- break;
-
- case osl_File_E_NOSYS:
- aRet = ASCII("Function not implemente");
- break;
-
- case osl_File_E_NOTEMPTY:
- aRet = ASCII("Directory not empt");
- break;
-
- case osl_File_E_LOOP:
- aRet = ASCII("Too many symbolic links encountered");
- break;
-
- case osl_File_E_ILSEQ:
- aRet = ASCII("unknown error: osl_File_E_ILSEQ");
- break;
-
- case osl_File_E_NOLINK:
- aRet = ASCII("Link has been severed");
- break;
-
- case osl_File_E_MULTIHOP:
- aRet = ASCII("Multihop attempted");
- break;
-
- case osl_File_E_USERS:
- aRet = ASCII("unknown error: osl_File_E_USERS");
- break;
-
- case osl_File_E_OVERFLOW:
- aRet = ASCII("Value too large for defined data type");
- break;
-
- /* unmapped error: always last entry in enum! */
- case osl_File_E_invalidError:
- aRet = ASCII("unmapped Error");
- break;
- }
- return aRet;
- }
-} // namespace FileHelper
-
-
-#if (defined UNX) || (defined OS2)
-void main( int argc, char * argv[] )
-#else
-void _cdecl main( int argc, char * argv[] )
-#endif
-{
-
- OUString aDirectory(OUString::createFromAscii("file:///C:/%E6%96%B0%E3%81%97%E3%81%84%E3%83%95%E3%82%A9%E3%83%AB%E3%83%80"));
-// OUString aDirex(OUString::createFromAscii("file:///C:/%C2%90V%E2%80%9A%C2%B5%E2%80%9A%C2%A2%C6%92t%C6%92H%C6%92%E2%80%B9%C6%92_"));
-
- osl::FileBase::RC eError = osl::Directory::create(aDirectory);
- if (eError != osl::FileBase::E_None)
- {
- OUString aUStr = FileHelper::createOSLErrorString(eError);
- OString aStr;
- aStr <<= aUStr;
- OSL_ENSURE(false, aStr.getStr());
- }
-
-// OUString suSystemPath, aTmp;
-// FileBase::RC aRC = FileBase::getSystemPathFromFileURL( aDirectory, suSystemPath );
-//
-// String suSystemPathAsString(suSystemPath);
-// ByteString sSystemPath(suSystemPathAsString, osl_getThreadTextEncoding());
-//
-//
-// ByteString sSystemPathNew = sSystemPath;
-// UniString suSystemPathNew(sSystemPathNew, osl_getThreadTextEncoding());
-// FileBase::RC aRC2 = FileBase::getFileURLFromSystemPath( suSystemPathNew, aTmp );
-
-//
-// aRC = FileBase::getSystemPathFromFileURL( aDirex, aTmp );
-// aRC2 = FileBase::getFileURLFromSystemPath( aTmp, aTmp2 );
-}
-
diff --git a/testshl2/workben/garbage_dump/some_tips.cxx b/testshl2/workben/garbage_dump/some_tips.cxx
deleted file mode 100644
index be29a2cdaee1..000000000000
--- a/testshl2/workben/garbage_dump/some_tips.cxx
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <cppunit/simpleheader.hxx>
-
-namespace rtl_ByteSequence
-{
-// -----------------------------------------------------------------------
-// call this before any other classes
-// -----------------------------------------------------------------------
-class OSingleton
-{
-public:
- static OSingleton * GetSingleton();
- virtual ~OSingleton() {}
-protected :
- OSingleton()
- {
- printf("Do something before.\n");
- }
-
- static OSingleton * m_pSingleton;
-};
-
-OSingleton * OSingleton::m_pSingleton = NULL;
-OSingleton * OSingleton::GetSingleton()
-{
- if(m_pSingleton == NULL )
- {
- m_pSingleton = new OSingleton;
- }
- return m_pSingleton;
-}
-
-// -----------------------------------------------------------------------------
-
-class before : public CppUnit::TestFixture
-{
-protected:
- before()
- {
- OSingleton::GetSingleton();
- }
-};
-
-// -----------------------------------------------------------------------------
-
-class GlobalObject
-{
-public:
- GlobalObject()
- {
- // do nothing here
- }
- ~GlobalObject()
- {
- printf("shutdown");
- }
-};
-
-GlobalObject theGlobalObject;
-
-// -----------------------------------------------------------------------------
-class assign : public before
-{
-public:
- // initialise your test code values here.
- void setUp()
- {
- }
-
- void tearDown()
- {
- }
-
- // insert your test code here.
- void assign_001()
- {
- }
-
- CPPUNIT_TEST_SUITE(assign);
- CPPUNIT_TEST(assign_001);
- CPPUNIT_TEST_SUITE_END();
-}; // class operator=
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::assign, "rtl_ByteSequence");
-} // namespace ByteSequence
-
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
-{
- printf("init your work here\n");
-}
-// NOADDITIONAL;
diff --git a/testshl2/workben/getopt/makefile.mk b/testshl2/workben/getopt/makefile.mk
deleted file mode 100644
index 21b563da16a9..000000000000
--- a/testshl2/workben/getopt/makefile.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-PRJINC=
-
-PRJNAME=testshl2
-TARGET=test_getopt
-TARGETTYPE=CUI
-
-ENABLE_EXCEPTIONS=TRUE
-#USE_LDUMP2=TRUE
-#LDUMP2=LDUMP3
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-#--------------------------------- Objectfiles ---------------------------------
-OBJFILES=\
- $(OBJ)$/getopt.obj \
- $(OBJ)$/filehelper.obj \
- $(OBJ)$/test_getopt.obj
-
-#----------------------------- prog with *.lib file -----------------------------
-
-APP1TARGET= $(TARGET)
-APP1OBJS=$(OBJFILES)
-
-APP1STDLIBS=$(SALLIB)
-
-APP1DEPN= $(APP1OBJS)
-APP1LIBS=
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/getopt/test_getopt.cxx b/testshl2/workben/getopt/test_getopt.cxx
deleted file mode 100644
index af2ae1095d8a..000000000000
--- a/testshl2/workben/getopt/test_getopt.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef SOLARIS
-#include <sys/time.h>
-#endif
-
-#ifdef WNT
-// #define UNDER_WINDOWS_DEBUGGING
-// Nice feature, to debug under windows, install msdev locally and use DebugBreak() to stop a new process at a point you want.
-#ifdef UNDER_WINDOWS_DEBUGGING
-#include <tools/presys.h>
-#include <windows.h>
-#include <tools/postsys.h>
-
-#define VCL_NEED_BASETSD
-
-#endif /* UNDER_WINDOWS_DEBUGGING */
-#endif /* WNT */
-
-#include <iostream>
-#include <vector>
-#include <rtl/string.hxx>
-
-#include "filehelper.hxx"
-#include "getopt.hxx"
-
-// #include <osl/time.h>
-
-using namespace std;
-
-// -----------------------------------------------------------------------------
-
-/**
- * display usage screen
- */
-
-void usage()
-{
- fprintf( stdout,
- "USAGE: testshl shlname [-boom][-verbose][-log][-his][-msg]\n" );
- exit(0);
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char* argv[] )
-#else
-int _cdecl main( int argc, char* argv[] )
-#endif
-{
- (void) argc;
- static char const* optionSet[] = {
- "-boom, stop near error position, exception only",
- "-mode=s, the output mode, emacs, xml, old. Default is -mode old",
- "-logPath=s, destination path for logging",
- "-tc=s@, name(s) of testcase(s) to generate",
- "-h:s, display help or help on option",
- "-help:s, see -h",
- NULL
- };
-
- GetOpt opt( argv, optionSet );
-
- // someone indicates that he needs help
- if ( opt.hasOpt( "-h" ) || opt.hasOpt( "-help" ) )
- {
- opt.showUsage();
- // exit(0);
- }
-
- // get path for logging stuff..
- rtl::OString logPth;
- // ...if available
- if ( opt.hasOpt( "-logPth" ))
- {
- logPth = opt.getOpt( "-logPth" );
- }
-
- rtl::OString param;
- if ( ! opt.getParams().empty() ) {
- param = opt.getFirstParam();
-
- std::cout << "all non '-' Parameter values" << std::endl;
-
- vector<rtl::OString>& aVec = opt.getParams();
- for(vector<rtl::OString>::const_iterator it = aVec.begin();
- it != aVec.end();
- ++it)
- {
- std::cout << (*it).getStr() << std::endl;
- }
- }
-
- if ( opt.hasOpt("-tc"))
- {
- std::cout << "Parameter -tc" << std::endl;
- vector<rtl::OString>& aVec = opt.getOptVec( "-tc" );
-
- for(vector<rtl::OString>::const_iterator it = aVec.begin();
- it != aVec.end();
- ++it)
- {
- std::cout << (*it).getStr() << std::endl;
- }
- }
-
- return 0;
-}
-
diff --git a/testshl2/workben/makefile.mk b/testshl2/workben/makefile.mk
deleted file mode 100644
index 682793c7724b..000000000000
--- a/testshl2/workben/makefile.mk
+++ /dev/null
@@ -1,126 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-PRJINC=
-
-PRJNAME=testshl2
-TARGET=test_autoptr
-TARGETTYPE=CUI
-
-ENABLE_EXCEPTIONS=TRUE
-#USE_LDUMP2=TRUE
-#LDUMP2=LDUMP3
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# ------------------------------------------------------------------
-#--------------------------------- Objectfiles ---------------------------------
-OBJFILES=\
- $(OBJ)$/test_autoptr.obj \
- $(OBJ)$/test_ostringstream.obj
-
-#----------------------------- prog with *.lib file -----------------------------
-
-APP1TARGET= $(TARGET)
-APP1OBJS=$(OBJ)$/test_autoptr.obj
-
-APP1STDLIBS=$(SALLIB)
-
-APP1DEPN= $(APP1OBJS)
-APP1LIBS=
-
-#-------------------------------------------------------------------------------
-
-APP2TARGET= test_ostringstream
-APP2OBJS=$(OBJ)$/test_ostringstream.obj
-
-APP2STDLIBS=$(SALLIB)
-
-APP2DEPN= $(APP1OBJS)
-APP2LIBS=
-#-------------------------------------------------------------------------------
-
-APP3TARGET= test_filter
-APP3OBJS=$(OBJ)$/test_filter.obj
-
-APP3STDLIBS=$(SALLIB)
-
-APP3DEPN= $(APP1OBJS)
-APP3LIBS=
-#-------------------------------------------------------------------------------
-
-# APP4TARGET= test_member
-# APP4OBJS=$(OBJ)$/test_member.obj
-#
-# APP4STDLIBS=$(SALLIB)
-#
-# APP4DEPN=
- # APP4LIBS=
-
-
-#-------------------------------------------------------------------------------
-
-# APP5TARGET= test_very_long_names
-# APP5OBJS=$(OBJ)$/test_very_long_names.obj
-#
-# APP5STDLIBS=$(SALLIB)
-#
-# APP5DEPN=
-# APP5LIBS=
-
-
-#-------------------------------------------------------------------------------
-
-APP6TARGET= test_string
-APP6OBJS=$(OBJ)$/test_string.obj
-
-APP6STDLIBS=$(SALLIB)
-
-APP6DEPN=
-APP6LIBS=
-#-------------------------------------------------------------------------------
-
-APP7TARGET= test_printf
-APP7OBJS=$(OBJ)$/test_printf.obj
-
-APP7STDLIBS=$(SALLIB)
-
-APP7DEPN=
-APP7LIBS=
-#-------------------------------------------------------------------------------
-
-APP8TARGET= test_preproc
-APP8OBJS=$(OBJ)$/test_preproc.obj
-
-APP8STDLIBS=$(SALLIB)
-
-APP8DEPN=
-APP8LIBS=
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/testshl2/workben/runner/unxlngi4.config.file b/testshl2/workben/runner/unxlngi4.config.file
deleted file mode 100644
index 783b56950e20..000000000000
--- a/testshl2/workben/runner/unxlngi4.config.file
+++ /dev/null
@@ -1,34 +0,0 @@
-# Testshl2Runner
-
-# what is need to start?
-
-PRE1 = setenv SHELL /bin/tcsh
-PRE2 = source ~/staroffice.cshrc
-
-SHELL = /bin/tcsh
-BUILD = udk305
-ENV = unxlngi4
-LOCALENV = /usr/qaapi/projects/solartmp
-BASEDIR = /usr/qaapi/projects
-PROJECTNAME= sal
-INPUT = qa
-OUTPUT = qa
-
-# JOBFILE = $(PROJECTDIR)/$(PROJECTNAME)/$(INPUT)/jobs.txt
-JOBFILE = jobs.txt
-
-TESTTOOL = testshl2
-BATCHFILE = runTestshl.sh
-
-# Hardcoded
-# if ENV == "wnt..."
-# bin
-# if ENV == "unx..."
-# lib
-# PRJLIB = bin
-
-# nothing to do for post
-# POST1 =
-
-
-
diff --git a/testshl2/workben/runner/unxsols3.config.file b/testshl2/workben/runner/unxsols3.config.file
deleted file mode 100644
index 5af1aa49f0c1..000000000000
--- a/testshl2/workben/runner/unxsols3.config.file
+++ /dev/null
@@ -1,34 +0,0 @@
-# Testshl2Runner
-
-# what is need to start?
-
-PRE1 = setenv SHELL /bin/tcsh
-PRE2 =
-
-SHELL = /bin/tcsh
-BUILD = udk305
-ENV = unxsols3
-LOCALENV = /usr/qaapi/projects/solartemp
-BASEDIR = /usr/qaapi/projects/udk
-PROJECTNAME= sal
-INPUT = qa
-OUTPUT = qa
-
-# JOBFILE = $(PROJECTDIR)/$(PROJECTNAME)/$(INPUT)/jobs.txt
-JOBFILE = jobs.txt
-
-TESTTOOL = testshl2
-BATCHFILE = runTestshl.sh
-
-# Hardcoded
-# if ENV == "wnt..."
-# bin
-# if ENV == "unx..."
-# lib
-# PRJLIB = bin
-
-# nothing to do for post
-# POST1 =
-
-
-
diff --git a/testshl2/workben/runner/wntmsci9.config.file b/testshl2/workben/runner/wntmsci9.config.file
deleted file mode 100644
index 12aefabcd29c..000000000000
--- a/testshl2/workben/runner/wntmsci9.config.file
+++ /dev/null
@@ -1,46 +0,0 @@
-# Testshl2Runner
-
-# what is need to start?
-
-# path to find setsolar
-PRE1 = set path=r:\\etw;%PATH%
-
-SHELL = c:\\programme\\4nt\\4nt.exe
-BUILD = udk305
-ENV = wntmsci9
-
-# where to find the output directory
-LOCALENV = d:\\local\\305
-
-# the basedirectory to the sources, before a project
-BASEDIR = d:\\local\\305\\UDK305
-
-# name of the project
-PROJECTNAME= sal
-
-# PROJECTDIR is build within the following: $(BASEDIR)/$(PROJECTNAME)
-
-# INPUT is found in $(PROJECTDIR)
-INPUT = qa_work
-
-# OUTPUT is found in $(PROJECTDIR)/$(ENV)
-OUTPUT = qa_work
-
-# JOBFILE is found in $(PROJECTDIR)/$(INPUT)
-JOBFILE = jobs.txt
-
-TESTTOOL = testshl2
-BATCHFILE = runTestshl.btm
-
-# Hardcoded
-# if ENV == "wnt..."
-# bin
-# if ENV == "unx..."
-# lib
-# PRJLIB = bin
-
-# nothing to do for post
-# POST1 =
-
-
-
diff --git a/testshl2/workben/selftest/README.txt b/testshl2/workben/selftest/README.txt
deleted file mode 100644
index dbf9cce433d7..000000000000
--- a/testshl2/workben/selftest/README.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-There seems to be some problems with load test libraries from the right path,
-if the libraries are stored also in the solver directory.
-
-To test this:
-Call dmake to build the libraries in this selftest directory.
-Call deliver to copy one test library into the solver tree.
-Call dmake test to simply test the behaviour.
-
-Some more words:
-
-Per default the test libraries should not deliver but if:
-
-- Linux and Windows will use an absolute path to load the test libraries
- by dlopen().
-- MacOSX will use local path per default to load the test libraries by
- dlopen();
-
-If there are problems, there exists 2 new parameters like
--absolutepath
--localpath
-
-Just call
-'dmake test TESTOPTADD="-absolutepath"' or
-'dmake test TESTOPTADD="-localpath"' from this directory and see which
-behaviour is the right for your environment.
-
-There exist some environment variables to manipulate the default behaviour
-of load libraries. These are
-LD_LIBRARY_PATH
-DYLD_LIBRARY_PATH (Mac OS X)
diff --git a/testshl2/workben/selftest/delivertest.cxx b/testshl2/workben/selftest/delivertest.cxx
deleted file mode 100644
index b24cda0bccd9..000000000000
--- a/testshl2/workben/selftest/delivertest.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <cppunit/simpleheader.hxx>
-
-namespace delivertest
-{
-//------------------------------------------------------------------------
-// testing constructors
-//------------------------------------------------------------------------
-
- class ctor : public CppUnit::TestFixture
- {
- public:
- void ctor_001()
- {
- CPPUNIT_ASSERT_MESSAGE("Simple testshl2 self test, You have loaded the delivered library, PER DEFAULT THIS IS ABSOLUTLY WRONG. If you have start this test by 'dmake test' please change the behaviour in 'source/dynamicregister.cxx' in the DynamicLibraryHelper::CTor.", sal_False);
- }
-
- CPPUNIT_TEST_SUITE(ctor);
- CPPUNIT_TEST(ctor_001);
- CPPUNIT_TEST_SUITE_END();
- };
-
- // -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(delivertest::ctor, "delivertest");
-} // delivertest
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-
-NOADDITIONAL;
diff --git a/testshl2/workben/selftest/export.map b/testshl2/workben/selftest/export.map
deleted file mode 100644
index 2718fd9a5cc4..000000000000
--- a/testshl2/workben/selftest/export.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3.0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
-
diff --git a/testshl2/workben/selftest/makefile.mk b/testshl2/workben/selftest/makefile.mk
deleted file mode 100644
index 974b3beda526..000000000000
--- a/testshl2/workben/selftest/makefile.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=sal
-TARGET=selftest_testshl2
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES= \
-# $(SLO)$/unotest.obj
-
-#----------------------------------- deliver test -----------------------------------
-
-SHL1OBJS= \
- $(SLO)$/notdeliveredtest.obj
-
-SHL1TARGET= testshl2_deliver_test
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUNITLIB)
-
-SHL1IMPLIB= i$(SHL1TARGET)
-
-DEF1NAME =$(SHL1TARGET)
-SHL1VERSIONMAP = export.map
-
-#----------------------------------- deliver test -----------------------------------
-
-SHL2OBJS= \
- $(SLO)$/delivertest.obj
-
-SHL2TARGET= delivertest
-SHL2STDLIBS=\
- $(SALLIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUNITLIB)
-
-SHL2IMPLIB= i$(SHL2TARGET)
-
-DEF2NAME =$(SHL2TARGET)
-SHL2VERSIONMAP = export.map
-
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
-
diff --git a/testshl2/workben/selftest/notdeliveredtest.cxx b/testshl2/workben/selftest/notdeliveredtest.cxx
deleted file mode 100644
index 93a5532a42ac..000000000000
--- a/testshl2/workben/selftest/notdeliveredtest.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <cppunit/simpleheader.hxx>
-
-namespace delivertest
-{
-//------------------------------------------------------------------------
-// testing constructors
-//------------------------------------------------------------------------
-
- class ctor : public CppUnit::TestFixture
- {
- public:
- void ctor_001()
- {
- CPPUNIT_ASSERT_MESSAGE("Simple testshl2 self test, if you see this error message, the load library test is ok.", sal_False);
- }
-
- CPPUNIT_TEST_SUITE(ctor);
- CPPUNIT_TEST(ctor_001);
- CPPUNIT_TEST_SUITE_END();
- };
-
- // -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(delivertest::ctor, "delivertest");
-} // delivertest
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-
-NOADDITIONAL;
diff --git a/testshl2/workben/singleton.cxx b/testshl2/workben/singleton.cxx
deleted file mode 100644
index 055e3525410a..000000000000
--- a/testshl2/workben/singleton.cxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-class OSingleton
-{
-public:
- static OSingleton * GetSingleton();
- virtual ~OSingleton(){}
-protected :
- OSingleton(){}
- static OSingleton * m_pSingleton;
-};
-
-OSingleton * OSingleton::m_pSingleton = NULL;
-OSingleton * OSingleton::GetSingleton()
-{
- if(m_pSingleton == NULL )
- {
- m_pSingleton = new OSingleton;
- }
- return m_pSingleton;
-}
diff --git a/testshl2/workben/skeleton/export.map b/testshl2/workben/skeleton/export.map
deleted file mode 100644
index 4ca70fa85463..000000000000
--- a/testshl2/workben/skeleton/export.map
+++ /dev/null
@@ -1,7 +0,0 @@
-UDK_3.0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
diff --git a/testshl2/workben/skeleton/makefile.mk b/testshl2/workben/skeleton/makefile.mk
deleted file mode 100644
index a9025d2717f5..000000000000
--- a/testshl2/workben/skeleton/makefile.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ := ..$/..
-PRJNAME := testshl2
-
-TARGET := testshl2_workben_skeleton
-
-ENABLE_EXCEPTIONS := TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-SHL1TARGET := $(TARGET)
-SHL1OBJS := \
- $(SLO)$/skeleton.obj
-
-SHL1IMPLIB := i$(SHL1TARGET)
-SHL1STDLIBS := $(CPPUNITLIB) $(SALLIB)
-SHL1VERSIONMAP := export.map
-DEF1NAME := $(SHL1TARGET)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE: target.mk
-.INCLUDE : _cppunit.mk
diff --git a/testshl2/workben/skeleton/skeleton.cxx b/testshl2/workben/skeleton/skeleton.cxx
deleted file mode 100644
index 0e7d006ee714..000000000000
--- a/testshl2/workben/skeleton/skeleton.cxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-/*
- * LLA: 20040527
- */
-#include <cppunit/simpleheader.hxx>
-
-namespace skeleton
-{
-//------------------------------------------------------------------------
-// testing constructors
-//------------------------------------------------------------------------
-
- class ctor : public CppUnit::TestFixture
- {
- public:
- ctor()
- {
- printf("ctor: called\n");
- }
-
- void ctor_test()
- {
- printf("ctor test: called\n");
- }
- void ctor_test2()
- {
- printf("ctor test2: called\n");
- }
- void ctor_test3()
- {
- printf("ctor test3: called\n");
- }
-
- CPPUNIT_TEST_SUITE(ctor);
- CPPUNIT_TEST(ctor_test);
- CPPUNIT_TEST(ctor_test2);
- CPPUNIT_TEST(ctor_test3);
- CPPUNIT_TEST_SUITE_END();
- };
-
- // -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(skeleton::ctor, "skeleton");
-} // unotest
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-
-NOADDITIONAL;
diff --git a/testshl2/workben/test_autoptr.cxx b/testshl2/workben/test_autoptr.cxx
deleted file mode 100644
index 076924a61fca..000000000000
--- a/testshl2/workben/test_autoptr.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-#include <memory>
-#include <iostream>
-
-#include <stdio.h>
-
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-
-class AutoPtrTest
-{
- int m_nValue;
-
- // NOCOPY
- AutoPtrTest(AutoPtrTest const& );
- AutoPtrTest& operator =(AutoPtrTest const& );
-
-public:
- AutoPtrTest(int _nValue = 1)
- :m_nValue(_nValue)
- {
- std::cout << "build Value" << std::endl;
- }
- ~AutoPtrTest()
- {
- std::cout << "release Value" << std::endl;
- m_nValue = 0;
- }
-// int operator int() const {return m_nValue;}
- int getValue() const {return m_nValue;}
-};
-
-std::auto_ptr<AutoPtrTest> getPtr()
-{
- return std::auto_ptr<AutoPtrTest>(new AutoPtrTest(2));
-}
-
-// auto_ptr get() gibt den Pointer ohne das ownership
-// auto_ptr release()gibt den Pointer und (!) das ownership
-
-void test_autoptr()
-{
- AutoPtrTest *pValuePtr;
- std::cout << "start test" << std::endl;
- {
- std::auto_ptr<AutoPtrTest> pValue = getPtr();
- std::cout << "Value with getValue() " << pValue->getValue() << std::endl;
- // std::cout << "Value operator int() " << *pValue << std::endl;
- // ownership weiterreichen
- pValuePtr = pValue.release();
- }
- std::cout << "ValuePtr with getValue() " << pValuePtr->getValue() << std::endl;
-
- // ownership an neuen Pointer uebergeben
- std::auto_ptr<AutoPtrTest> pValue2(pValuePtr);
-
- // AutoPtrTest *pStr = getPtr();
- std::cout << "end test" << std::endl;
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */ , char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc*/ , char* /*argv*/ [] )
-#endif
-{
- test_autoptr();
- return 0;
-}
diff --git a/testshl2/workben/test_filter.cxx b/testshl2/workben/test_filter.cxx
deleted file mode 100644
index a22e60182ef2..000000000000
--- a/testshl2/workben/test_filter.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <vector>
-#include <string>
-#include <iostream>
-#include <rtl/string.hxx>
-
-typedef std::vector<std::string> StringList;
-typedef std::vector<rtl::OString> OStringList;
-
-void split( const rtl::OString& opt,
- const rtl::OString& _sSeparator,
- OStringList& optLine )
-{
- optLine.clear();
- // const sal_Int32 cSetLen = cSet.getLength();
- sal_Int32 index = 0;
- sal_Int32 oldIndex = 0;
-
- // sal_Int32 i;
- // sal_Int32 j = 0;
- while ( opt.getLength() > 0)
- {
- // for ( i = 0; i < cSetLen; i++ )
- // {
- index = opt.indexOf( _sSeparator, oldIndex);
- if( index != -1 )
- {
- optLine.push_back( opt.copy( oldIndex, index - oldIndex ) );
- oldIndex = index + _sSeparator.getLength();
- }
- // }
- else // if (index == -1)
- {
- optLine.push_back( opt.copy( oldIndex ) );
- break;
- }
- }
-} ///< split
-
-// -----------------------------------------------------------------------------
-
-StringList splitNameAtDot(rtl::OString const& _sName)
-{
- StringList aList;
- int nIndex = 0;
- // int nLastIndex = 0;
- while ((nIndex = _sName.indexOf(".")) != -1)
- {
- rtl::OString nValue;
- }
-
- return aList;
-}
-
-// -----------------------------------------------------------------------------
-/*
-bool checkFilter(JobList m_aJobFilter, std::string const& _sNodeName, std::string const& _sName)
-{
- std::string sFilter = m_aJobFilter.m_aJobList.begin();
-
- StringList aFilter;
- aFilter.push_back("rtl_OUString");
- aFilter.push_back("ctors");
- aFilter.push_back("*");
-
- StringList aMyName;
- aMyName.push_back("rtl_OUString");
- aMyName.push_back("ctors");
- aMyName.push_back("ctor_001");
-
-}
-*/
-
-void showList(OStringList const& _sList)
-{
- for(OStringList::const_iterator it = _sList.begin();
- it != _sList.end();
- ++it)
- {
- rtl::OString aStr = *it;
- std::cout << aStr.getStr() << std::endl;
- }
-}
-
-bool match(OStringList const& _aFilter, OStringList const& _aName)
-{
- OStringList::const_iterator aFilterIter = _aFilter.begin();
- OStringList::const_iterator aValueIter = _aName.begin();
-
- bool bMatch = false;
-
- while (aFilterIter != _aFilter.end() && aValueIter != _aName.end())
- {
- rtl::OString sFilter = *aFilterIter;
- rtl::OString sName = *aValueIter;
-
- if (sFilter == sName)
- {
- bMatch = true;
- ++aFilterIter;
- ++aValueIter;
- }
- else if (sFilter == "*")
- {
- bMatch = true;
- break;
- }
- else
- {
- // Filter does not match
- bMatch = false;
- break;
- }
- }
- return bMatch;
-}
-
-// -----------------------------------------------------------------------------
-void test_normal_filter()
-{
- OStringList aFilter;
- split("rtl_OUString.ctors.*", ".", aFilter);
- showList(aFilter);
-
- OStringList aName;
- split("rtl_OUString.ctors.ctor_001", ".", aName);
- showList(aName);
-
- if (match(aFilter, aName))
- {
- std::cout << "Name matches filter." << std::endl;
- }
-}
-
-void test_normal_filter_other_sep()
-{
- OStringList aFilter;
- split("rtl_OUString::ctors::*", "::", aFilter);
- showList(aFilter);
-
- OStringList aName;
- split("rtl_OUString::ctors::ctor_001", "::", aName);
- showList(aName);
-
- if (match(aFilter, aName))
- {
- std::cout << "Name matches filter." << std::endl;
- }
-}
-
-void test_no_name()
-{
- OStringList aFilter;
- split("rtl_OUString.*", ".", aFilter);
- showList(aFilter);
-
- OStringList aName;
- split("", ".", aName);
- showList(aName);
-
- if (match(aFilter, aName))
- {
- std::cout << "Name matches filter." << std::endl;
- }
-}
-
-void test_name_longer_filter()
-{
- OStringList aFilter;
- split("rtl_OUString.*", ".", aFilter);
- showList(aFilter);
-
- OStringList aName;
- split("rtl_OUString.ctor.ctor_001", ".", aName);
- showList(aName);
-
- if (match(aFilter, aName))
- {
- std::cout << "Name matches filter." << std::endl;
- }
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */ , char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc */, char* /* argv */ [] )
-#endif
-{
- test_normal_filter();
- test_normal_filter_other_sep();
- test_no_name();
- test_name_longer_filter();
-
- // split("rtl_OUString.*", ".", aFilter);
- // showList(aFilter);
-
-
- // test_autoptr();
- return 0;
-}
diff --git a/testshl2/workben/test_member.cxx b/testshl2/workben/test_member.cxx
deleted file mode 100644
index 11cf2bbc742a..000000000000
--- a/testshl2/workben/test_member.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <iostream>
-#include <string>
-
-using namespace std;
-
-class Aint
-{
- int n;
-
-public:
-
- Aint():n(0)
- {
- cout << "ctor Aint()" << endl;
- }
- Aint(int _n):n(_n)
- {
- cout << "ctor Aint(int(" << _n << "))" << endl;
- }
- int getA() {return n;}
- ~Aint()
- {
- cout << "dtor Aint()" << endl;
- }
-
-};
-
-// -----------------------------------------------------------------------------
-
-class B
-{
- Aint a;
- Aint b;
- std::string aStr;
-
-public:
-
- B()
- :a(2)
- {
- cout << "ctor B()" << endl;
- }
- B(int _a)
- :a(_a)
- {
- cout << "ctor B(int)" << endl;
- }
-
- void foo()
- {
- cout << "a.getA() := " << a.getA() << endl;
- cout << "b.getA() := " << b.getA() << endl;
- }
-
-};
-
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char* argv[] )
-#else
-int _cdecl main( int argc, char* argv[] )
-#endif
-{
- B b(4);
- b.foo();
-}
diff --git a/testshl2/workben/test_ostringstream.cxx b/testshl2/workben/test_ostringstream.cxx
deleted file mode 100644
index f49b54cd6a9f..000000000000
--- a/testshl2/workben/test_ostringstream.cxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <stdlib.h>
-#include <memory>
-#include <sstream>
-#include <iostream>
-#include <bitset>
-
-#include <sal/types.h>
-
-
-class TestFactoryRegistry
-{
-public:
- void checkFunc(char* foo);
- void checkFunc2(char* foo);
- void checkFunc3(char* foo);
-};
-
-
-void TestFactoryRegistry::checkFunc(char* /* foo */ )
-{
- static int serialNumber = 1;
-
- std::ostringstream ost;
-//! could this be the problem?
- ost << "@Dummy@" << serialNumber++;
- std::cout << ost.str() << std::endl;
-}
-
-void TestFactoryRegistry::checkFunc2(char* /* foo */)
-{
- static int serialNumber = 1;
-
- std::ostringstream ost;
-//! could this be the problem?
- ost << "@Dummy@" << serialNumber;
- serialNumber++;
- std::cout << ost.str() << std::endl;
-}
-
-void TestFactoryRegistry::checkFunc3(char* /* foo */)
-{
- static int serialNumber = 1;
-
- int nValue = serialNumber;
- std::ostringstream ost;
-//! could this be the problem?
- ost << "@Dummy@" << nValue;
- serialNumber++;
- std::cout << ost.str() << std::endl;
-}
-
-static TestFactoryRegistry a;
-static TestFactoryRegistry b;
-static TestFactoryRegistry c;
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */ , char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc */, char* /* argv */ [] )
-#endif
-{
- std::ostringstream ost;
- // sal_Int32 nValue = 1;
-
- // ost << "@Dummy@" << nValue;
- // ost << "dec: " << 15 << std::hex << " hex: " << 15 << std::endl;
-
- // std::cout << ost.str() << std::endl;
-
- char* cFoo = NULL;
-
- a.checkFunc(cFoo);
- a.checkFunc2(cFoo);
- a.checkFunc3(cFoo);
-
- b.checkFunc(cFoo);
- b.checkFunc2(cFoo);
- b.checkFunc3(cFoo);
-
- c.checkFunc(cFoo);
- c.checkFunc2(cFoo);
- c.checkFunc3(cFoo);
-
- return 0;
-}
diff --git a/testshl2/workben/test_preproc.cxx b/testshl2/workben/test_preproc.cxx
deleted file mode 100644
index 4614a9783ab5..000000000000
--- a/testshl2/workben/test_preproc.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <iostream>
-#include <string>
-#include <rtl/string.hxx>
-
-using namespace std;
-
-#define atest(name) \
- { \
- /*if (strlen(#name))*/ { \
- cout << "String len: " << strlen(#name) << " string: " << #name << endl; \
- }}
-
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */, char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc */, char* /* argv */ [] )
-#endif
-{
- cout << "test preprocessor: " << endl;
- atest(fuck);
- // atest(); compiler error, use "" instead
- atest("");
-}
diff --git a/testshl2/workben/test_printf.cxx b/testshl2/workben/test_printf.cxx
deleted file mode 100644
index a6fd7d86f618..000000000000
--- a/testshl2/workben/test_printf.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-
-#include <string>
-#include <stdarg.h>
-#include <stdio.h>
-
-void t_print(const char* _pFormatStr, va_list &args)
-{
- vprintf(_pFormatStr, args);
-}
-
-void t_print(const char* _pFormatStr, ...)
-{
- va_list args;
- va_start( args, _pFormatStr );
- t_print(_pFormatStr, args);
- va_end( args );
-}
-
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */ , char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc */ , char* /* argv */ [] )
-#endif
-{
- std::string sStr("TestString.");
- printf("Test %s\n", sStr.c_str() );
- t_print("Test %s\n", sStr.c_str() );
- return 0;
-}
diff --git a/testshl2/workben/test_string.cxx b/testshl2/workben/test_string.cxx
deleted file mode 100644
index 0d8d83d83192..000000000000
--- a/testshl2/workben/test_string.cxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include <iostream>
-#include <string>
-#include <rtl/string.hxx>
-
-using namespace std;
-
-const char* g_cSeparatorList = " \t,;:#";
-
-std::string trim(std::string const& _sStringToTrim)
-{
- rtl::OString sStr(_sStringToTrim.c_str());
- sStr = sStr.trim();
- return std::string(sStr.getStr());
-}
-
-bool isInCurrentEnvironment(std::string const& _sString)
-{
- int nSpace = 0;
- std::string sSearchString = _sString;
- bool bEnd = false;
- // run through the hole given string,
- std::string sEnv;
-
- do {
- nSpace = sSearchString.find_first_of(g_cSeparatorList);
- if (nSpace < 0)
- {
- sEnv = sSearchString;
- bEnd = true;
- }
- else
- {
- sEnv = sSearchString.substr(0, nSpace);
- sSearchString = sSearchString.substr(nSpace + 1);
- }
- if (sEnv.length() > 0)
- {
- cout << sEnv << endl;
-#ifdef LINUX
- int nLinux = sEnv.find("unxlng");
- if (nLinux >= 0)
- {
- // found unxlng
- return true;
- }
-#endif
-#ifdef SOLARIS
- int nSolaris = sEnv.find("unxsol");
- if (nSolaris >= 0)
- {
- // found unxsol
- return true;
- }
-#endif
-#ifdef WNT
- int nWindows = sEnv.find("wnt");
- if (nWindows >= 0)
- {
- // found wnt
- return true;
- }
-#endif
- }
- } while ( !bEnd );
- return false;
-}
-
-// ----------------------------------- Main -----------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int /* argc */, char* /* argv */ [] )
-#else
- int _cdecl main( int /* argc */ , char* /* argv */ [] )
-#endif
-{
- string sLine1 = "osl_Socket.ctor.ctors_001";
- string sLine = "osl_Socket.ctor.ctors_001 unxlngi5.pro unxsols4.pro wntmsci ";
-
- int nSpace = sLine.find_first_of(g_cSeparatorList);
- cout << "Space: " << nSpace << endl;
- std::string sTest;
-
- if (nSpace > 0)
- {
- sLine = trim(sLine);
- // check environment
- sTest = sLine.substr(0, nSpace);
- std::string sRest = sLine.substr(nSpace + 1);
- if (isInCurrentEnvironment(sRest))
- {
- cout << "new string: " << sTest << endl;
- }
- }
- else
- {
- // every environment
- cout << "new string: " << sLine << endl;
- }
-
- // cout << "rest string: " << sRest << endl;
-
- int nCount = 10;
- do {
- cout << nCount << endl;
- nCount --;
- }
- while (nCount >= 0);
- cout << nCount << endl;
-}
diff --git a/testshl2/workben/uno/export.exp b/testshl2/workben/uno/export.exp
deleted file mode 100644
index a13529da5876..000000000000
--- a/testshl2/workben/uno/export.exp
+++ /dev/null
@@ -1 +0,0 @@
-registerAllTestFunction
diff --git a/testshl2/workben/uno/export.map b/testshl2/workben/uno/export.map
deleted file mode 100755
index 2718fd9a5cc4..000000000000
--- a/testshl2/workben/uno/export.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3.0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
-
diff --git a/testshl2/workben/uno/makefile.mk b/testshl2/workben/uno/makefile.mk
deleted file mode 100644
index ea4cc1c0b758..000000000000
--- a/testshl2/workben/uno/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org 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 version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..$/..
-
-PRJNAME=sal
-TARGET=qa_uno
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES= \
-# $(SLO)$/unotest.obj
-
-#----------------------------------- ByteSequence -----------------------------------
-
-SHL1OBJS= \
- $(SLO)$/unotest.obj
-
-SHL1TARGET= unotest
-SHL1STDLIBS=\
- $(SALLIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUNITLIB)
-
-# link $(CPPUNIT) to SHL1STDLIBS instead
-# .IF "$(GUI)" == "WNT"
-# SHL1STDLIBS+= $(SOLARLIBDIR)$/cppunit.lib
-# .ENDIF
-# .IF "$(GUI)" == "UNX"
-# SHL1STDLIBS+=$(SOLARLIBDIR)$/libcppunit$(DLLPOSTFIX).a
-# .ENDIF
-
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME =$(SHL1TARGET)
-# DEF1EXPORTFILE= export.exp
-SHL1VERSIONMAP = export.map
-
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
-
diff --git a/testshl2/workben/uno/unotest.cxx b/testshl2/workben/uno/unotest.cxx
deleted file mode 100644
index d4d3f78f56b6..000000000000
--- a/testshl2/workben/uno/unotest.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_testshl2.hxx"
-#include "rtl/bootstrap.hxx"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppunit/simpleheader.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <com/sun/star/xml/sax/XParser.hpp>
-
-namespace css = com::sun::star;
-namespace lang = css::lang;
-namespace uno = css::uno;
-namespace sax = css::xml::sax;
-
-
-// StringHelper
-inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString)
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US);
-}
-
-
-namespace unotest
-{
-//------------------------------------------------------------------------
-// testing constructors
-//------------------------------------------------------------------------
-
- class ctor : public CppUnit::TestFixture
- {
- public:
- void ctor_001()
- {
- uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if (xFactory.is())
- {
- // sample, get a xParser instance
- uno::Reference< sax::XParser > xParser;
- xParser = uno::Reference< sax::XParser > (
- xFactory->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser")), uno::UNO_QUERY);
-
- CPPUNIT_ASSERT_MESSAGE("can't get sax::Parser", xParser.is());
- }
- }
- void ctor_002()
- {
- CPPUNIT_ASSERT_MESSAGE("Simple testshl2 test, MUST fail.", sal_False);
- }
-
- CPPUNIT_TEST_SUITE(ctor);
- CPPUNIT_TEST(ctor_001);
- CPPUNIT_TEST(ctor_002);
- CPPUNIT_TEST_SUITE_END();
- };
-
- // -----------------------------------------------------------------------------
- CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(unotest::ctor, "unotest");
-} // unotest
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-
-
-void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
-{
- (void) _pFunc;
- uno::Reference<lang::XMultiServiceFactory> xMS;
-
- try
- {
- uno::Reference< uno::XComponentContext > xComponentContext = cppu::defaultBootstrap_InitialComponentContext();
- xMS.set(xComponentContext->getServiceManager(), uno::UNO_QUERY);
- comphelper::setProcessServiceFactory(xMS);
- }
- catch (::com::sun::star::uno::Exception e )
- {
- rtl::OString aError;
- aError <<= e.Message;
- printf("Error: %s\n", aError.getStr());
- }
-}
-// NOADDITIONAL;