Commits

Anonymous committed 55b03b1

sb129: #i113189# adapted tests; improved subsequenttests

Comments (0)

Files changed (11)

cppuhelper/qa/propertysetmixin/JavaSupplier.java

             : null;
     }
 
-    public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) {
-        return FactoryHelper.writeRegistryServiceInfo(
-            implementationName, serviceName, regKey);
-    }
-
     private static final String implementationName
     = JavaSupplier.class.getName();
     private static final String serviceName

cppuhelper/qa/propertysetmixin/comp_propertysetmixin.cxx

 {
     *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(
-    void * serviceManager, void * registryKey)
-{
-    return cppu::component_writeInfoHelper(
-        serviceManager, registryKey, entries);
-}

cppuhelper/qa/propertysetmixin/makefile.mk

 
 ENABLE_EXCEPTIONS := TRUE
 
+my_components = $(TARGET).cpp $(TARGET).java
+
 .INCLUDE: settings.mk
 
 .IF "$(OS)" == "WNT"
 ALLTAR: test
 
 $(MISC)/$(TARGET)/types.urd: types.idl
-    - $(MKDIR) $(@:d)
+    $(MKDIRHIER) $(@:d)
     $(IDLC) -O$(@:d) -I$(SOLARIDLDIR) -cid -we $<
 
 $(MISC)/$(TARGET)/types.rdb: $(MISC)/$(TARGET)/types.urd
     - $(RM) $@
     $(REGMERGE) $@ /UCR $<
 
-$(MISC)/$(TARGET)/uno.rdb: $(MISC)/$(TARGET)/types.rdb $(SHL2TARGETN) \
-        $(MISC)/$(TARGET)/$(TARGET).uno.jar $(MISC)/$(TARGET)/bootstrap.rdb
-    - $(MKDIR) $(@:d)
-    $(COPY) $(SOLARBINDIR)/types.rdb $@
-    $(REGMERGE) $@ / $(MISC)/$(TARGET)/types.rdb
-    $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \
-        -c reflection.uno -c stocservices.uno -c $(SHL2TARGETN)
-    $(REGCOMP) -register -br $(MISC)/$(TARGET)/bootstrap.rdb -r $@ \
-        -c $(my_file)$(PWD)/$(MISC)/$(TARGET)/$(TARGET).uno.jar \
-        -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR)
-
-$(MISC)/$(TARGET)/bootstrap.rdb:
-    - $(MKDIR) $(@:d)
-    $(COPY) $(SOLARBINDIR)/types.rdb $@
-    $(REGCOMP) -register -r $@ -wop -c javaloader.uno -c javavm.uno \
-        -c stocservices.uno
-
 $(MISC)/$(TARGET)/cppumaker.flag: $(MISC)/$(TARGET)/types.rdb
     $(CPPUMAKER) -O$(MISC)/$(TARGET)/inc -BUCR -Gc \
-        -X$(SOLARBINDIR)/types.rdb $<
+        -X$(SOLARBINDIR)/udkapi.rdb $<
     $(TOUCH) $@
 
 $(SLOFILES): $(MISC)/$(TARGET)/cppumaker.flag
 
 $(MISC)/$(TARGET)/javamaker.flag: $(MISC)/$(TARGET)/types.rdb
-    $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)/types.rdb $<
+    $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD -Gc -X$(SOLARBINDIR)/udkapi.rdb $<
     $(TOUCH) $@
 
 $(JAVATARGET): $(MISC)/$(TARGET)/javamaker.flag
 
