1 # CODYlib -*- mode:Makefile -*-
2 # Copyright (C) 2019-2020 Nathan Sidwell, nathan@acm.org
6 TESTS := $(patsubst $(srcdir)/%.cc,%,\
7 $(wildcard $(srcdir)/tests/*/*.cc))
8 TESTDIRS = $(shell cd $(srcdir)/${<D} ; echo *(/))
9 testdir := $(and $(filter-out /%,$(srcdir)),../)$(srcdir)/tests
11 check:: tests/cody.defs $(TESTS)
12 +cd ${<D} && srcbuilddir=$(srcdir)/tests JOUST=${<F} \
13 $(ALOY) -t kratos -o cody -g $(testdir)/jouster $(TESTDIRS)
14 ifeq ($(firstword $(aloy)),:)
15 @echo WARNING: tests were not run as Joust test harness was not found
18 tests/cody.defs: tests/Makesub
19 echo '# Automatically generated by Make' >$@
20 echo 'testdir=$(testdir)' >>$@
21 echo 'timelimit=60' >>$@
22 echo 'memlimit=1' >>$@
23 echo 'cpulimit=60' >>$@
24 echo 'filelimit=1' >>$@
25 echo 'SHELL=$(SHELL)' >>$@
27 $(TESTS): %: %.o libcody.a
28 $(CXX) $(LDFLAGS) $< -lcody $(LIBS) -o $@
32 rm -f $(TESTS:=.o) $(TESTS:=.d)
34 ifeq ($(filter clean%,$(MAKECMDGOALS)),)