Skip to content

Commit 5ae8f28

Browse files
authored
Merge pull request #16 from Lind-Project/ansal-unit-test-documentation
Add documentation for running unit tests
2 parents 88d30df + 7d49634 commit 5ae8f28

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Diff for: docs/testing/unit-tests.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
Add
1+
2+
3+
|**Commands**|**Short Commands**|**Description**|**Example Usage**|
4+
|-|-|-|-|
5+
| **singlecompile**|`sc`| Compile a single `.c` file to `.wasm` and `.cwasm`. | `./wasmtest.sh sc file.c`|
6+
| **singlerun**|`sr`| Run a single previously compiled `.wasm`/`.cwasm`file. |`./wasmtest.sh sr file.c`|
7+
| **single** |`s`| Compile and run a single `.c` file in sequence (first compile to WASM, then run).| `./wasmtest.sh s file.c`|
8+
| **allcompile**| `ac`| Compile all `.c` test files in `$LIND_WASM_BASE/tests/unit-tests`. | `./wasmtest.sh ac`|
9+
| **allrun**|`ar`| Run all compiled tests in `$LIND_WASM_BASE/tests/unit-tests`.| `./wasmtest.sh ar`|
10+
| all|`a`| Compile and run all test files in `$LIND_WASM_BASE/tests/unit-tests`.| `./wasmtest.sh a`|
11+
| **filescompile**, **filecompile**|`fc`| Compile test files listed in a user-provided text file (each line should contain one `.c` filename).| `./wasmtest.sh fc filelist.txt`|
12+
| **filesrun**, **filerun**|`fr`| Run test files listed in a user-provided text file (assumes the `.wasm`/`.cwasm` files are already compiled). |`./wasmtest.sh fr filelist.txt`|
13+
| **files**, **file** |`f`| Compile and run test files listed in a user-provided text file (each line should contain one `.c` filename).| `./wasmtest.sh f filelist.txt` |
14+
| **`--timeout=<seconds>`** (optional)| *(none)*| Set a custom test timeout (in seconds). Default: **5 seconds**.| `./wasmtest.sh single file.c --timeout=10`|
15+
16+
17+
### Notes
18+
- **`LIND_WASM_BASE`**: Defaults to `/home/lind/lind-wasm`. You can override it:
19+
```bash
20+
export LIND_WASM_BASE="/custom/path/to/lind-wasm"
21+
- **`<file>.c`**: A single test file to compile or run, found in `$LIND_WASM_BASE/tests/unit-tests`.
22+
- **`<filelist>`**: A text file containing one `.c` filename per line, found in `$LIND_WASM_BASE/tests/unit-tests`.
23+

0 commit comments

Comments
 (0)