c2rust
binary in path- python 3.6 or later.
intercept-build
in path. installing:pip3 install -r requirements.txt
- any other packages and binaries required by the tests themselves
- captured in
**/requirements.yml
- captured in
$ ./test.py # test everything
$ ./test.py --verbose # show test output
$ ./test.py lua # run specific project
$ ./test.py lua --stage transpile # run specific stage of project
$ cd path/to/tests/$PROJ
$ git submodule add --depth 10 $PROJ_URL repo
To track a specific branch ($SUBMOD_NAME can be found in .gitmodules
):
$ git config -f .gitmodules submodule.$SUBMOD_NAME.branch $BRANCH_NAME
$ git submodule update --remote repo
Each test stage can be controlled with a script (in tests/$PROJ
) named as follows:
- autogen stage ->
autogen.sh
- configure stage ->
configure.sh
- make stage ->
make.sh
|cmake.sh
- transpile stage ->
transpile.sh
|transpile.gen.sh
|cmake.sh
- cargo build stage ->
cargo.sh
|cargo.gen.sh
- test stage ->
check.sh
|test.sh
note the .gen.sh
suffix are used to mark scripts generated automatically. Generation is requested via conf.yml
like this:
transpile:
autogen: true
cargo:
autogen: true
Unlike hand-written scripts, autogenerated ones are not version controlled.
Each script is expected to tee
its output to a file named $SCRIPT.log
. For example, make.sh
produces make.sh.log
.
Use the following optional variables to control test steps:
EXTRA_CFLAGS
passes extra flags to the compiler when transpilingEXTRA_TFLAGS
passes extra flags to the transpiler itselfTOOLCHAIN
controls which toolchaincargo build
s the transpiled code (must start with a + character)C2RUST_DIR
is the path to a local checkout of the c2rust sources. Runtime support crates from this checkout will be used instead of pulling them from crates.io.
- check requirements on macOS
- allow cargo build and transpile steps w/o scripts
- warn if
compile_commands.json
is empty - add provision.py driven by
**/conf.yml
- add option to run
c2rust transpile
underrust-gdb