Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.73 KB

Development.md

File metadata and controls

51 lines (37 loc) · 1.73 KB

Development

This document contains information useful to anyone wishing to modify the wolfram-library-link crate.

Run the tests

Build the RustLink crate

Unlike many Rust crates that use the cargo-test subcommand to execute their tests, most wolfram-library-link tests are written in Wolfram, using the standard MUnit testing framework. This is necessary because the test functions are designed to be loaded via the Wolfram LibraryLink interface.

The testing code is split between two locations:

The Rust tests are written as a standard cargo example library, which is compiled into a dynamic library (liblibrary_tests.dylib) and loaded by the Wolfram testing code. The test library is bundled into the built RustLink paclet, along with the other example libraries.

The cargo-make subcommand can be installed using:

cargo install cargo-make

Build the RustLink paclet using:

cargo make paclet

Run the wolfram-library-link tests using:

wolfram-cli paclet test ./build/RustLink

This requires that the unofficial wolfram-cli tool is installed, and will run all of the Wolfram .wlt test files in the Tests directory, and output the results to the terminal.