diff --git a/Makefile b/Makefile index 258699e..5e3e3f2 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ LUA_BINDIR= $(shell echo `dirname $(LUA)`) LUA_PREFIX= $(shell echo `dirname $(LUA_BINDIR)`) LUA_SHAREDIR=$(LUA_PREFIX)/share/lua/5.1 +_REPODIR != cd "$(shell dirname $(firstword $(MAKEFILE_LIST)))/" && pwd + ldoc: install: install_parts @@ -28,7 +30,7 @@ uninstall: test: test-basic test-example test-md test-tables -RUN=&& ldoc . && diff -r docs cdocs && echo ok +RUN=&& lua $(_REPODIR)/ldoc.lua . && diff -r docs cdocs && echo ok test-prep: find -type d -name doc -execdir rsync -av --del {}/ cdocs/ \; @@ -47,7 +49,7 @@ test-tables: test-clean: clean-basic clean-example clean-md clean-tables -CLEAN=&& ldoc . && rd /S /Q cdocs && cp -rf docs cdocs +CLEAN=&& lua $(_REPODIR)/ldoc.lua . && rd /S /Q cdocs && cp -rf docs cdocs clean-basic: cd tests $(CLEAN) diff --git a/run-tests.lua b/run-tests.lua index 26e4f64..062c431 100644 --- a/run-tests.lua +++ b/run-tests.lua @@ -1,13 +1,15 @@ +local PWD = os.getenv("PWD") + local run if not arg[1] then run = function (dir) - local cmd = 'cd '..dir..' && ldoc --testing . && diff -r doc cdocs' + local cmd = 'cd '..dir..' && lua '..PWD..'/ldoc.lua --testing . && diff -r doc cdocs' print(cmd) os.execute(cmd) end elseif arg[1] == 'update' then run = function (dir) - local cmd = 'cd '..dir..' && ldoc --dir cdocs --testing .' + local cmd = 'cd '..dir..' && lua '..PWD..'/ldoc.lua --dir cdocs --testing .' print(cmd) os.execute(cmd) end