+$(MISC)/$(TARGET)/services.rdb .ERRREMOVE: $(SOLARENV)/bin/packcomponents.xslt \
+        $(MISC)/$(TARGET)/services.input \
+        $(my_components:^"$(MISC)/$(TARGET)/":+".component")
+    $(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/$(TARGET)/ -o $@ \
+        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/$(TARGET)/services.input
+
+$(MISC)/$(TARGET)/services.input .ERRREMOVE:
+    $(MKDIRHIER) $(@:d)
+    - $(RM) $@
+    echo \
+        '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+        > $@
+
+$(MISC)/$(TARGET)/$(TARGET).cpp.component .ERRREMOVE: \
+        $(SOLARENV)/bin/createcomponent.xslt $(TARGET).cpp.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt $(TARGET).cpp.component
+
+$(MISC)/$(TARGET)/$(TARGET).java.component .ERRREMOVE: \
+        $(SOLARENV)/bin/createcomponent.xslt $(TARGET).java.component
+    $(XSLTPROC) --nonet --stringparam uri \
+        '$(COMPONENTPREFIX_INBUILD_JAVA)$(TARGET).uno.jar' -o $@ \
+        $(SOLARENV)/bin/createcomponent.xslt $(TARGET).java.component
+
 $(MISC)/$(TARGET)/$(TARGET).uno.jar: $(JAVATARGET) \
         $(MISC)/$(TARGET)/javamaker.flag manifest
     jar cfm $@ manifest -C $(CLASSDIR) test/cppuhelper/propertysetmixin
 
-test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/uno.rdb
+test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(MISC)/$(TARGET)/$(TARGET).uno.jar \
+        $(MISC)/$(TARGET)/types.rdb $(MISC)/$(TARGET)/services.rdb
     $(CPPUNITTESTER) $(SHL1TARGETN) \
+        '-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/types.rdb' \
+        '-env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb'\
+        -env:URE_INTERNAL_LIB_DIR=$(my_file)$(SOLARSHAREDBIN) \
         -env:URE_INTERNAL_JAVA_DIR=$(my_file)$(SOLARBINDIR) \
-        -env:URE_INTERNAL_LIB_DIR=$(my_file)$(SOLARSHAREDBIN) \
-        -env:arg-reg=$(MISC)/$(TARGET)/uno.rdb -env:arg-path=$(SOLARSHAREDBIN)
+        -env:OOO_INBUILD_SHAREDLIB_DIR=$(my_file)$(PWD)/$(DLLDEST) \
+        -env:OOO_INBUILD_JAR_DIR=$(my_file)$(PWD)/$(MISC)/$(TARGET)
 
 .END

cppuhelper/qa/propertysetmixin/qa_propertysetmixin.cpp.component

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="test.cppuhelper.propertysetmixin.comp.CppSupplier">
+    <service name="test.cppuhelper.propertysetmixin.CppSupplier"/>
+  </implementation>
+</component>

cppuhelper/qa/propertysetmixin/qa_propertysetmixin.java.component

+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.Java2"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="test.cppuhelper.propertysetmixin.comp.JavaSupplier">
+    <service name="test.cppuhelper.propertysetmixin.JavaSupplier"/>
+  </implementation>
+</component>

cppuhelper/qa/propertysetmixin/test_propertysetmixin.cxx

 #include "com/sun/star/beans/XPropertySetInfo.hpp"
 #include "com/sun/star/beans/XVetoableChangeListener.hpp"
 #include "com/sun/star/lang/XComponent.hpp"
-#include "com/sun/star/lang/XMultiComponentFactory.hpp"
 #include "com/sun/star/uno/Any.hxx"
 #include "com/sun/star/uno/Reference.hxx"
 #include "com/sun/star/uno/RuntimeException.hpp"
 #include "com/sun/star/uno/Sequence.hxx"
 #include "com/sun/star/uno/Type.hxx"
 #include "com/sun/star/uno/XComponentContext.hpp"
+#include "cppuhelper/bootstrap.hxx"
 #include "cppuhelper/implbase1.hxx"
-#include "cppuhelper/servicefactory.hxx"
 #include "cppunit/TestAssert.h"
 #include "cppunit/TestFixture.h"
 #include "cppunit/extensions/HelperMacros.h"
 #include "cppunit/plugin/TestPlugIn.h"
 #include "osl/mutex.hxx"
-#include "rtl/bootstrap.hxx"
 #include "rtl/ref.hxx"
 #include "rtl/string.h"
 #include "rtl/textenc.h"
         out << "com::sun::star::uno::Any[" << value.getValueType() << ", ...]";
 }
 
-rtl::OUString getArgument(rtl::OUString const & name) {
-    rtl::OUString val;
-    CPPUNIT_ASSERT(
-        rtl::Bootstrap::get(
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("arg-")) + name, val));
-    return val;
-}
-
 class BoundListener:
     public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
 {
 public:
     virtual void setUp();
 
-    void finish();
+    virtual void tearDown();
 
     void testCppEmpty1() { testEmpty1(getCppSupplier()); }
 
     CPPUNIT_TEST(testJavaEmpty1);
     CPPUNIT_TEST(testJavaEmpty2);
     CPPUNIT_TEST(testJavaFull);
-    CPPUNIT_TEST(finish);
     CPPUNIT_TEST_SUITE_END();
 
 private:
         css::uno::Reference< test::cppuhelper::propertysetmixin::XSupplier >
         const & supplier) const;
 
-    static css::uno::Reference< css::uno::XComponentContext > m_context;
+    css::uno::Reference< css::uno::XComponentContext > m_context;
 };
 
 void Test::setUp() {
-    // For whatever reason, on W32 it does not work to create/destroy a fresh
-    // component context for each test in Test::setUp/tearDown; therefore, a
-    // single component context is used for all tests and destroyed in the last
-    // pseudo-test "finish":
-    if (!m_context.is()) {
-        css::uno::Reference< css::lang::XMultiComponentFactory > factory(
-            cppu::createRegistryServiceFactory(
-                getArgument(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("reg"))),
-                sal_False,
-                getArgument(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("path")))),
-            css::uno::UNO_QUERY_THROW);
-        css::uno::Reference< css::beans::XPropertySet >(
-            factory, css::uno::UNO_QUERY_THROW)->getPropertyValue(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")))
-            >>= m_context;
-    }
+    m_context = cppu::defaultBootstrap_InitialComponentContext();
+    CPPUNIT_ASSERT(m_context.is());
 }
 
-void Test::finish() {
+void Test::tearDown() {
     css::uno::Reference< css::lang::XComponent >(
         m_context, css::uno::UNO_QUERY_THROW)->dispose();
 }
     } catch (css::beans::UnknownPropertyException &) {}
 }
 
-css::uno::Reference< css::uno::XComponentContext > Test::m_context;
-
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 }

cppuhelper/source/bootstrap.cxx

     Bootstrap const & bootstrap )
     SAL_THROW( (Exception) )
 {
-    OUString bootstrapPath( get_this_libpath() );
+    OUString bootstrapPath;
+    if (!bootstrap.getFrom(
+            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URE_INTERNAL_LIB_DIR")),
+            bootstrapPath))
+    {
+        bootstrapPath = get_this_libpath();
+    }
+
     OUString iniDir;
-
     osl_getProcessWorkingDir(&iniDir.pData);
 
     Reference<lang::XMultiComponentFactory> smgr_XMultiComponentFactory(

sax/source/expatwrap/makefile.mk

 $(MISC)/sax.inbuild.component .ERRREMOVE : \
         $(SOLARENV)/bin/createcomponent.xslt sax.component
     $(XSLTPROC) --nonet --stringparam uri \
-        '$(COMPONENTPREFIX_INBUILD)$(SHL1TARGETN:f)' -o $@ \
+        '$(COMPONENTPREFIX_INBUILD_NATIVE)$(SHL1TARGETN:f)' -o $@ \
         $(SOLARENV)/bin/createcomponent.xslt sax.component

solenv/bin/subsequenttests

 use lib("$ENV{SOLARENV}/bin/modules");
 use SourceConfig;
 
+my $keep_going = 0;
+my $dry_run = 0;
 my $max_running = 1;
 while (@ARGV) {
     my $arg = shift(@ARGV);
     } elsif ($arg eq '--') {
         last;
     } else {
-        print STDERR "unknown argument \"$arg\"\n";
-        print STDERR "usage: $0 [-P<n>] [-- <args>]\n";
-        print STDERR " -P<n>  number of parallel dmake invocations\n";
-        print STDERR " <args> are passed to dmake invocations\n";
-        exit(1);
+        my $n = substr($arg, 0, 1) eq '-' ? 1 : 0;
+        while ($n && $n < length($arg)) {
+            my $c = substr($arg, $n++, 1);
+            if ($c eq 'k') {
+                $keep_going = 1;
+            } elsif ($c eq 'n') {
+                $dry_run = 1;
+            } else {
+                $n = 0;
+                last;
+            }
+        }
+        if (!$n) {
+            print STDERR "unknown argument \"$arg\"\n";
+            print STDERR "usage: $0 [-kn] [-P<n>] [-- <args>]\n";
+            print STDERR " -k     continue with other dmake invocations upon\n";
+            print STDERR "        failure\n";
+            print STDERR " -n     write directories that would be processed\n";
+            print STDERR "        to standard output\n";
+            print STDERR " -P<n>  number of parallel dmake invocations\n";
+            print STDERR " <args> are passed to dmake invocations\n";
+            exit(1);
+        }
     }
 }
 
     }
 }
 
