Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : rename file mc_dfs -> mc_liveness
[simgrid.git] / tools / tesh / setenv.tesh
1 #! ./tesh
2 # This suite builds and uses a program returning 1.
3 # tesh is instructed of this return code and must not whine.
4
5 $ rm -rf temp_testdir-setenv
6 $ mkdir temp_testdir-setenv
7
8 $ cd temp_testdir-setenv
9
10 < #include <string.h>
11 < #include <stdio.h>
12 < extern char **environ;
13 < int main(void) {
14 <   char **env_iter=environ;
15 <   while (*env_iter) {
16 <     if (!strncmp(*env_iter,"tesh_test_toto=",strlen("tesh_test_toto=")))
17 <       printf("%s\n",*env_iter);
18 <     env_iter++;
19 <   }
20 <   return 0;
21 < }
22 $ mkfile getenv.c
23
24 $ gcc -o getenv getenv.c -g
25
26 ! setenv tesh_test_toto=blah
27 $ ./getenv
28 > tesh_test_toto=blah
29
30 $ cd ..
31 $ rm -rf temp_testdir-setenv