Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.88 KB

developer-notes.md

File metadata and controls

47 lines (30 loc) · 1.88 KB

Developer's Notes for LuaJIT Language Toolkit

Build Instructions

The standard method to build the luajit language toolkit is to use the Meson build system.

Here an example of using meson:

meson setup build # configure the build
ninja -C build # build

Of course Meson and Ninja are required. In alternative Meson can use GNU Make as a backend but using Ninja is recommended.

In addition to Meson a working luajit installed in your path is also needed.

At your convenience you may install LuaJIT using the Little Library Helper. Its usage is to create an build environment and to install luajit:

lhelper create luajit-env # create a new environment
lhelper activate luajit-env # activate the environment
lhelper install luajit # install luajit executable and library

The environment will remains and can be later reused using again the 'lhelper activate' command.

On Linux or other unix-like environment Lhelper can be used or you may install luajit using the standard package manager.

Running the tests

The language toolkit has a large corpus of tests. They can be ran in different modes but it always involves running the standard luajit executable and compare the output with the language toolkit.

The output can be compared in the following ways:

  1. compare directly the output of the Lua test program
  2. compare the listing of the bytecode instructions
  3. compare the hexadecimal dump of the bytecode, byte-per-byte

To run the tests the following commands should be used respectively, depending on the mode:

  1. python2 scripts/test-output.by <build-directory>
  2. python2 scripts/test-bytecode.by <build-directory>
  3. python2 scripts/test-bytecode-hex.by <build-directory>

For each command the directory tests/log will be populated with some logs to compare the differences in the output and the listing of the generated bytecode.