Explorar o código

Better such tests than none

Piotr Czajkowski %!s(int64=4) %!d(string=hai) anos
pai
achega
19ac79baa5
Modificáronse 2 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      makefile
  2. BIN=BIN
      testFiles/input.docx

+ 7 - 0
makefile

@@ -8,4 +8,11 @@ anonymize: $(objects)
 clean:
 	rm *.o
 
+test: anonymize
+	@./anonymize testFiles/input.docx testFiles/output.docx
+	@cmp testFiles/input.docx testFiles/output.docx -s ; if [ $$? -eq 0 ] ; then echo "FAILURE: Files should differ after anonymizing!"; exit 1; fi
+	@./anonymize testFiles/output.docx -d
+	@cmp testFiles/input.docx testFiles/output.docx -s ; if [ $$? -eq 0 ] ; then echo "OK"; else echo "FAILURE: Files should be the same after de-anonymizing!"; fi
+	@rm testFiles/output.docx
+
 default: anonymize

BIN=BIN
testFiles/input.docx