LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File libkml_tests.patch of Package libkml (Project home:bruno_friedmann:branches:Application:Geo)

diff -rupN libkml-1.3.0/tests/swig/CMakeLists.txt libkml-1.3.0-new/tests/swig/CMakeLists.txt
--- libkml-1.3.0/tests/swig/CMakeLists.txt	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/tests/swig/CMakeLists.txt	2016-04-08 23:16:10.010988071 +0200
@@ -1,19 +1,32 @@
 if(WITH_PYTHON)
+
 add_test(NAME test_python_kmlbase
   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmlbase_test.py)
+set_tests_properties(test_python_kmlbase
+     PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
 
 add_test(NAME test_python_kmldom
   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmldom_test.py)
+set_tests_properties(test_python_kmldom
+     PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
 
 add_test(NAME test_python_kmlengine
   COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmlengine_test.py)
+set_tests_properties(test_python_kmlengine
+     PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
 endif()
 
 if(WITH_JAVA)
+
+include(UseJava)
+add_jar(KmlBaseTest KmlBaseTest.java INCLUDE_JARS /usr/share/java/junit.jar ${CMAKE_BINARY_DIR}/src/swig/LibKML.jar)
+add_dependencies(KmlBaseTest LibKML_jar)
+
 add_test( NAME test_java_kmlbase
   COMMAND
   ${Java_JAVA_EXECUTABLE}
-  -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_BINARY_DIR}/src/swig/LibKML.jar;${CMAKE_CURRENT_BINARY_DIR}"
+  -cp "/usr/share/java/junit.jar:/usr/share/java/hamcrest/core.jar:${CMAKE_BINARY_DIR}/src/swig/LibKML.jar:${CMAKE_CURRENT_BINARY_DIR}/KmlBaseTest.jar" org.junit.runner.JUnitCore KmlBaseTest
   KmlBaseTest )
-
-endif()
\ No newline at end of file
+set_tests_properties(test_java_kmlbase
+     PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
+endif()
Binary files libkml-1.3.0/tests/swig/KmlBaseTest.class and libkml-1.3.0-new/tests/swig/KmlBaseTest.class differ
diff -rupN libkml-1.3.0/tests/swig/kmldom_test.py libkml-1.3.0-new/tests/swig/kmldom_test.py
--- libkml-1.3.0/tests/swig/kmldom_test.py	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/tests/swig/kmldom_test.py	2016-04-08 22:38:23.086695444 +0200
@@ -753,7 +753,7 @@ def TestColorStyle(colorstyle):
   color = kmlbase.Color32(0xf0f0c80f)
   colorstyle.set_color(color)
   assert colorstyle.has_color()
-  assert color == colorstyle.get_color()
+  assert color.to_string_argb() == colorstyle.get_color().to_string_argb()
   # Clear <color> and verify has_
   colorstyle.clear_color()
   assert not colorstyle.has_color()
diff -rupN libkml-1.3.0/tests/swig/kmlengine_test.py libkml-1.3.0-new/tests/swig/kmlengine_test.py
--- libkml-1.3.0/tests/swig/kmlengine_test.py	2015-12-21 18:23:05.000000000 +0100
+++ libkml-1.3.0-new/tests/swig/kmlengine_test.py	2016-04-08 22:42:03.317347774 +0200
@@ -32,6 +32,7 @@ This file contains unit tests for the KM
 import unittest
 import kmldom
 import kmlengine
+import os
 
 # These VerySimple tests really only verify that the function/class exists.
 
@@ -239,7 +240,7 @@ class BasicKmlFileSerializeToStringTestC
 
 class BasicKmzFileTestCase(unittest.TestCase):
   def runTest(self):
-    kmz_filepath = '../../testdata/kmz/model-macky.kmz'
+    kmz_filepath = os.path.join(os.path.dirname(__file__), '../../testdata/kmz/model-macky.kmz')
     kmzfile = kmlengine.KmzFile.OpenFromFile(kmz_filepath)
     assert kmzfile
     (ok, kml) = kmzfile.ReadKml()