]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Run python-bindings tests 9220/head
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 4 Jan 2020 17:32:39 +0000 (18:32 +0100)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 18 Jan 2020 14:31:29 +0000 (09:31 -0500)
CMakeLists.txt
contrib/python-bindings/CMakeLists.txt
contrib/python-bindings/tests/CMakeLists.txt [new file with mode: 0644]
tests/CMakeLists.txt

index f14854ff3ba95343a4fe1795bab789fa1fdabcc2..6098719428432a7fc8dbaf6debf6e34ea3532a7d 100644 (file)
@@ -156,13 +156,14 @@ ADD_SUBDIRECTORY(source) # has to be included after bundled
 ADD_SUBDIRECTORY(cmake/config) # has to be included after source
 ADD_SUBDIRECTORY(examples)
 
-ADD_SUBDIRECTORY(contrib/python-bindings)
 ADD_SUBDIRECTORY(contrib/utilities)
 
 IF(DEAL_II_HAVE_TESTS_DIRECTORY)
   ADD_SUBDIRECTORY(tests)
 ENDIF()
 
+ADD_SUBDIRECTORY(contrib/python-bindings) # has to be included after tests
+
 #
 # And finally, print the configuration:
 #
index 884b8322c3ec4d04ce67e9348d060269f5c9b41e..e29c34c99f0657972c4d28d1e7ff10d65c1fbef7 100644 (file)
@@ -78,6 +78,8 @@ IF(DEAL_II_COMPONENT_PYTHON_BINDINGS)
 
   ADD_SUBDIRECTORY(source)
 
+  ADD_SUBDIRECTORY(tests)
+
   MESSAGE(STATUS "Setting up python bindings - Done")
   MESSAGE(STATUS "")
 
diff --git a/contrib/python-bindings/tests/CMakeLists.txt b/contrib/python-bindings/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f010303
--- /dev/null
@@ -0,0 +1,30 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2020 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+#
+# Make sure that the tests are picked up by a global CTest call
+#
+FILE(APPEND ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "SUBDIRS(contrib/python-bindings/tests)\n")
+ENABLE_TESTING()
+
+FILE(GLOB _tests "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
+FOREACH(_test_path ${_tests})
+ GET_FILENAME_COMPONENT(_test ${_test_path} NAME_WE)
+ ADD_TEST(NAME python-bindings/${_test} COMMAND ${PYTHON_EXECUTABLE} ${_test_path})
+ SET_TESTS_PROPERTIES(python-bindings/${_test} PROPERTIES ENVIRONMENT
+   PYTHONPATH=${CMAKE_BINARY_DIR}/${DEAL_II_PYTHON_RELDIR}/../:$ENV{PYTHONPATH}
+   )
+ENDFOREACH()
+
index b2b80498fcda3fd0f591dd4bd1fa0418df4aabf0..45772a695e7dc5f39f7b805f97b08d22b5800cbb 100644 (file)
@@ -75,7 +75,7 @@ IF(DEFINED DEAL_II_HAVE_TESTS_DIRECTORY)
   # Write minimalistic CTestTestfile.cmake files to CMAKE_BINARY_DIR and
   # CMAKE_BINARY_DIR/tests:
   #
-  FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "SUBDIRS(tests)")
+  FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake "SUBDIRS(tests)\n")
 
   SET(_options "-DDEAL_II_DIR=${CMAKE_BINARY_DIR}")
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.