aboutsummaryrefslogtreecommitdiff
path: root/opt
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-07-01 06:16:52 -0300
committerEuAndreh <eu@euandre.org>2023-07-01 06:20:05 -0300
commitbb219905099497f86c3c417cd48df702533410c8 (patch)
tree5199a2142793c3fca917a37c2cb664d813345033 /opt
parentMakefile: Run opt checks individually (diff)
downloaddotfiles-bb219905099497f86c3c417cd48df702533410c8.tar.gz
dotfiles-bb219905099497f86c3c417cd48df702533410c8.tar.xz
opt/tests/uninclude.sh: Fix C file extension
Diffstat (limited to 'opt')
-rw-r--r--opt/resources/can-remove-stdbool.copy.c.expected (renamed from opt/resources/can-remove-stdbool.copy.expected)0
-rw-r--r--opt/resources/nothing-can-be-removed.copy.c.expected (renamed from opt/resources/nothing-can-be-removed.copy.expected)0
-rwxr-xr-xopt/tests/uninclude.sh9
3 files changed, 5 insertions, 4 deletions
diff --git a/opt/resources/can-remove-stdbool.copy.expected b/opt/resources/can-remove-stdbool.copy.c.expected
index f3da0d3..f3da0d3 100644
--- a/opt/resources/can-remove-stdbool.copy.expected
+++ b/opt/resources/can-remove-stdbool.copy.c.expected
diff --git a/opt/resources/nothing-can-be-removed.copy.expected b/opt/resources/nothing-can-be-removed.copy.c.expected
index 773852f..773852f 100644
--- a/opt/resources/nothing-can-be-removed.copy.expected
+++ b/opt/resources/nothing-can-be-removed.copy.c.expected
diff --git a/opt/tests/uninclude.sh b/opt/tests/uninclude.sh
index 0a5d41e..28e0152 100755
--- a/opt/tests/uninclude.sh
+++ b/opt/tests/uninclude.sh
@@ -1,13 +1,14 @@
#!/bin/sh
set -eu
-find opt/resources/ -name '*.c' | sed 's/^\(.*\)\.c$/cp \1.c \1.copy/g' | sh
+find opt/resources/ -name '*.copy.c' -exec rm {} ';'
+find opt/resources/ -name '*.c' | sed 's/^\(.*\)\.c$/cp \1.c \1.copy\.c/g' | sh
# shellcheck disable=2086
-find opt/resources/ -name '*.copy' |
+find opt/resources/ -name '*.copy.c' |
uninclude -E '^#include ' -- $CC $CFLAGS -c
-find opt/resources/ -name '*.copy' | while read -r file; do
+find opt/resources/ -name '*.copy.c' | while read -r file; do
if ! cmp -s "$file" "$file".expected; then
cat <<-EOF
The unincluded file is different from expected.
@@ -19,4 +20,4 @@ find opt/resources/ -name '*.copy' | while read -r file; do
fi
done
-rm -f a.out
+rm -f -- *.o