Fix typo
[freeradius.git] / src / tests / Makefile
index 2c8c287..d6c41ca 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
@@ -21,6 +22,7 @@ TESTS = user_password chap mschapv1 digest-01/digest* test.example.com \
        wimax
 
 PORT    = 12340
+#PORT   = 1812
 ACCTPORT = $(shell expr $(PORT) + 1)
 
 #      example.com stripped.example.com
@@ -50,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,7 +61,7 @@ test.conf: dictionary
        @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)
+       @$(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.
@@ -90,7 +92,7 @@ tests: $(RADDB_PATH)/test.conf radiusd.kill
        @chmod a+x runtests.sh
        @rm -f radius.log
        @$(MAKE) radiusd.pid
-       @BIN_PATH="$(BIN_PATH)" ./runtests.sh $(TESTS)
+       @BIN_PATH="$(BIN_PATH)" PORT="$(PORT)" ./runtests.sh $(TESTS)
        @$(MAKE) radiusd.kill
        @rm -f $(RADDB_PATH)/test.conf