Skip to content
Snippets Groups Projects
Commit 9074c751 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- use shell tests instead makefile-tests, because lazy evaluation

parent 019494d5
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ SOURCES:=java/org/slub/rosetta/dps/repository/plugin/SLUBVirusCheckClamAVPlugin.
OBJS:=$(SOURCES:.java=.class)
JAR:=SLUBVirusCheckPlugin.jar
BUILD:=build/
SHELL=/bin/bash
all: $(BUILD) $(JAR)
......@@ -75,20 +76,12 @@ check_prerequisites:
test_eicar: $(OBJS)
@/usr/bin/java -cp $(CLASSPATH):$(JUNITCLASSPATH):java org.slub.rosetta.dps.repository.plugin.SLUBVirusCheckClamAVPlugin EICAR/eicar | grep -F 'SIGNATURE:' > $@
@echo -n "testing 'EICAR':"
ifeq "$(shell cat test_eicar)" "RESULT: 2 SIGNATURE: Eicar-Signature"
@echo pass;
else
@echo failed; exit 2;
endif
@if [[ "$$(cat test_eicar)" = "RESULT: 2 SIGNATURE: Eicar-Signature" ]]; then echo pass; else echo failed; exit 2;fi
test_novirus: $(OBJS)
@/usr/bin/java -cp $(CLASSPATH):$(JUNITCLASSPATH):java org.slub.rosetta.dps.repository.plugin.SLUBVirusCheckClamAVPlugin Makefile | grep -F 'SIGNATURE:' > $@
@echo -n "testing 'No virus': "
ifeq "$(shell cat test_novirus)" "RESULT: 0 SIGNATURE: "
@echo pass;
else
@echo fail; exit 2;
endif
@if [[ "$$(cat test_novirus)" = "RESULT: 0 SIGNATURE: " ]]; then echo pass; else echo fail; exit 2; fi
test: test_eicar test_novirus
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment