From ff4e440f7041c0f2f08d09da20ea642fb52f813e Mon Sep 17 00:00:00 2001 From: David Manura Date: Fri, 25 Mar 2011 00:18:33 -0400 Subject: [PATCH] test: fix tests package path --- CMakeLists.txt | 2 +- tests/test.lua | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61ace59..811c916 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,4 +18,4 @@ install_test ( tests/test_fit.lua ) install_test ( tests/test.lua ) install_test ( tests/test_matrix.lua ) -add_lua_test ( test/test.lua ) #FIX +add_lua_test ( tests/test.lua ) diff --git a/tests/test.lua b/tests/test.lua index 80b665a..9fd03f3 100644 --- a/tests/test.lua +++ b/tests/test.lua @@ -1,8 +1,10 @@ -- test suite (run from parent directory). -package.path = './lua/?.lua;' .. package.path +local here = arg[0]:gsub('[^/\\]+$', '') +package.path = here .. '../lua/?.lua;' .. package.path +package.path = here .. '../samples/?.lua;' .. package.path -dofile 'tests/test_complex.lua' -dofile 'tests/test_matrix.lua' -dofile 'tests/test_fit.lua' +dofile(here .. 'test_complex.lua') +dofile(here .. 'test_matrix.lua') +dofile(here .. 'test_fit.lua') print 'ALL PASSED'