Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the directory to the directory defined by the variable teshexample_dir. If...
[simgrid.git] / tools / tesh2 / examples / catch-signal.tesh
index 874155d..c2e425d 100644 (file)
@@ -1,23 +1,29 @@
-#! ./tesh\r
-# This suite builds and uses a program raising a segfault, ie a program dying\r
-# of SIGSEV. 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
-<   char *A=NULL;\r
-<   *A = 1;\r
-< }\r
-$ Cat > segfault.c\r
-\r
-$ gcc -o segfault segfault.c\r
-\r
-! expect return $EUNXPSIG\r
-< $ ./segfault\r
-$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"\r
-\r
-$ cd ..\r
-$ rm -rf temp_testdir\r
+#! ./tesh
+# This suite builds and uses a program raising a segfault, ie a program dying
+# of SIGSEV. tesh must detect this condition and report the issue.
+
+$ rm -rf temp_testdir
+$ mkdir temp_testdir
+
+$ cd temp_testdir
+< #include <stdlib.h>
+< int main(void) {
+<   char *A=NULL;
+<   *A = 1;
+< }
+$ cat > segfault.c
+
+$ gcc -o segfault segfault.c
+
+! expect return $EUNXPSIG
+< $ ./segfault
+$ ../tesh --log="log.thresh:info tesh.fmt:%m%n"
+> Test unit from stdin
+> [stdin:1] ./segfault
+> [stdin:1] `./segfault' : NOK (unexpected signal `SIGSEGV' caught)
+> Output of <stdin:1> so far: 
+> ||
+> Test unit `stdin': NOK (<stdin:1> unexpected signal caught)
+
+$ cd ..
+$ rm -rf temp_testdir