diff options
| author | peter <peter@pmikkelsen.com> | 2026-09-05 07:22:31 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-09-05 07:22:31 +0000 |
| commit | 58beb0bc9236234a697a3619c5023100a9574a59 (patch) | |
| tree | 09078526487e37b000fcfc5305e1967cece90050 /tests | |
| parent | 91ddaf36c86658b852f31dbaa7c1e96a980315c4 (diff) | |
Full coverage of bin/main.c
FossilOrigin-Name: 91deb642cded69b6c480471147004489a6072ec7c6603286aa6c0ebfc75bf030
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/scripts/bad/2.sh | 2 | ||||
| -rwxr-xr-x | tests/scripts/bad/3.sh | 2 | ||||
| -rwxr-xr-x | tests/scripts/bad/4.aplwc | 1 | ||||
| -rwxr-xr-x | tests/scripts/bad/4.sh | 3 | ||||
| -rwxr-xr-x | tests/scripts/bad/5.sh | 3 | ||||
| -rwxr-xr-x | tests/scripts/bad/6.sh | 4 | ||||
| -rwxr-xr-x | tests/scripts/bad/7.sh | 4 | ||||
| -rwxr-xr-x | tests/scripts/memfail.sh | 16 | ||||
| -rwxr-xr-x | tests/scripts/simfail.sh | 16 |
9 files changed, 33 insertions, 18 deletions
diff --git a/tests/scripts/bad/2.sh b/tests/scripts/bad/2.sh index 03db180..73321be 100755 --- a/tests/scripts/bad/2.sh +++ b/tests/scripts/bad/2.sh @@ -1,3 +1,3 @@ #!/bin/sh -aplwc-repl -? +aplwc-repl -x -? diff --git a/tests/scripts/bad/3.sh b/tests/scripts/bad/3.sh index 55b2735..ff0e033 100755 --- a/tests/scripts/bad/3.sh +++ b/tests/scripts/bad/3.sh @@ -1,3 +1,3 @@ #!/bin/sh -aplwc-repl some-file-which-does-not-exist +aplwc-repl -x some-file-which-does-not-exist diff --git a/tests/scripts/bad/4.aplwc b/tests/scripts/bad/4.aplwc new file mode 100755 index 0000000..af9da70 --- /dev/null +++ b/tests/scripts/bad/4.aplwc @@ -0,0 +1 @@ +#!/usr/bin/env aplwc-repl
\ No newline at end of file diff --git a/tests/scripts/bad/4.sh b/tests/scripts/bad/4.sh new file mode 100755 index 0000000..0c48eaf --- /dev/null +++ b/tests/scripts/bad/4.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +aplwc-repl -x f1 f2 diff --git a/tests/scripts/bad/5.sh b/tests/scripts/bad/5.sh new file mode 100755 index 0000000..8411e21 --- /dev/null +++ b/tests/scripts/bad/5.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +aplwc-repl -x /dev/stdin diff --git a/tests/scripts/bad/6.sh b/tests/scripts/bad/6.sh new file mode 100755 index 0000000..2d9a94c --- /dev/null +++ b/tests/scripts/bad/6.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +export APLWC_SIMULATE_FAILURE_PRINT_COUNT=1 +aplwc-repl -x 3>&- diff --git a/tests/scripts/bad/7.sh b/tests/scripts/bad/7.sh new file mode 100755 index 0000000..189a5f0 --- /dev/null +++ b/tests/scripts/bad/7.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +export APLWC_SIMULATE_FAILURE_AT=100 +aplwc-repl -x /dev/stdin diff --git a/tests/scripts/memfail.sh b/tests/scripts/memfail.sh deleted file mode 100755 index c0076d1..0000000 --- a/tests/scripts/memfail.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -export APLWC_ALLOC_FAIL_AFTER=-1 -N=$($1 3>&1 1>/dev/null 2>/dev/null) -n=0 - -while [ "$n" -le "$N" ] -do - echo $n out of $N - export APLWC_ALLOC_FAIL_AFTER=$n - $1 1>/dev/null 2>/dev/null - - n=$((n + 1)) -done diff --git a/tests/scripts/simfail.sh b/tests/scripts/simfail.sh new file mode 100755 index 0000000..fe64a25 --- /dev/null +++ b/tests/scripts/simfail.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +export APLWC_SIMULATE_FAILURE_PRINT_COUNT=1 +N=$($1 3>&1 1>/dev/null 2>/dev/null) +n=1 +export APLWC_SIMULATE_FAILURE_PRINT_COUNT=0 + +while [ "$n" -le "$N" ] +do + echo $n out of $N + export APLWC_SIMULATE_FAILURE_AT=$n + $1 #1>/dev/null 2>/dev/null + n=$((n + 1)) +done |