summaryrefslogtreecommitdiff
path: root/tests/assert-identical.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/assert-identical.sh')
-rwxr-xr-xtests/assert-identical.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/assert-identical.sh b/tests/assert-identical.sh
new file mode 100755
index 0000000..1a25f62
--- /dev/null
+++ b/tests/assert-identical.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -eu
+
+NAME='tweetnacl'
+CFLAGS='-O3 -s'
+
+trap "rm -f tests/resources/impl.c src/impl.cmp.o tests/resources/impl.cmp.o" \
+ EXIT
+
+(
+cd src/
+gcc $CFLAGS -o impl.cmp.o -c impl.c
+strip impl.cmp.o
+) &
+
+(
+cd tests/resources/
+cp "$NAME".c impl.c
+gcc $CFLAGS -o impl.cmp.o -c impl.c
+strip impl.cmp.o
+) &
+
+wait
+
+cmp tests/resources/impl.cmp.o src/impl.cmp.o