Users can write tests for their Juvix packages using (for example) juvix-test.
A script is required to run the test using juvix eval or juvix compile followed by running the native binary.
This issue proposes adding:
A field called test to the Package type in PackageDescription. The value of the field is a String containing a command which runs tests in the project. The default value of test would be the empty string.
A CLI subcommand juvix test which runs the test command in the juvix project root. If the test command String is blank (i.e all whitespace or empty) then no command is executed.
For example:
module Package;
import PackageDescription.V2 open;
package : Package :=
defaultPackage@{
name := "MyProject";
version := mkVersion 0 1 0;
test := "juvix eval tests/Main.juvix"
};
To run natively compiled tests you could use:
test := "juvix compile native tests/Main.juvix && ./Main"
Users can write tests for their Juvix packages using (for example) juvix-test.
A script is required to run the test using
juvix eval
orjuvix compile
followed by running the native binary.This issue proposes adding:
test
to thePackage
type inPackageDescription
. The value of the field is aString
containing a command which runs tests in the project. The default value oftest
would be the empty string.juvix test
which runs thetest
command in the juvix project root. If thetest
command String is blank (i.e all whitespace or empty) then no command is executed.For example:
To run natively compiled tests you could use: