From: Michael Orlitzky Date: Wed, 15 Aug 2012 00:21:30 +0000 (-0400) Subject: Add a 'test' makefile target. X-Git-Tag: v0.0.1~14 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=60f8c02626369db69769474307a95caf61ec3d81;p=apply-default-acl.git Add a 'test' makefile target. Fix the group execute removal so that the last test passes. Add a new test. --- diff --git a/makefile b/makefile index ffe3a9e..ae7d943 100644 --- a/makefile +++ b/makefile @@ -12,6 +12,11 @@ OBJS := $(patsubst %.c, %.o, $(SOURCES)) aclq: $(OBJS) $(CC) $(CFLAGS) $(LIBS) -o $@ $^ +.PHONY: clean test + clean: rm -f $(OBJS) rm -f aclq + +test: + ./run-tests.sh diff --git a/run-tests.sh b/run-tests.sh index a5f7692..75414ca 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -9,7 +9,7 @@ TESTDIR=test acl_reset() { # Remove any ACLs on our test directory and remove its contents. setfacl --remove-all --recursive "$TESTDIR" - rm -f "${TESTDIR}"/* + rm -rf "${TESTDIR}"/* } compare() { @@ -92,3 +92,27 @@ EOF ACTUAL=`getfacl --omit-header "${TARGET}"` compare + +# Same test as before except with a directory. +setfacl -d -m group:mail:rwx "${TESTDIR}" +mkdir "${TARGET}" +chmod 755 "${TARGET}" +./aclq "${TARGET}" + +EXPECTED=$(cat <