]> git.saurik.com Git - apple/libdispatch.git/blob - testing/Makefile
libdispatch-84.5.5.tar.gz
[apple/libdispatch.git] / testing / Makefile
1 # No workie: dispatch_sema
2 TESTS= dispatch_apply \
3 dispatch_api \
4 dispatch_c99 \
5 dispatch_cffd \
6 dispatch_deadname \
7 dispatch_debug \
8 queue_finalizer \
9 dispatch_group \
10 dispatch_overcommit \
11 dispatch_pingpong \
12 dispatch_plusplus \
13 dispatch_priority \
14 dispatch_priority2 \
15 dispatch_proc \
16 dispatch_read \
17 dispatch_read2 \
18 dispatch_after \
19 dispatch_timer \
20 dispatch_sema \
21 dispatch_suspend_timer \
22 dispatch_timer_bit31 \
23 dispatch_timer_bit63 \
24 dispatch_timer_oneshot \
25 dispatch_timer_set_time \
26 dispatch_starfish \
27 dispatch_cascade \
28 dispatch_drift \
29 dispatch_readsync \
30 nsoperation
31
32 all: harness summarize bench $(TESTS)
33 @lipo -remove x86_64 -output dispatch_timer_bit31 dispatch_timer_bit31 2>/dev/null || true
34
35 logs: $(addsuffix .testlog, $(TESTS))
36 debuglogs: $(addsuffix .debuglog, $(TESTS))
37
38 testbots:
39 $(MAKE) test
40
41 test: clean-logs
42 $(MAKE) _test
43
44 _test: all logs debuglogs
45 @cat *.testlog *.debuglog
46 @cat *.testlog *.debuglog | ./summarize
47
48 # Override ARCHS and SDKROOT to cross-build test suite
49
50 SRCS = dispatch_test.c
51 OBJS = $(SRCS:%.c=%.o)
52 ARCHS=i386 x86_64 ppc
53 CFLAGS = -Werror -Wall -Wextra -Wshadow -mdynamic-no-pic -Os -g $(patsubst %, -arch %,$(ARCHS))
54 CPPFLAGS = $(CFLAGS)
55 LDFLAGS = $(patsubst %, -arch %,$(ARCHS))
56 LDLIBS = -lstdc++
57
58 ifneq ($(SDKROOT),)
59 CFLAGS += -isysroot $(SDKROOT)
60 LDFLAGS += -isysroot $(SDKROOT)
61 CC = xcrun -sdk $(SDKROOT) gcc
62 endif
63
64 harness: harness.o $(OBJS)
65 summarize: summarize.o
66 bench: bench.o func.o
67 $(CC) $(LDFLAGS) -framework Foundation $(LDLIBS) -o $@ $^
68
69 bench.o: bench.mm
70 $(CC) -x objective-c++ $(CFLAGS) -c $^ -o $@
71 func.o: func.c
72 $(CC) -x c++ $(CFLAGS) -c $^ -o $@
73
74 dispatch_apply: dispatch_apply.o $(OBJS)
75 dispatch_api: dispatch_api.o $(OBJS)
76 dispatch_c99: dispatch_c99.o $(OBJS)
77 dispatch_cffd: dispatch_cffd.o $(OBJS)
78 $(CC) $(LDFLAGS) -framework CoreFoundation -o $@ $^
79 dispatch_deadname: dispatch_deadname.o $(OBJS)
80 dispatch_debug: dispatch_debug.o $(OBJS)
81 dispatch_group: dispatch_group.o $(OBJS)
82 dispatch_overcommit: dispatch_overcommit.o $(OBJS)
83 dispatch_pingpong: dispatch_pingpong.o $(OBJS)
84 dispatch_plusplus: dispatch_plusplus.o $(OBJS)
85 dispatch_priority: dispatch_priority.o $(OBJS)
86 dispatch_priority2: dispatch_priority2.o $(OBJS)
87 dispatch_proc: dispatch_proc.o $(OBJS)
88 queue_finalizer: queue_finalizer.o $(OBJS)
89 dispatch_read: dispatch_read.o $(OBJS)
90 dispatch_read2: dispatch_read2.o $(OBJS)
91 dispatch_after: dispatch_after.o $(OBJS)
92 dispatch_timer: dispatch_timer.o $(OBJS)
93 dispatch_suspend_timer: dispatch_suspend_timer.o $(OBJS)
94 dispatch_sema: dispatch_sema.o $(OBJS)
95 dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
96 dispatch_timer_bit63: dispatch_timer_bit63.o $(OBJS)
97 dispatch_timer_oneshot: dispatch_timer_oneshot.o $(OBJS)
98 dispatch_timer_set_time: dispatch_timer_set_time.o $(OBJS)
99 dispatch_drift: dispatch_drift.o $(OBJS)
100 dispatch_starfish: dispatch_starfish.o $(OBJS)
101 dispatch_cascade: dispatch_cascade.o $(OBJS)
102 dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
103 dispatch_readsync: dispatch_readsync.o $(OBJS)
104 ENVIRON_nsoperation = NOLEAKS=1
105 nsoperation: nsoperation.o $(OBJS)
106 $(CC) $(LDFLAGS) -framework Foundation -o $@ $^
107
108 dispatch_api.o: dispatch_api.c
109 $(CC) -c $(CFLAGS) -include $(SDKROOT)/usr/include/dispatch/dispatch.h -pendantic -o $@ $^
110
111 dispatch_c99.o: dispatch_c99.c
112 $(CC) -c $(CFLAGS) -std=c99 -pedantic -o $@ $^
113
114 dispatch_priority2.o: dispatch_priority.c
115 $(CC) -c $(CFLAGS) -DUSE_SET_TARGET_QUEUE=1 -o $@ $^
116
117 $(addsuffix .testlog, $(TESTS)): harness $(TESTS)
118 $(ENVIRON_$(basename $@)) ./harness ./$(basename $@) > $@
119
120 $(addsuffix .debuglog, $(TESTS)): harness $(TESTS)
121 $(ENVIRON_$(basename $@)) DYLD_IMAGE_SUFFIX=_debug ./harness ./$(basename $@) > $@
122
123 clean-logs:
124 rm -f *.testlog *.debuglog *.leakslog
125
126 clean: clean-logs
127 rm -f *.o *.dSYM bench harness summarize $(TESTS)