summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Manura <dm.git@math2.org>2011-05-14 19:20:32 -0400
committerDavid Manura <dm.git@math2.org>2011-05-14 19:20:32 -0400
commit562873fafd15a61e0261d102df9b8a97e1f4d206 (patch)
tree0d624d7e117d20eaad0b318c37f5701c03536b7c
parentaed045560f06f27149d82f2a5f80d91ecd3aa24e (diff)
downloadlua-562873fafd15a61e0261d102df9b8a97e1f4d206.tar.gz
build - update dist.cmake to fix broken argument in fib.lua test
-rw-r--r--dist.cmake12
1 files changed, 5 insertions, 7 deletions
diff --git a/dist.cmake b/dist.cmake
index 2184da6..faff504 100644
--- a/dist.cmake
+++ b/dist.cmake
@@ -369,7 +369,7 @@ endmacro ()
# (defaults to ${CMAKE_CURRENT_BINARY_DIR}).
# Both paths, if relative, are relative to ${CMAKE_CURRENT_SOURCE_DIR}.
# Under LuaDist, set test=true in config.lua to enable testing.
-# USE: add_lua_test ( test/test1.lua )
+# USE: add_lua_test ( test/test1.lua [args...] )
macro ( add_lua_test _testfile )
if ( NOT SKIP_TESTING )
include ( CTest )
@@ -386,20 +386,18 @@ local sodir = '${CMAKE_CURRENT_BINARY_DIR}' .. (configuration == '' and '' or '/
package.path = sodir .. '/?.lua\;' .. sodir .. '/?.lua\;' .. package.path
package.cpath = sodir .. '/?.so\;' .. sodir .. '/?.dll\;' .. package.cpath
arg[0] = '${TESTFILEABS}'
-return dofile '${TESTFILEABS}'
+table.remove(arg, 1)
+return assert(loadfile '${TESTFILEABS}')(unpack(arg))
" )
if ( ${ARGC} GREATER 1 )
set ( _testcurrentdir ${ARGV1} )
get_filename_component ( TESTCURRENTDIRABS ${_testcurrentdir} ABSOLUTE )
# note: CMake 2.6 (unlike 2.8) lacks WORKING_DIRECTORY parameter.
-#old:
-# set ( TESTWRAPPERSOURCE
-#"require 'lfs'; lfs.chdir('${TESTCURRENTDIRABS}' )
-#${TESTWRAPPERSOURCE}" )
+#old: set ( TESTWRAPPERSOURCE "require 'lfs'; lfs.chdir('${TESTCURRENTDIRABS}' ) ${TESTWRAPPERSOURCE}" )
set ( _pre ${CMAKE_COMMAND} -E chdir "${TESTCURRENTDIRABS}" )
endif ()
file ( WRITE ${TESTWRAPPER} ${TESTWRAPPERSOURCE})
- add_test ( NAME ${TESTFILEBASE} COMMAND ${_pre} ${LUA} ${TESTWRAPPER} $<CONFIGURATION> )
+ add_test ( NAME ${TESTFILEBASE} COMMAND ${_pre} ${LUA} ${TESTWRAPPER} $<CONFIGURATION> ${ARGN} )
endif ()
# see also http://gdcm.svn.sourceforge.net/viewvc/gdcm/Sandbox/CMakeModules/UsePythonTest.cmake
endmacro ()