Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / tools / tesh / background.tesh
index 359d2a5..3ef568e 100644 (file)
@@ -1,56 +1,25 @@
+! output ignore
+$ cmake -E remove bgtesh.pl bgtesh.data
 
-$ rm -rf temp_testdir_background
-$ mkdir temp_testdir_background
-$ cd temp_testdir_background
-
-< #include <unistd.h>
-< #include <stdlib.h>
-< #include <stdio.h>
-< #include <sys/types.h>
-< #include <sys/stat.h>
-< #include <fcntl.h>
-< #ifdef WIN32 
-<   #include "windows.h"
-< #endif
-<                   
-< int main() {
-<   char buff[2048];
-<   int got;
-<   int in;
+< use strict; 
+< sleep(1);
+< open (FILE, "<bgtesh.data") || die "Cannot open bgtesh.data: $!\n";
 < 
-< #ifndef WIN32 
-<   sleep(1);
-< #else
-<   Sleep(1000);
-< #endif
-<   in = open("tmp_fich",O_RDONLY|O_CREAT);
-<   if (in == -1) {
-<     perror("Cannot open tmp_fich: ");
-<     exit(1);
-<   }
-<   while ((got = read(in,&buff,2048))>0) {
-<      int w = write(1,&buff,got);
-<      if (w<0) {
-<        perror("Error while writing:");
-<        exit(1);
-<      }
-<   }
-<   if (got < 0) {
-<     perror("Error while reading:");
-<     exit(1);
-<   }
-<   return 0;
+< while (<FILE>) {
+<   print;
 < }
-$ mkfile delayed_cat.c
-
-$ gcc -Wall -o delayed_cat delayed_cat.c
+< close(FILE);
+< exit 0;
+<
+$ mkfile bgtesh.pl
 
-& ./delayed_cat
+& perl bgtesh.pl
 > TOTO
 
 < TOTO
-$ mkfile tmp_fich
+$ mkfile bgtesh.data
 
 $ sleep 2
-$ cd ..
-$ rm -rf temp_testdir_background
+
+! output ignore
+$ cmake -E remove bgtesh.pl bgtesh.data