Only expect output for a whitelist of binaries

This commit is contained in:
Jeremy Soller
2018-03-11 21:04:53 -06:00
parent 7c13ec153e
commit 41e552b696
7 changed files with 14 additions and 15 deletions
+14 -9
View File
@@ -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}`; \
View File
-2
View File
@@ -1,2 +0,0 @@
malloc 0x560fde600618
calloc 0x560fde600618
View File
-1
View File
@@ -1 +0,0 @@
egid: 1000, euid: 1000, gid: 1000, pgid: 31979, pid: 32027, ppid 31982, uid 1000
View File
-3
View File
@@ -1,3 +0,0 @@
32050 belongs to process group 32050
32050 has egid 1000 and gid 1000
32050 has euid 1000 and uid 1000