run.cmake.in 5.43 KB
Newer Older
1 2 3
# Scripts to assist developers
# Mostly these are calling the test suite driver and validator classes in Java

4 5
# TODO More Test Targets
# Rebasing
Aaron Bray's avatar
Aaron Bray committed
6
# com.kitware.physiology.utilities.testing.Rebase [from to (config|ALL)]
7 8
#
# Ploting
Aaron Bray's avatar
Aaron Bray committed
9
# com.kitware.physiology.utilities.csv.plots.PlotDriver
10 11
#
# Reconfigure the config file (in memory) so we can test serialization
Aaron Bray's avatar
Aaron Bray committed
12
# com.kitware.physiology.utilities.testing.Reconfiguration
13

14
find_package(Java REQUIRED)
15
include(UseJava)
16 17 18 19 20 21 22 23 24
if(_JAVA_HOME)
  # Overwrite Java if the env variable is set
  
  message(STATUS "Using JAVA_HOME as my Java executable (set to : ${_JAVA_HOME})")
  set(Java_JAVA_EXECUTABLE ${_JAVA_HOME}/bin/java)
endif()
#  You tell me what JDK/JRE you want to use
#set(Java_JAVA_EXECUTABLE "/the_jdk_I_want/bin/java)

25
set(JAVA_CLASSPATH Pulse.jar
26 27 28 29
        "@CMAKE_SOURCE_DIR@/jar/javassist-3.16.1-GA.jar"
        "@CMAKE_SOURCE_DIR@/jar/jcommon-1.0.16.jar"
        "@CMAKE_SOURCE_DIR@/jar/jdom-2.0.2.jar"
        "@CMAKE_SOURCE_DIR@/jar/jfreechart-1.0.13.jar"
30 31
        "@CMAKE_SOURCE_DIR@/jar/gson-2.8.5.jar"
        "@CMAKE_SOURCE_DIR@/jar/guava-26.0-jre.jar"
32 33 34 35 36 37 38 39 40 41 42
        "@CMAKE_SOURCE_DIR@/jar/log4j-1.2.17.jar"
        "@CMAKE_SOURCE_DIR@/jar/poi-3.13-20150929.jar"
        "@CMAKE_SOURCE_DIR@/jar/poi-ooxml-3.13-20150929.jar"
        "@CMAKE_SOURCE_DIR@/jar/poi-ooxml-schemas-3.13-20150929.jar"
        "@CMAKE_SOURCE_DIR@/jar/pdfbox-2.0.0-RC3.jar"
        "@CMAKE_SOURCE_DIR@/jar/reflections-0.9.9-RC1-uberjar.jar"
        "@CMAKE_SOURCE_DIR@/jar/xmlbeans-2.6.0.jar"
        "@CMAKE_SOURCE_DIR@/jar/zip4j-1.3.1.jar"
        "@CMAKE_SOURCE_DIR@/jar/org.eclipse.jgit-4.11.0.201803080745-r.jar"
        "@CMAKE_SOURCE_DIR@/jar/slf4j-api-1.7.25.jar"
        "@CMAKE_SOURCE_DIR@/jar/slf4j-simple-1.7.25.jar")
43 44 45

if(NOT WIN32)
  string(REPLACE ";" ":" JAVA_CLASSPATH "${JAVA_CLASSPATH}")
46 47
endif()

48 49

if(TYPE STREQUAL "SystemValidation")
Aaron Bray's avatar
Aaron Bray committed
50 51
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.SETestDriver SystemVerification.config)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.validation.SystemValidation )
52
elseif(TYPE STREQUAL "PatientValidation")
Aaron Bray's avatar
Aaron Bray committed
53 54
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.SETestDriver PatientVerification.config)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.validation.PatientValidation)
55
elseif(TYPE STREQUAL "genData")
Aaron Bray's avatar
Aaron Bray committed
56
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.pulse.dataset.DataSetReader)
57
elseif(TYPE STREQUAL "genStates")
Aaron Bray's avatar
Aaron Bray committed
58
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.SETestDriver InitialPatientStates.config)
59 60 61
elseif(TYPE STREQUAL "doxygen")
  file(MAKE_DIRECTORY  "./docs/html")
  file(MAKE_DIRECTORY  "./docs/markdown")
62
  file(GLOB_RECURSE DOCS "./docs/html/*.*" "./docs/markdown/*.*")
63 64 65
  if(DOCS)
    file(REMOVE ${DOCS})
  endif()
66 67 68
  file(COPY @CMAKE_SOURCE_DIR@/docs/Doxygen/bootstrap DESTINATION ./docs/html)
  file(COPY @CMAKE_SOURCE_DIR@/docs/Doxygen/font-awesome-4.3.0 DESTINATION ./docs/html)
  file(COPY @CMAKE_SOURCE_DIR@/docs/Images DESTINATION ./docs/html)
69
  # These are run above
Aaron Bray's avatar
Aaron Bray committed
70 71 72 73 74 75 76
  #execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.validation.SystemValidation)
  #execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.validation.PatientValidation)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.datamodel.doxygen.DoxygenPreprocessor @CMAKE_SOURCE_DIR@/docs/Markdown ./docs/markdown)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.datamodel.doxygen.DoxygenPreprocessor @CMAKE_SOURCE_DIR@/docs/Methodology ./docs/markdown ./test_results/tables)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.datamodel.doxygen.Proto2Doxygen @CMAKE_SOURCE_DIR@/schema/proto ./docs/markdown)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.datamodel.doxygen.CDM2MD ./docs/markdown)
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.utilities.csv.plots.PlotDriver PlotRun.config)
77
  execute_process(COMMAND doxygen ./docs/full.doxy)
78
elseif(TYPE STREQUAL "protoc")
79
  execute_process(COMMAND ${CMAKE_COMMAND} -DSCHEMA_SRC:STRING=@SCHEMA_SRC@ -DSCHEMA_DST:STRING=@SCHEMA_DST@ -P @CMAKE_SOURCE_DIR@/schema/GenerateCDMBindings.cmake)
80
elseif(TYPE STREQUAL "updateBaselines")
81
  execute_process(COMMAND ${CMAKE_COMMAND} --build @CMAKE_CURRENT_BINARY_DIR@ --target UpdateVerification)
82
elseif(TYPE STREQUAL "rebase")
Aaron Bray's avatar
Aaron Bray committed
83
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.Rebase)
84
elseif(TYPE STREQUAL "FullReport")
Aaron Bray's avatar
Aaron Bray committed
85
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.SEReportResults)
86
else()
Aaron Bray's avatar
Aaron Bray committed
87
  execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" com.kitware.physiology.testing.SETestDriver ${TYPE}.config)
88
endif()