README 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. This tarball contains the official test scripts for Lua 5.1.
  2. Unlike Lua itself, these tests do not aim portability, small footprint,
  3. or easy of use. (Their main goal is to try to crash Lua.) They are not
  4. intended for general use. You are wellcome to use them, but expect to
  5. have to "dirt your hands".
  6. The tarball should expand in the following contents:
  7. - several .lua scripts with the tests
  8. - a main "all.lua" Lua script that invokes all the other scripts
  9. - a subdirectory "libs" with an empty subdirectory "libs/P1",
  10. to be used by the scripts
  11. - a subdirectory "etc" with some extra files
  12. To run the tests, do as follows:
  13. - go to the test directory
  14. - set LUA_PATH to "?;./?.lua" (or, better yet, set LUA_PATH to "./?.lua;;"
  15. and LUA_INIT to "package.path = '?;'..package.path")
  16. - run "lua all.lua"
  17. --------------------------------------------
  18. Internal tests
  19. --------------------------------------------
  20. Some tests need a special library, "testC", that gives access to
  21. several internal structures in Lua.
  22. This library is only available when Lua is compiled in debug mode.
  23. The scripts automatically detect its absence and skip those tests.
  24. If you want to run these tests, move etc/ltests.c and etc/ltests.h to
  25. the directory with the source Lua files, and recompile Lua with
  26. the option -DLUA_USER_H='"ltests.h"' (or its equivalent to define
  27. LUA_USER_H as the string "ltests.h", including the quotes). This
  28. option not only adds the testC library, but it adds several other
  29. internal tests as well. After the recompilation, run the tests
  30. as before.