File: CMakeLists.txt

package info (click to toggle)
f3d 3.2.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,668 kB
  • sloc: cpp: 99,109; python: 811; sh: 342; xml: 238; java: 101; javascript: 95; makefile: 25
file content (31 lines) | stat: -rw-r--r-- 1,093 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
list(APPEND javaf3dTests_list
     ${CMAKE_CURRENT_SOURCE_DIR}/TestJavaBindings.java
    )

set(java_test_args "-ea") # enable assertions
if(APPLE)
  # On macOS, this argument is mandatory in order to create native window
  list(APPEND java_test_args "-XstartOnFirstThread")
endif()

set(java_test_disabled OFF)

if(NOT F3D_TESTING_ENABLE_RENDERING_TESTS)
  set(java_test_disabled ON)
endif ()

# Add all the ADD_TEST for each test
foreach(test_file ${javaf3dTests_list})
  get_filename_component (TName ${test_file} NAME_WE)

  add_test(NAME javaf3d::${TName}
    WORKING_DIRECTORY "$<SHELL_PATH:$<TARGET_FILE_DIR:javaf3d>>" # path to the JNI library
    COMMAND ${Java_JAVA_EXECUTABLE}
      -Djava.library.path=$<SHELL_PATH:$<TARGET_FILE_DIR:javaf3d>> # path to the JNI library
      ${java_test_args}
      -cp $<SHELL_PATH:$<TARGET_PROPERTY:f3d-jar,JAR_FILE>> # path to the JAR file
      $<SHELL_PATH:${test_file}> ${F3D_SOURCE_DIR}/testing/ ${CMAKE_BINARY_DIR}/Testing/Temporary/
    )

    set_tests_properties(javaf3d::${TName} PROPERTIES DISABLED ${java_test_disabled})
endforeach()