forked from evalEmpire/y2038
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (52 loc) · 2.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY : test bench clean tap_tests localtime_tests
OPTIMIZE = -g
WARNINGS = -W -Wall -ansi -pedantic -Wno-long-long -Wextra -Wdeclaration-after-statement -Wendif-labels -Wconversion -Wcast-qual -Wwrite-strings
INCLUDE = -I.
CFLAGS = $(WARNINGS) $(OPTIMIZE) $(INCLUDE)
TIME64_OBJECTS = time64.o
all : bin/check_max
bin/check_max : $(TIME64_OBJECTS) time64_config.h
time64.o : time64_config.h time64_limits.h time64.h Makefile
bench : t/bench t/bench_system
time t/bench_system
time t/bench
t/bench t/bench_system : $(TIME64_OBJECTS)
t/localtime_test : $(TIME64_OBJECTS)
t/gmtime_test : $(TIME64_OBJECTS)
BLACKBOX_TESTS = t/year_limit.t \
t/negative.t \
t/overflow.t \
t/timegm.t \
t/gmtime64.t \
t/mktime64.t \
t/asctime64.t \
t/ctime64.t
GLASSBOX_TESTS = t/safe_year.t \
t/seconds_between_years.t
$(BLACKBOX_TESTS) : t/tap.c t/tap.h $(TIME64_OBJECTS)
$(GLASSBOX_TESTS) : t/tap.c t/tap.h
test : tap_tests localtime_tests
localtime_tests: t/localtime_test t/gmtime_test
@which bzdiff > /dev/null || (echo 'You need bzdiff to run these tests'; exit 1)
@which less > /dev/null || (echo 'You need less to run these tests'; exit 1)
@echo "On failure, these tests will produce a diff between the failed and expected results. If they pass they'll be quiet."
TZ=Canada/Eastern t/gmtime_test | bzip2 -9 > t/gmtime_test.out.bz2
bzdiff -u t/gmtime_test.out.bz2 t/gmtime.out.bz2 | less -F
TZ=Canada/Eastern t/localtime_test | bzip2 -9 > t/eastern_test.out.bz2
bzdiff -u t/eastern_test.out.bz2 t/eastern.out.bz2 | less -F
TZ=Australia/West t/localtime_test | bzip2 -9 > t/oz_test.out.bz2
bzdiff -u t/oz_test.out.bz2 t/oztime.out.bz2 | less -F
tap_tests: $(BLACKBOX_TESTS) $(GLASSBOX_TESTS)
@which prove > /dev/null || (echo 'You need prove (from the Test::Harness perl module) to run these tests'; exit 1)
@prove --exec '' t/*.t
clean:
-rm t/*.t \
t/localtime_test \
t/gmtime_test \
t/*_test.out.bz2 \
t/bench \
t/bench_system \
*.o
-rm -rf t/*.dSYM/ \
bin/*.dSYM/ \
*.dSYM/