Clean up test build rules
[freeradius.git] / src / tests / Makefile
index 983e5b8..b32d9b0 100644 (file)
@@ -9,8 +9,9 @@
 include ../../Make.inc
 
 BUILD_PATH := $(top_builddir)/build
+TEST_PATH := $(top_builddir)/src/tests
 BIN_PATH := $(BUILD_PATH)/bin/local
-LIB_PATH := $(BUILD_PATH)/lib/local/.libs/
+LIB_PATH := $(BUILD_PATH)/lib/.libs/
 DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):$(LIB_PATH)
 
 export DYLD_LIBRARY_PATH
@@ -51,7 +52,7 @@ dictionary:
 test.conf: dictionary
        @echo "# test configuration file.  Do not install.  Delete at any time." > test.conf
        @echo "libdir =" $(LIB_PATH) >> test.conf
-       @echo "testdir =" $(top_builddir)/src/tests/ >> test.conf
+       @echo "testdir =" $(TEST_PATH) >> test.conf
        @echo 'dictionary = $${testdir}' >> test.conf
        @echo 'logdir = $${testdir}' >> test.conf
        @echo 'radacctdir = $${testdir}' >> test.conf
@@ -59,8 +60,8 @@ test.conf: dictionary
        @echo '$$INCLUDE radiusd.conf' >> test.conf
        @echo '$$INCLUDE $${testdir}/config/' >> test.conf
 
-radiusd.pid: $(RADDB_PATH)/test.conf test.conf raddb
-       $(BIN_PATH)/radiusd -txxl `pwd`/radius.log -md $(RADDB_PATH)/ -n test -i 127.0.0.1 -p $(PORT)
+radiusd.pid: $(RADDB_PATH)/test.conf test.conf
+       @$(BIN_PATH)/radiusd -txxl $(TEST_PATH)/radius.log -md $(RADDB_PATH) -n test -i 127.0.0.1 -p $(PORT) || tail -n 20 $(TEST_PATH)/radius.log
 
 # We can't make this depend on radiusd.pid, because then make will create
 # radiusd.pid when we make radiusd.kill, which we don't want.
@@ -71,13 +72,6 @@ radiusd.kill:
        fi
        @rm -f radiusd.pid
 
-# As test.conf includes radiusd.conf and as radiusd.conf includes everything in
-# mods-enabled and sites-enable we need to ensure those directories have been
-# created and are up to date.
-.PHONY: raddb
-raddb:
-       @$(MAKE) -C $(RADDB_PATH) mods-enabled sites-enabled
-
 #  Link from the main database directory to here
 $(RADDB_PATH)/test.conf: test.conf
        @[ -f $(RADDB_PATH)/test.conf ] || ln -s ../src/tests/test.conf $(RADDB_PATH)/
@@ -124,12 +118,3 @@ leap:
        $(EAPOL_TEST) -c leap.conf -s $(SECRET)
 
 ATTRS  := rfc.txt errors.txt extended.txt lucent.txt wimax.txt
-
-attrs: $(ATTRS) ../main/radattr
-       ../main/radattr -d ../../share rfc.txt
-
-${LIBRADIUS}: $(wildcard ../include/*.h) $(wildcard ../lib/*.c)
-       $(MAKE) -C ../lib all
-
-../main/radattr: ${LIBRADIUS} ../main/radattr.c
-       $(MAKE) -C ../main radattr