Quellcode durchsuchen

Source (do not run) TF_SETUP and TF_CLEANUP

Source the setup/cleanup code so that it can be used to prepare
environment.

Disadvantage is that the files will need to be in Bash (ie. effect of
commit 4eb772d is negated), but that should not be problem as the use
of subtest.sh already implies that Bash is used.

After all, one can always easily run other program from these files.
Alois Mahdal vor 10 Jahren
Ursprung
Commit
5ccb5a2c53
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2
    2
      test/README.md
  2. 2
    2
      test/include/subtest.sh

+ 2
- 2
test/README.md Datei anzeigen

134
 In short, it will
134
 In short, it will
135
 
135
 
136
  *  take each enumerated subtest from `tf_enum_subtests`,
136
  *  take each enumerated subtest from `tf_enum_subtests`,
137
- *  run TF_SETUP, if such file is found,
137
+ *  source TF_SETUP, if such file is found,
138
  *  translate te subtest name to a command,
138
  *  translate te subtest name to a command,
139
  *  launch the command,
139
  *  launch the command,
140
  *  run TF_CLEANUP, if such file is found,
140
  *  run TF_CLEANUP, if such file is found,
214
 ### Setup and cleanup ###
214
 ### Setup and cleanup ###
215
 
215
 
216
 Special files *TF_SETUP* and *TF_CLEANUP* (one of them or both) can be
216
 Special files *TF_SETUP* and *TF_CLEANUP* (one of them or both) can be
217
-added along with *TF_RUN*.  These will be execued before (*TF_SETUP*)
217
+added along with *TF_RUN*.  These will be sourced before (*TF_SETUP*)
218
 and after every subtest (*TF_CLEANUP*).
218
 and after every subtest (*TF_CLEANUP*).
219
 
219
 
220
 First, if any of these files are missing, it is considered as if the
220
 First, if any of these files are missing, it is considered as if the

+ 2
- 2
test/include/subtest.sh Datei anzeigen

27
     local tcmd=""           # test command
27
     local tcmd=""           # test command
28
     local setup=true        # setup function
28
     local setup=true        # setup function
29
     local cleanup=true      # cleanup command
29
     local cleanup=true      # cleanup command
30
-    test -f TF_SETUP   && setup="./TF_SETUP"
31
-    test -f TF_CLEANUP && cleanup="./TF_CLEANUP"
30
+    test -f TF_SETUP   && setup=". TF_SETUP"
31
+    test -f TF_CLEANUP && cleanup=". TF_CLEANUP"
32
     if $setup;
32
     if $setup;
33
     then
33
     then
34
         tcmd="$(tf_name2cmd $subtname)"
34
         tcmd="$(tf_name2cmd $subtname)"