From 70d5a925d60c5bdfb0e72183e28435b2023e8529 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Sat, 5 Mar 2016 21:58:47 +0100 Subject: [PATCH] One CMakeLists for all java teshes --- .gitignore | 4 ++-- teshsuite/java/CMakeLists.txt | 22 +++++++++++++++++++ .../SemaphoreGC.java | 2 +- .../SemaphoreGC.tesh} | 2 +- .../SleepHostOff.java | 2 +- .../SleepHostOff.tesh} | 2 +- .../sleep_host_off_d.xml | 0 teshsuite/java/semaphore/CMakeLists.txt | 19 ---------------- teshsuite/java/sleep_host_off/CMakeLists.txt | 20 ----------------- tools/cmake/DefinePackages.cmake | 3 +-- 10 files changed, 29 insertions(+), 47 deletions(-) create mode 100644 teshsuite/java/CMakeLists.txt rename teshsuite/java/{semaphore => SemaphoreGC}/SemaphoreGC.java (98%) rename teshsuite/java/{semaphore/semaphore_gc.tesh => SemaphoreGC/SemaphoreGC.tesh} (66%) rename teshsuite/java/{sleep_host_off => SleepHostOff}/SleepHostOff.java (98%) rename teshsuite/java/{sleep_host_off/sleep_host_off.tesh => SleepHostOff/SleepHostOff.tesh} (83%) rename teshsuite/java/{sleep_host_off => SleepHostOff}/sleep_host_off_d.xml (100%) delete mode 100644 teshsuite/java/semaphore/CMakeLists.txt delete mode 100644 teshsuite/java/sleep_host_off/CMakeLists.txt diff --git a/.gitignore b/.gitignore index a726a58594..b921ea6bf3 100644 --- a/.gitignore +++ b/.gitignore @@ -264,8 +264,8 @@ src/replay/replay testall teshsuite/bug-17132/bug-17132 teshsuite/datadesc_usage.out -teshsuite/java/semaphore/java_semaphore_gc_compiled -teshsuite/java/sleep_host_off/java_sleep_host_off_compiled +teshsuite/java/SemaphoreGC/SemaphoreGC_compiled +teshsuite/java/SleepHostOff/SleepHostOff_compiled teshsuite/mc/dwarf/dwarf teshsuite/mc/dwarf_expression/dwarf-expression teshsuite/mc/replay/random_bug diff --git a/teshsuite/java/CMakeLists.txt b/teshsuite/java/CMakeLists.txt new file mode 100644 index 0000000000..322238f407 --- /dev/null +++ b/teshsuite/java/CMakeLists.txt @@ -0,0 +1,22 @@ +foreach(example SemaphoreGC SleepHostOff) + set(sources ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.java) + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.tesh PARENT_SCOPE) + + if(enable_java) + add_custom_command( + COMMENT "Building ${example}..." + OUTPUT ${example}_compiled + DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} + COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${sources} + COMMAND ${CMAKE_COMMAND} -E remove ${example}/${example}_compiled + COMMAND ${CMAKE_COMMAND} -E touch ${example}/${example}_compiled + ) + add_custom_target(${example} ALL DEPENDS ${example}_compiled) + set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example}) + + ADD_TESH(tesh-java-${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java ${CMAKE_HOME_DIRECTORY}/teshsuite/java/${example}/${example}.tesh) + endif() +endforeach() + +set(examples_src ${examples_src} ${sources} PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/SleepHostOff/sleep_host_off_d.xml PARENT_SCOPE) diff --git a/teshsuite/java/semaphore/SemaphoreGC.java b/teshsuite/java/SemaphoreGC/SemaphoreGC.java similarity index 98% rename from teshsuite/java/semaphore/SemaphoreGC.java rename to teshsuite/java/SemaphoreGC/SemaphoreGC.java index 1dd871cff1..d8fb366269 100644 --- a/teshsuite/java/semaphore/SemaphoreGC.java +++ b/teshsuite/java/SemaphoreGC/SemaphoreGC.java @@ -7,7 +7,7 @@ * This was reported as bug #19893 on gforge. */ -package semaphore; +package SemaphoreGC; import org.simgrid.msg.*; import org.simgrid.msg.Process; diff --git a/teshsuite/java/semaphore/semaphore_gc.tesh b/teshsuite/java/SemaphoreGC/SemaphoreGC.tesh similarity index 66% rename from teshsuite/java/semaphore/semaphore_gc.tesh rename to teshsuite/java/SemaphoreGC/SemaphoreGC.tesh index 41bc59309c..72e87a8508 100644 --- a/teshsuite/java/semaphore/semaphore_gc.tesh +++ b/teshsuite/java/SemaphoreGC/SemaphoreGC.tesh @@ -1,4 +1,4 @@ -$ java -classpath ${classpath:=.} semaphore.SemaphoreGC ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%P@%h)%e%m%n" +$ java -classpath ${classpath:=.} SemaphoreGC.SemaphoreGC ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.4r]%e(%i:%P@%h)%e%m%n" > [ 0.0000] (0:maestro@) Using regular java threads. > [ 0.0000] (1:SemCreator@Fafard) Creating 50 new Semaphores, yielding and triggering a GC after each > [ 500.0000] (1:SemCreator@Fafard) It worked, we survived. The test is passed. diff --git a/teshsuite/java/sleep_host_off/SleepHostOff.java b/teshsuite/java/SleepHostOff/SleepHostOff.java similarity index 98% rename from teshsuite/java/sleep_host_off/SleepHostOff.java rename to teshsuite/java/SleepHostOff/SleepHostOff.java index 02368af093..5aaef5ba5d 100644 --- a/teshsuite/java/sleep_host_off/SleepHostOff.java +++ b/teshsuite/java/SleepHostOff/SleepHostOff.java @@ -4,7 +4,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -package sleep_host_off; +package SleepHostOff; import org.simgrid.msg.*; import org.simgrid.msg.Process; diff --git a/teshsuite/java/sleep_host_off/sleep_host_off.tesh b/teshsuite/java/SleepHostOff/SleepHostOff.tesh similarity index 83% rename from teshsuite/java/sleep_host_off/sleep_host_off.tesh rename to teshsuite/java/SleepHostOff/SleepHostOff.tesh index c371d7fb40..b70150ae31 100644 --- a/teshsuite/java/sleep_host_off/sleep_host_off.tesh +++ b/teshsuite/java/SleepHostOff/SleepHostOff.tesh @@ -1,4 +1,4 @@ -$ java -classpath ${classpath:=.} sleep_host_off.SleepHostOff ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ java -classpath ${classpath:=.} SleepHostOff.SleepHostOff ${srcdir:=.}/../../examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:maestro@) Using regular java threads. > [ 0.000000] (1:TestRunner@Fafard) **** **** **** ***** ***** Test Sleep ***** ***** **** **** **** > [ 0.000000] (1:TestRunner@Fafard) Test sleep: Create a process on Tremblay that simply make periodic sleep, turn off Tremblay diff --git a/teshsuite/java/sleep_host_off/sleep_host_off_d.xml b/teshsuite/java/SleepHostOff/sleep_host_off_d.xml similarity index 100% rename from teshsuite/java/sleep_host_off/sleep_host_off_d.xml rename to teshsuite/java/SleepHostOff/sleep_host_off_d.xml diff --git a/teshsuite/java/semaphore/CMakeLists.txt b/teshsuite/java/semaphore/CMakeLists.txt deleted file mode 100644 index 48c31971fc..0000000000 --- a/teshsuite/java/semaphore/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(example java_semaphore_gc) -set(sources ${CMAKE_CURRENT_SOURCE_DIR}/SemaphoreGC.java) - -if(enable_java) - add_custom_command( - COMMENT "Building ${example}..." - OUTPUT ${example}_compiled - DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} - COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} - COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled - COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled - ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) - - ADD_TESH(tesh-java-semaphore-gc --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java ${CMAKE_HOME_DIRECTORY}/teshsuite/java/semaphore/semaphore_gc.tesh) -endif() - -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/semaphore_gc.tesh PARENT_SCOPE) -set(examples_src ${examples_src} ${sources} PARENT_SCOPE) diff --git a/teshsuite/java/sleep_host_off/CMakeLists.txt b/teshsuite/java/sleep_host_off/CMakeLists.txt deleted file mode 100644 index daad89c843..0000000000 --- a/teshsuite/java/sleep_host_off/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(example java_sleep_host_off) -set(sources ${CMAKE_CURRENT_SOURCE_DIR}/SleepHostOff.java) - -if(enable_java) - add_custom_command( - COMMENT "Building ${example}..." - OUTPUT ${example}_compiled - DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} - COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} - COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled - COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled - ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) - - ADD_TESH(tesh-java-sleep-host-off --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java ${CMAKE_HOME_DIRECTORY}/teshsuite/java/sleep_host_off/sleep_host_off.tesh) -endif() - -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/sleep_host_off.tesh PARENT_SCOPE) -set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/sleep_host_off_d.xml PARENT_SCOPE) -set(examples_src ${examples_src} ${sources} PARENT_SCOPE) diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 800f58b9f7..03e3779262 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -1022,8 +1022,7 @@ set(CMAKEFILES_TXT examples/smpi/energy/f90/CMakeLists.txt teshsuite/bug-17132/CMakeLists.txt - teshsuite/java/semaphore/CMakeLists.txt - teshsuite/java/sleep_host_off/CMakeLists.txt + teshsuite/java/CMakeLists.txt teshsuite/mc/CMakeLists.txt teshsuite/mc/dwarf/CMakeLists.txt teshsuite/mc/dwarf_expression/CMakeLists.txt -- 2.20.1