Skip to contentSkip to conversation

cr_tests: epoll: Factor out common parts

PATCH In review Matt Helsley 1 participant 1 message Oct 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 4/7 cr_tests: epoll: Factor out common parts

Factor out the common label, log, and print functions so that the meat of the testcases is more apparent. Make the run.sh script use this common structure to print INFO and try checkpointing at more interesting points in the test programs.

---
 epoll/Makefile    |    7 ++-
 epoll/empty.c     |  120 +++++++++++++++++++++++++++++++++++++-----------
 epoll/libeptest.c |   65 ++++++++++++++++++++++++++
 epoll/libeptest.h |   83 +++++++++++++++++++++++++++++++++
 epoll/pipe.c      |  131 ++++-------------------------------------------------
 epoll/run.sh      |   56 +++++++++--------------
 6 files changed, 277 insertions(+), 185 deletions(-)
 create mode 100644 epoll/libeptest.c
 create mode 100644 epoll/libeptest.h
epoll/Makefile +5 -2
index f6cae7e..f701352 100644
@@ -1,6 +1,6 @@
 .PHONY: clean all
 
-LIBS := ../libcrtest/libcrtest.a
+LIBS := ../libcrtest/libcrtest.a ./libeptest.a
 CFLAGS := -Wall $(ARCHOPTS) -I../ -I../libcrtest
 
 PROGS=empty pipe
@@ -12,10 +12,13 @@ all: $(PROGS)
 ../libcrtest/libcrtest.a: ../libcrtest/libcrtest.h ../libcrtest/common.c
 	$(MAKE) -C ../libcrtest libcrtest.a
 
+libeptest.a: libeptest.o libeptest.h
+	ar cr libeptest.a libeptest.o
+
 $(PROGS): %: %.c $(LIBS)
 	gcc -Wall $(CFLAGS) -o $@ $< $(LIBS)
 
 clean:
-	rm -f $(PROGS)
+	rm -f $(PROGS) libeptest.[ao]
 	rm -rf log.* checkpoint-*
 	$(MAKE) -C ../libcrtest clean
epoll/empty.c +92 -28

160 lines not on this page · raw message

epoll/libeptest.c new file +65 -0

65 lines not on this page · raw message

epoll/libeptest.h new file +83 -0

83 lines not on this page · raw message

epoll/pipe.c +10 -121

154 lines not on this page · raw message

epoll/run.sh +22 -34

99 lines not on this page · raw message

Signature · 1 line
1.5.6.3