Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
One CMakeLists for all java teshes
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 5 Mar 2016 20:58:47 +0000 (21:58 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sat, 5 Mar 2016 20:58:47 +0000 (21:58 +0100)
.gitignore
teshsuite/java/CMakeLists.txt [new file with mode: 0644]
teshsuite/java/SemaphoreGC/SemaphoreGC.java [moved from teshsuite/java/semaphore/SemaphoreGC.java with 98% similarity]
teshsuite/java/SemaphoreGC/SemaphoreGC.tesh [moved from teshsuite/java/semaphore/semaphore_gc.tesh with 66% similarity]
teshsuite/java/SleepHostOff/SleepHostOff.java [moved from teshsuite/java/sleep_host_off/SleepHostOff.java with 98% similarity]
teshsuite/java/SleepHostOff/SleepHostOff.tesh [moved from teshsuite/java/sleep_host_off/sleep_host_off.tesh with 83% similarity]
teshsuite/java/SleepHostOff/sleep_host_off_d.xml [moved from teshsuite/java/sleep_host_off/sleep_host_off_d.xml with 100% similarity]
teshsuite/java/semaphore/CMakeLists.txt [deleted file]
teshsuite/java/sleep_host_off/CMakeLists.txt [deleted file]
tools/cmake/DefinePackages.cmake

index a726a58..b921ea6 100644 (file)
@@ -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 (file)
index 0000000..322238f
--- /dev/null
@@ -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)
similarity index 98%
rename from teshsuite/java/semaphore/SemaphoreGC.java
rename to teshsuite/java/SemaphoreGC/SemaphoreGC.java
index 1dd871c..d8fb366 100644 (file)
@@ -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;
similarity index 66%
rename from teshsuite/java/semaphore/semaphore_gc.tesh
rename to teshsuite/java/SemaphoreGC/SemaphoreGC.tesh
index 41bc593..72e87a8 100644 (file)
@@ -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.
@@ -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;
@@ -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/semaphore/CMakeLists.txt b/teshsuite/java/semaphore/CMakeLists.txt
deleted file mode 100644 (file)
index 48c3197..0000000
+++ /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 (file)
index daad89c..0000000
+++ /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)
index 800f58b..03e3779 100644 (file)
@@ -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