Debian Codegraph @

test/api/java/CMakeLists.txt

raw
1 ###############################################################################
2 # Top contributors (to current version):
3 # Daniel Larraz
4 #
5 # This file is part of the cvc5 project.
6 #
7 # Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
8 # in the top-level source directory and their institutional affiliations.
9 # All rights reserved. See the file COPYING in the top-level source
10 # directory for licensing information.
11 # #############################################################################
12 #
13 # The build system configuration.
14 ##
15
16 find_package(Java REQUIRED)
17 include(UseJava)
18
19 get_target_property(CVC5_JAR_PATH cvc5jar JAR_FILE)
20 get_target_property(CVC5_JNI_LIBDIR cvc5jni LIBRARY_OUTPUT_DIRECTORY)
21
22 add_custom_target(build-japitests)
23 add_dependencies(build-apitests build-japitests)
24
25 add_custom_target(japitests
26 COMMAND ctest --output-on-failure -L "japi" -j${CTEST_NTHREADS} $$ARGS
27 DEPENDS build-japitests)
28
29 if(WIN32)
30 set(PATH_SEP ";")
31 else()
32 set(PATH_SEP ":")
33 endif()
34
35 macro(cvc5_add_java_api_test name dir)
36 set(test_bin_dir ${CMAKE_BINARY_DIR}/bin/test/api/java/${dir})
37 add_jar(${name}
38 SOURCES ${name}.java
39 INCLUDE_JARS ${CVC5_JAR_PATH}
40 ENTRY_POINT ${name}
41 OUTPUT_DIR ${test_bin_dir}
42 )
43 if("${dir}" STREQUAL "")
44 set(testname api/java/${name})
45 else()
46 set(testname api/java/${dir}/${name})
47 endif()
48 add_test(${testname}
49 ${ENV_PATH_CMD}
50 ${Java_JAVA_EXECUTABLE}
51 -Djava.library.path=${CVC5_JNI_LIBDIR}
52 -cp "${CVC5_JAR_PATH}${PATH_SEP}${test_bin_dir}/${name}.jar" ${name}
53 )
54 set_tests_properties(${testname} PROPERTIES LABELS "api japi")
55 add_dependencies(build-japitests ${name})
56 endmacro()
57
58 cvc5_add_java_api_test(Boilerplate "")
59 cvc5_add_java_api_test(Ouroborous "")
60 cvc5_add_java_api_test(ResetAssertions "")
61 cvc5_add_java_api_test(Smt2Compliance "")
62 cvc5_add_java_api_test(TwoSolvers "")
63
64 if (NOT ENABLE_SAFE_MODE AND NOT ENABLE_STABLE_MODE)
65 cvc5_add_java_api_test(SepLogApi "")
66 endif()
67
68 add_subdirectory(issues)