diff options
| -rw-r--r-- | opt/resources/can-remove-stdbool.copy.expected (renamed from opt/resources/can-remove-stdbool.c.expected) | 0 | ||||
| -rw-r--r-- | opt/resources/nothing-can-be-removed.copy.expected (renamed from opt/resources/nothing-can-be-removed.c.expected) | 0 | ||||
| -rwxr-xr-x | opt/tests/uninclude.sh | 11 |
3 files changed, 5 insertions, 6 deletions
diff --git a/opt/resources/can-remove-stdbool.c.expected b/opt/resources/can-remove-stdbool.copy.expected index f3da0d3..f3da0d3 100644 --- a/opt/resources/can-remove-stdbool.c.expected +++ b/opt/resources/can-remove-stdbool.copy.expected diff --git a/opt/resources/nothing-can-be-removed.c.expected b/opt/resources/nothing-can-be-removed.copy.expected index 773852f..773852f 100644 --- a/opt/resources/nothing-can-be-removed.c.expected +++ b/opt/resources/nothing-can-be-removed.copy.expected diff --git a/opt/tests/uninclude.sh b/opt/tests/uninclude.sh index bb11f05..0a5d41e 100755 --- a/opt/tests/uninclude.sh +++ b/opt/tests/uninclude.sh @@ -1,12 +1,13 @@ #!/bin/sh +set -eu -git restore opt/resources/ +find opt/resources/ -name '*.c' | sed 's/^\(.*\)\.c$/cp \1.c \1.copy/g' | sh # shellcheck disable=2086 -find opt/resources/ -name '*.c' | - sh ~/.usr/bin/uninclude -E '^#include ' -- cc $CFLAGS +find opt/resources/ -name '*.copy' | + uninclude -E '^#include ' -- $CC $CFLAGS -c -find opt/resources/ -name '*.c' | while read -r file; do +find opt/resources/ -name '*.copy' | while read -r file; do if ! cmp -s "$file" "$file".expected; then cat <<-EOF The unincluded file is different from expected. @@ -15,8 +16,6 @@ find opt/resources/ -name '*.c' | while read -r file; do $ diff -U5 $file.expected $file EOF exit 1 - else - git restore "$file" fi done |
