]> git.saurik.com Git - apple/libdispatch.git/blame - testing/Makefile
libdispatch-84.5.5.tar.gz
[apple/libdispatch.git] / testing / Makefile
CommitLineData
24954c79
A
1# No workie: dispatch_sema
2TESTS= 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
32all: harness summarize bench $(TESTS)
33 @lipo -remove x86_64 -output dispatch_timer_bit31 dispatch_timer_bit31 2>/dev/null || true
34
35logs: $(addsuffix .testlog, $(TESTS))
36debuglogs: $(addsuffix .debuglog, $(TESTS))
37
38testbots:
39 $(MAKE) test
40
41test: 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
50SRCS = dispatch_test.c
51OBJS = $(SRCS:%.c=%.o)
52ARCHS=i386 x86_64 ppc
53CFLAGS = -Werror -Wall -Wextra -Wshadow -mdynamic-no-pic -Os -g $(patsubst %, -arch %,$(ARCHS))
54CPPFLAGS = $(CFLAGS)
55LDFLAGS = $(patsubst %, -arch %,$(ARCHS))
56LDLIBS = -lstdc++
57
58ifneq ($(SDKROOT),)
59CFLAGS += -isysroot $(SDKROOT)
60LDFLAGS += -isysroot $(SDKROOT)
61CC = xcrun -sdk $(SDKROOT) gcc
62endif
63
64harness: harness.o $(OBJS)
65summarize: summarize.o
66bench: bench.o func.o
67 $(CC) $(LDFLAGS) -framework Foundation $(LDLIBS) -o $@ $^
68
69bench.o: bench.mm
70 $(CC) -x objective-c++ $(CFLAGS) -c $^ -o $@
71func.o: func.c
72 $(CC) -x c++ $(CFLAGS) -c $^ -o $@
73
74dispatch_apply: dispatch_apply.o $(OBJS)
75dispatch_api: dispatch_api.o $(OBJS)
76dispatch_c99: dispatch_c99.o $(OBJS)
77dispatch_cffd: dispatch_cffd.o $(OBJS)
78 $(CC) $(LDFLAGS) -framework CoreFoundation -o $@ $^
79dispatch_deadname: dispatch_deadname.o $(OBJS)
80dispatch_debug: dispatch_debug.o $(OBJS)
81dispatch_group: dispatch_group.o $(OBJS)
82dispatch_overcommit: dispatch_overcommit.o $(OBJS)
83dispatch_pingpong: dispatch_pingpong.o $(OBJS)
84dispatch_plusplus: dispatch_plusplus.o $(OBJS)
85dispatch_priority: dispatch_priority.o $(OBJS)
86dispatch_priority2: dispatch_priority2.o $(OBJS)
87dispatch_proc: dispatch_proc.o $(OBJS)
88queue_finalizer: queue_finalizer.o $(OBJS)
89dispatch_read: dispatch_read.o $(OBJS)
90dispatch_read2: dispatch_read2.o $(OBJS)
91dispatch_after: dispatch_after.o $(OBJS)
92dispatch_timer: dispatch_timer.o $(OBJS)
93dispatch_suspend_timer: dispatch_suspend_timer.o $(OBJS)
94dispatch_sema: dispatch_sema.o $(OBJS)
95dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
96dispatch_timer_bit63: dispatch_timer_bit63.o $(OBJS)
97dispatch_timer_oneshot: dispatch_timer_oneshot.o $(OBJS)
98dispatch_timer_set_time: dispatch_timer_set_time.o $(OBJS)
99dispatch_drift: dispatch_drift.o $(OBJS)
100dispatch_starfish: dispatch_starfish.o $(OBJS)
101dispatch_cascade: dispatch_cascade.o $(OBJS)
102dispatch_timer_bit31: dispatch_timer_bit31.o $(OBJS)
103dispatch_readsync: dispatch_readsync.o $(OBJS)
104ENVIRON_nsoperation = NOLEAKS=1
105nsoperation: nsoperation.o $(OBJS)
106 $(CC) $(LDFLAGS) -framework Foundation -o $@ $^
107
108dispatch_api.o: dispatch_api.c
109 $(CC) -c $(CFLAGS) -include $(SDKROOT)/usr/include/dispatch/dispatch.h -pendantic -o $@ $^
110
111dispatch_c99.o: dispatch_c99.c
112 $(CC) -c $(CFLAGS) -std=c99 -pedantic -o $@ $^
113
114dispatch_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
123clean-logs:
124 rm -f *.testlog *.debuglog *.leakslog
125
126clean: clean-logs
127 rm -f *.o *.dSYM bench harness summarize $(TESTS)