1.3 KiB
1.3 KiB
tests
tests are written in src/test
- tests that test the language will be in the lang subdirectory
- tests that test lily will be in the lily subdirectory
- all tests should return
u8
,void
, orbool
as a status code.follow standard status code practices for value.
0
for success,1
for error, etc - all tests should contain the test specification at the top of the file
- all test arguments are optional
tests with no arguments will always pass
- delimiting whitespace is optional, provided each test argument is prepended with a newline and a
*
timeout
is formatted like0.5s
. if a test exceeds this time, it will fail.args
are given to the application executableexit
is the exit status of the program (return code)
- all test arguments are optional
- if test compilation fails, the test will be considered failed
- tests for lily should try to limit the number of unrelated structures/functions tested.
- tests for lang should be headless (not rely on lily at all)
the following are all of the (currently) supported test arguments:
/*
* exit: u8
* args: str
* stdout: str
* timeout: time
*/
a trivial example test:
/*
* timeout: 0.5s
*/
main := fn(): void {
// test will fail after 0.5s
loop {}
}