Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate tests/testsetup.sh @ 649:4ee9a8042f4a
common.subr: _get_jail_from_path() now just returns when the jail is dying.
But it prints the name of the jail if it is yet dying.
Real error reporting must not consistently be done in the caller.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 27 Sep 2024 21:21:34 +0200 |
| parents | 45c47bc1f7d2 |
| children | 33df05108ba1 |
| rev | line source |
|---|---|
|
583
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
1 #!/bin/sh |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
2 # |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
3 # Test helpers for the shell unittests using cram. |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
4 # |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
5 |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
6 #: |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
7 #: Check that no global variables that hold any array storage are left. |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
8 #: |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
9 #: Returns: |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
10 #: int: 0 if no unexpected storage is left, 1 otherwise |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
11 #: |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
12 check_no_array_artifacts() { |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
13 # _farr_A_ is the storage prefix for arrays |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
14 if set | grep -E -e '^_farr_A_.*='; then |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
15 return 1 |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
16 else |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
17 return 0 |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
18 fi |
|
55c024c809ca
Begin unittests for farray.sh using "cram"
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
19 } |
|
604
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
20 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
21 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
22 #: |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
23 #: Check that no global variables that hold any alist storage are left. |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
24 #: |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
25 #: Returns: |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
26 #: int: 0 if no unexpected storage is left, 1 otherwise |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
27 #: |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
28 check_no_alist_artifacts() { |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
29 # This are all _farr_alist_XXX_prefix variables |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
30 if set | grep -E -e '^_farr_KV_.*=' -e '^_farr_K_.*=' -e '^_farr_V_.*='; then |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
31 return 1 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
32 else |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
33 return 0 |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
34 fi |
|
45c47bc1f7d2
farray.sh: Moved all currently existing tests for alists into cram tests.
Franz Glasner <fzglas.hg@dom66.de>
parents:
583
diff
changeset
|
35 } |
