Start the server when testing and close after finished.

This commit is contained in:
tim.schubert@tu-bs.de 2016-10-30 02:05:06 +02:00
parent c427beca1c
commit 85eb4556e5

View file

@ -4,11 +4,13 @@ all: $(FILE) tests
.PHONY: clean
clean:
rm netcalc test/results
rm $(FILE) netcalc test/results test/$(FILE).pid
$(FILE): $(FILE).c
gcc $^ -o $@
tests:
./netcalc -c < test/cases > test/results
tests: $(FILE)
./$(FILE) & echo $$! > test/$(FILE).pid
./$(FILE) -c < test/cases > test/results
kill `cat test/$(FILE).pid`
diff test/results test/expected