[Libreoffice-commits] core.git: 2 commits - configure.ac sw/qa

Michael Stahl mstahl at redhat.com
Thu Sep 7 16:07:58 UTC 2017


 configure.ac                                  |   40 ++++++++++++++++----------
 sw/qa/python/text_portion_enumeration_test.py |   32 ++++++++++++++------
 2 files changed, 47 insertions(+), 25 deletions(-)

New commits:
commit e137b0ee2ac2c7dcd209f44768433b709c432918
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Sep 7 17:42:19 2017 +0200

    sw: fix text_portion_enumeration_test.py on WNT
    
    This fails, mostly because of confusing native paths and URLs, and
    because of deleting the temp. directory before closing the file that the
    test wrote into it.
    
    Also, why open the document as a template.
    
    Change-Id: I6da2f3f2c47308c4956444869b5b100a124b8db0

diff --git a/sw/qa/python/text_portion_enumeration_test.py b/sw/qa/python/text_portion_enumeration_test.py
index cc7a28e785ea..343a7da39196 100644
--- a/sw/qa/python/text_portion_enumeration_test.py
+++ b/sw/qa/python/text_portion_enumeration_test.py
@@ -770,8 +770,8 @@ class EnumConverter():
                     continue
                 else:
                     node = self._stack.pop()
-                    assert (isinstance(node, RubyNode),
-                        "stack error: Ruby expected; is: {}".format(str(node)))
+                    assert (isinstance(node, RubyNode)),
+                        "stack error: Ruby expected; is: {}".format(str(node))
             elif type_ == "InContentMetadata":
                 xMeta = xPortion.InContentMetadata
                 xmlid = xMeta.MetadataReference
@@ -3267,15 +3267,21 @@ class TextPortionEnumerationTest(unittest.TestCase):
         xComp = None
         filename = "TESTMETA.odt"
         try:
-            xComp = self.__class__._uno.openWriterTemplateDoc(filename)
+            xComp = self.__class__._uno.openBaseDoc(filename)
             if xComp:
                 self.checkloadmeta(xComp)
                 with TemporaryDirectory() as tempdir:
-                    file = os.path.join(tempdir, filename)
+                    if os.altsep: # we need URL so replace "\" with "/"
+                        tempdir = tempdir.replace(os.sep, os.altsep)
+                    file = tempdir + "/" + filename
                     self.dostore(xComp, file)
                     self.close(xComp)
-                    xComp = self.doload(file)
-                    self.checkloadmeta(xComp)
+                    xComp2 = None
+                    try:
+                        xComp2 = self.doload(file)
+                        self.checkloadmeta(xComp2)
+                    finally:
+                        self.close(xComp2)
         finally:
             self.close(xComp)
 
@@ -3333,15 +3339,21 @@ class TextPortionEnumerationTest(unittest.TestCase):
         xComp = None
         filename = "TESTXMLID.odt"
         try:
-            xComp = self.__class__._uno.openWriterTemplateDoc(filename)
+            xComp = self.__class__._uno.openBaseDoc(filename)
             if xComp:
                 self.checkloadxmlid(xComp)
                 with TemporaryDirectory() as tempdir:
-                    file = os.path.join(tempdir, filename)
+                    if os.altsep: # we need URL so replace "\" with "/"
+                        tempdir = tempdir.replace(os.sep, os.altsep)
+                    file = tempdir + "/" + filename
                     self.dostore(xComp, file)
                     self.close(xComp)
-                    xComp = self.doload(file)
-                    self.checkloadxmlid(xComp)
+                    xComp2 = None
+                    try:
+                        xComp2 = self.doload(file)
+                        self.checkloadxmlid(xComp2)
+                    finally:
+                        self.close(xComp2)
         finally:
             self.close(xComp)
 
commit d74424a09ee7207138ad9da0869b194d3d5c476c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Sep 7 13:26:44 2017 +0200

    configure: find MSVC 2017 MSMs & DLLs again
    
    They're still called "VC150" in my installation.
    
    Change-Id: I0a005236ff5edc758be41616e33b254577144f17

diff --git a/configure.ac b/configure.ac
index 127998708b30..c804dd3f0ce5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5206,19 +5206,21 @@ find_winsdk()
 
 find_msms()
 {
-    my_msm_file=Microsoft_VC${VCVER}_CRT_x86.msm
+    my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
     if test $VCVER = 150; then
-        my_msm_file=Microsoft_VC141_CRT_x86.msm
+        my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
     fi
-    AC_MSG_CHECKING([for $my_msm_file])
+    AC_MSG_CHECKING([for ${my_msm_files}])
     msmdir=
     for ver in 14.0 15.0; do
         reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
         if test -n "$regvalue"; then
-            if test -e "$regvalue/$my_msm_file"; then
-                msmdir=$regvalue
-                break
-            fi
+            for f in ${my_msm_files}; do
+                if test -e "$regvalue/${f}"; then
+                    msmdir=$regvalue
+                    break
+                fi
+            done
         fi
     done
     dnl Is the following fallback really necessary, or was it added in response
@@ -5232,9 +5234,11 @@ find_msms()
     dnl obtain its value from cygwin:
     if test -z "$msmdir"; then
         my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
-        if test -e "$my_msm_dir/$my_msm_file"; then
-            msmdir=$my_msm_dir
-        fi
+        for f in ${my_msm_files}; do
+            if test -e "$my_msm_dir/${f}"; then
+                msmdir=$my_msm_dir
+            fi
+        done
     fi
 
     dnl Starting from MSVC 15.0, merge modules are located in different directory
@@ -5242,10 +5246,12 @@ find_msms()
         for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
             AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
             my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
-            if test -e "$my_msm_dir/$my_msm_file"; then
-                msmdir=$my_msm_dir
-                break
-            fi
+            for f in ${my_msm_files}; do
+                if test -e "$my_msm_dir/${f}"; then
+                    msmdir=$my_msm_dir
+                    break
+                fi
+            done
         done
     fi
 
@@ -5257,7 +5263,7 @@ find_msms()
             AC_MSG_ERROR([not found])
         else
             AC_MSG_WARN([not found])
-            add_warning "MSM $my_msm_file not found"
+            add_warning "MSM none of ${my_msm_files} found"
         fi
     fi
 }
@@ -5272,6 +5278,10 @@ find_msvc_x64_dlls()
                 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
                 break
             fi
+            if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
+                msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
+                break
+            fi
         done
     fi
     msvcdlls="msvcp140.dll vcruntime140.dll"


More information about the Libreoffice-commits mailing list