Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Shell script to generate a simple tesh file
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 28 Jul 2014 12:39:54 +0000 (14:39 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 28 Jul 2014 12:39:54 +0000 (14:39 +0200)
buildtools/Cmake/DefinePackages.cmake
tools/tesh/generate_tesh [new file with mode: 0755]

index 38c3add..e3eeaf5 100644 (file)
@@ -127,6 +127,7 @@ set(EXTRA_DIST
   src/xbt/win32_ucontext.c
   tools/tesh/run_context.h
   tools/tesh/tesh.h
+  tools/tesh/generate_tesh
   examples/smpi/mc/non_deterministic.tesh
   examples/smpi/mc/send_deterministic.tesh
   )
diff --git a/tools/tesh/generate_tesh b/tools/tesh/generate_tesh
new file mode 100755 (executable)
index 0000000..23ec028
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Generate a tesh file from a given command (simple case).
+
+command="$1"
+output=$(sh -c "$command" 2>&1)
+return=$?
+
+tesh="#! ./tesh
+
+! expect return $return
+$ $command
+$(echo "$output" | sed 's/^/> /' )
+"
+
+echo "$tesh"
+echo "$tesh" | tesh 1>&2