Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the new integrated files version (use xbt data structures instead my own data...
[simgrid.git] / tools / tesh2 / examples / catch-return.tesh
diff --git a/tools/tesh2/examples/catch-return.tesh b/tools/tesh2/examples/catch-return.tesh
new file mode 100644 (file)
index 0000000..f42bdb6
--- /dev/null
@@ -0,0 +1,22 @@
+#! ./tesh\r
+# This suite builds and uses a program returning 1.\r
+# tesh must detect this condition and report the issue.\r
+\r
+$ rm -rf temp_testdir\r
+$ mkdir temp_testdir\r
+\r
+$ cd temp_testdir\r
+< #include <stdlib.h>\r
+< int main(void) {\r
+<   exit(1);\r
+< }\r
+$ Cat > return1.c\r
+\r
+$ gcc -o return1 return1.c\r
+\r
+! expect return $EEXITCODENOTMATCH\r
+< $ ./return1\r
+$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"\r
+\r
+$ cd ..\r
+$ rm -rf temp_testdir\r