From 41e552b696ff9a082ec1b30a42fbe0f2798062f6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:04:53 -0600 Subject: [PATCH] Only expect output for a whitelist of binaries --- tests/Makefile | 23 ++++++++++++++--------- tests/expected/alloc.stderr | 0 tests/expected/alloc.stdout | 2 -- tests/expected/getid.stderr | 0 tests/expected/getid.stdout | 1 - tests/expected/setid.stderr | 0 tests/expected/setid.stdout | 3 --- 7 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 tests/expected/alloc.stderr delete mode 100644 tests/expected/alloc.stdout delete mode 100644 tests/expected/getid.stderr delete mode 100644 tests/expected/getid.stdout delete mode 100644 tests/expected/setid.stderr delete mode 100644 tests/expected/setid.stdout diff --git a/tests/Makefile b/tests/Makefile index 8a626402c0..1feb14bb75 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,5 @@ -BINS=\ - alloc \ +# Binaries that should generate the same output every time +EXPECT_BINS=\ atof \ atoi \ brk \ @@ -13,14 +13,12 @@ BINS=\ fcntl \ fsync \ ftruncate \ - getid \ link \ math \ mem \ pipe \ printf \ rmdir \ - setid \ sleep \ sprintf \ stdlib/strtol \ @@ -33,32 +31,39 @@ BINS=\ unlink \ write +# Binaries that may generate varied output +BINS=\ + $(EXPECT_BINS) \ + alloc \ + getid \ + setid + all: $(BINS) clean: rm -f $(BINS) *.out run: $(BINS) - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ "./$${bin}" test args; \ done -expected: $(BINS) +expected: $(EXPECT_BINS) rm -rf expected mkdir -p expected - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ mkdir -p expected/`dirname $${bin}`; \ "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; \ done -verify: $(BINS) +verify: $(EXPECT_BINS) rm -rf gen mkdir -p gen - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ mkdir -p gen/`dirname $${bin}`; \ diff --git a/tests/expected/alloc.stderr b/tests/expected/alloc.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/alloc.stdout b/tests/expected/alloc.stdout deleted file mode 100644 index e6f5022ade..0000000000 --- a/tests/expected/alloc.stdout +++ /dev/null @@ -1,2 +0,0 @@ -malloc 0x560fde600618 -calloc 0x560fde600618 diff --git a/tests/expected/getid.stderr b/tests/expected/getid.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/getid.stdout b/tests/expected/getid.stdout deleted file mode 100644 index 5ef0956cf2..0000000000 --- a/tests/expected/getid.stdout +++ /dev/null @@ -1 +0,0 @@ -egid: 1000, euid: 1000, gid: 1000, pgid: 31979, pid: 32027, ppid 31982, uid 1000 diff --git a/tests/expected/setid.stderr b/tests/expected/setid.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/setid.stdout b/tests/expected/setid.stdout deleted file mode 100644 index 269cd844e6..0000000000 --- a/tests/expected/setid.stdout +++ /dev/null @@ -1,3 +0,0 @@ -32050 belongs to process group 32050 -32050 has egid 1000 and gid 1000 -32050 has euid 1000 and uid 1000