diff options
author | David Manura <dm.git@math2.org> | 2011-05-14 19:20:32 -0400 |
---|---|---|
committer | David Manura <dm.git@math2.org> | 2011-05-14 19:20:32 -0400 |
commit | 562873fafd15a61e0261d102df9b8a97e1f4d206 (patch) | |
tree | 0d624d7e117d20eaad0b318c37f5701c03536b7c | |
parent | aed045560f06f27149d82f2a5f80d91ecd3aa24e (diff) | |
download | lua-562873fafd15a61e0261d102df9b8a97e1f4d206.tar.gz |
build - update dist.cmake to fix broken argument in fib.lua test
-rw-r--r-- | dist.cmake | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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 () |