+if ($dry_run) {
+    foreach $path (@testpaths) {
+        print "$path\n";
+    }
+    exit(0);
+}
+
 my $cmd = 'dmake';
 foreach (@ARGV) {
     s/'/'\''/g;
     my $testpath = delete($pids{$pid});
     defined($testpath) or die("unmatched PID $pid");
     if ($? != 0) {
-        @testpaths = ();
         push(@failedpaths, $testpath);
+        @testpaths = () unless $keep_going;
     }
     --$running;
 }

solenv/inc/settings.mk

 .END
 COMPONENTPREFIX_BASIS_JAVA = vnd.sun.star.expand:$$OOO_BASE_DIR/program/classes/
 COMPONENTPREFIX_BASIS_PYTHON = vnd.openoffice.pymodule:
-COMPONENTPREFIX_INBUILD = vnd.sun.star.expand:$$OOO_INBUILD_SHAREDLIB_DIR/
+COMPONENTPREFIX_INBUILD_NATIVE = \
+    vnd.sun.star.expand:$$OOO_INBUILD_SHAREDLIB_DIR/
+COMPONENTPREFIX_INBUILD_JAVA = vnd.sun.star.expand:$$OOO_INBUILD_JAR_DIR/
 
 # workaround for strange dmake bug:
 # if the previous block was a rule or a target, "\#" isn't recognized

stoc/test/uriproc/makefile.mk

 
 ENABLE_EXCEPTIONS := TRUE
 
+my_components = stocservices
+
 .INCLUDE: settings.mk
 
 CFLAGSCXX += $(CPPUNIT_CFLAGS)
 
 test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb
     $(CPPUNITTESTER) $(SHL1TARGETN) \
+        -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb \
         -env:UNO_SERVICES=$(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb \
-        -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb \
-        -env:OOO_TEST_PREFIX=$(my_file)$(PWD)/$(DLLDEST)/
+        -env:URE_INTERNAL_LIB_DIR=$(my_file)$(PWD)/$(DLLDEST)
 
-$(MISC)/$(TARGET)/services.rdb:
+$(MISC)/$(TARGET)/services.rdb .ERRREMOVE: $(SOLARENV)/bin/packcomponents.xslt \
+        $(MISC)/$(TARGET)/services.input \
+        $(my_components:^"$(MISC)/":+".component")
+    $(XSLTPROC) --nonet --stringparam prefix $(PWD)/$(MISC)/ -o $@ \
+        $(SOLARENV)/bin/packcomponents.xslt $(MISC)/$(TARGET)/services.input
+
+$(MISC)/$(TARGET)/services.input .ERRREMOVE:
     $(MKDIRHIER) $(@:d)
-    $(RM) $@
-    $(REGCOMP) -register -r $@ -wop=vnd.sun.star.expand:\$${{OOO_TEST_PREFIX}} \
-        -c $(DLLDEST)/stocservices.uno$(DLLPOST)
+    - $(RM) $@
+    echo \
+        '<list>$(my_components:^"<filename>":+".component</filename>")</list>' \
+        > $@
 
 .END
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.