orion / rpms / libkml

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