From 8a0a28a334ea7f52b9e42a870fd473cc15bd6720 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Sat, 6 Nov 2021 14:43:43 -0700 Subject: [PATCH] Integrate java unit tests into ctest (#7593) This PR properly integrates the java api unit tests into ctest. --- src/api/__pycache__/parsekinds.cpython-39.pyc | Bin 4484 -> 0 bytes test/unit/api/java/CMakeLists.txt | 54 +++++++++--------- 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 src/api/__pycache__/parsekinds.cpython-39.pyc diff --git a/src/api/__pycache__/parsekinds.cpython-39.pyc b/src/api/__pycache__/parsekinds.cpython-39.pyc deleted file mode 100644 index 34d010ce4ea1b1b43af2c337e2fffe03b8ca7219..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4484 zcmZu!&u<&Y72cU$QY(s7(3GfUXMEgatwCBG!fep!t8 zBf|AvG3t+sieHhAEM2qwF)`*>Mb*C~F8SkP+`lX?`x9cqpA?f~N?iFf_ov>s#I$(f z6HC1CocmYA)lI8*t@A}?Yd6ZgEL2fjdr_+$%a%-Z=6w()B3lnsCY5)%8-=@-HZ?L& z?@Di11_JN5qgZ<3)9|g?Oog*SJDLsK?OA%!+{5ttZUxq5-+1N)hk=q_x^0Zyd^y_o z?%wp;f!0zbUXTdyFp6U@+DTF+D`X<`gbZU065eB}52Z}J^I@cZ^JSTcX!~Z}ThU$^ zz($;`u;_ zIjeL=WpdCme(3PoS(IBHervWY(Fxw7f=`A0rqUaxU~bUxBgWvEl-Us{gS zKu5_=JB<<@(!7H|2aWeovY$an%V&r@mo~*ymLrZR0|lR0h&1Al=cqvZ@vI2MAI~v? z_~Tg>W1@;DB9DlU=VJqr3mI&m|ESJU7ErP~5ZZcfb*(1rJ-MKky+hIw46-CRWLa1+ zY&Vv3t2Uy@LS8bl$w$qjDbg@^5eS{`$s`{?uQf9rgnPLgB?b*yJ{<=dF=;-I({QgD zrY%AmLg8dG-u}C#reXT5KD(Q?;5@%KXJJ$w%H=s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H* z%K~sc0HOgU5Vb<0H;lMe5UR9q%Rn;gHyc|95X;~J*CdS~vHZ&X>e|8w&4slG50-G< z%rCva(oj=~hq_E+0wOPi?0~g=a#(k%v6$QKw2d@~5*}5D@Jq(>*MU?mHeKYPe}G>0 z3WViW7?MU-W&jdOmAQ6>SJ)H^-tjVXcxPr1P=jWM;8cb+Duyclhl)02@thN!P8f0^ zt^p7L>|f^CJEzvMtxH`S0l(k1k%QYOWnDUDzXy0oBU{{`=~^cvU5rxe`!m`#y29k< zqs-d>g8H9~s(*KFT>+#tbjFO%pZfO33VSDJw&c6IYWhFx_g4q|G211Y4Vjn&%i~@9 z9>8~U8TARgEp-XxlU?VYg_)*|r5OO&YL4#DU@iRQ$|;g%^VQ%qa-58<+H~%uh+OU{ zd^wuKpYz75x()y2BfXI4&NfnF^%lKzml_WrG!a)dNlklgVLs{i^D+zI!F>2Dx_BTf3y!y3oJG^SJt>0)L+ z2i3b6>Dvnn^FH5PQ1{VN^fjiwM}lmt_ek6$@eYap#uR=0sudEH2&k7y(2BloskwWv gaMXQbgzQxaXSC{I#TS1Y?2pp>JC4m6|FT^EKW~e53;+NC diff --git a/test/unit/api/java/CMakeLists.txt b/test/unit/api/java/CMakeLists.txt index 61ae74fd2..5f573a117 100644 --- a/test/unit/api/java/CMakeLists.txt +++ b/test/unit/api/java/CMakeLists.txt @@ -18,6 +18,7 @@ include(UseJava) find_package(JUnit REQUIRED) get_target_property(CVC5_JAR_PATH cvc5jar JAR_FILE) +get_filename_component(CVC5_JNI_PATH ${CVC5_JAR_PATH} DIRECTORY) # specify source files for junit tests set(java_test_src_files @@ -31,9 +32,9 @@ set(java_test_src_files ) # build junit tests -add_custom_target( - build-junit-tests - ALL +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tests/SolverTest.class + DEPENDS JUnit-EP-jar cvc5jar ${java_test_src_files} COMMAND ${Java_JAVAC_EXECUTABLE} ${java_test_src_files} -cp ${JUnit_JAR}:${CVC5_JAR_PATH} # add JUnit and cvc5 jar files to the class path @@ -41,29 +42,28 @@ add_custom_target( COMMENT "Build junit tests" VERBATIM ) - -# make sure junit jar file is present -add_dependencies(build-junit-tests JUnit-EP-jar) -# make sure cvc.jar file is built first -add_dependencies(build-junit-tests cvc5jar) - -get_filename_component(CVC5_JNI_PATH ${CVC5_JAR_PATH} DIRECTORY) - -# run junit tests -add_custom_target( - run-junit-tests - ALL - COMMAND - # run junit tests - ${Java_JAVA_EXECUTABLE} - -Djava.library.path=${CVC5_JNI_PATH} - -jar ${JUnit_JAR} - -cp ${JUnit_JAR}:${CVC5_JAR_PATH}:. - -select-package tests - COMMENT "Run junit tests" - VERBATIM +add_custom_target(build-junit-tests + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tests/SolverTest.class ) +add_dependencies(build-units build-junit-tests) + +macro(cvc5_add_java_api_test name) + add_test (NAME unit/api/java/${name} + COMMAND + ${Java_JAVA_EXECUTABLE} + -Djava.library.path=${CVC5_JNI_PATH} + -jar ${JUnit_JAR} + -cp ${JUnit_JAR}:${CVC5_JAR_PATH}:. + -select-package tests + -n tests.${name} + ) + set_tests_properties(unit/api/java/${name} PROPERTIES LABELS "unit java") +endmacro() -add_dependencies(run-junit-tests build-junit-tests) -add_dependencies(units run-junit-tests) -add_dependencies(check run-junit-tests) \ No newline at end of file +cvc5_add_java_api_test(DatatypeTest) +cvc5_add_java_api_test(GrammarTest) +cvc5_add_java_api_test(OpTest) +cvc5_add_java_api_test(ResultTest) +cvc5_add_java_api_test(SolverTest) +cvc5_add_java_api_test(SortTest) +cvc5_add_java_api_test(TermTest) -- 2.30.2