Example test and git hooks
This commit is contained in:
@@ -23,4 +23,10 @@ Asset packer.
|
|||||||
./build.sh debug
|
./build.sh debug
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- TODO: git hook with fmt setup -->
|
## Contributing
|
||||||
|
|
||||||
|
Make sure to enable git hooks:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git config core.hooksPath scripts
|
||||||
|
```
|
||||||
|
|||||||
Executable
+6
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
|
||||||
|
|
||||||
|
"$SCRIPT_DIR/../fmt.sh"
|
||||||
|
"$SCRIPT_DIR/../test.sh"
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
odin test tests/ -collection:src=src -out:build/tests.bin \
|
||||||
|
-define:ODIN_TEST_THREADS=1 \
|
||||||
|
-define:ODIN_TEST_TRACK_MEMORY=false \
|
||||||
|
-define:ODIN_TEST_RANDOM_SEED=1 \
|
||||||
|
"$@"
|
||||||
+2
-1
@@ -3,5 +3,6 @@ package tests
|
|||||||
import "core:testing"
|
import "core:testing"
|
||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
foo :: proc(_: ^testing.T) {
|
foo :: proc(t: ^testing.T) {
|
||||||
|
testing.expect(t, 1 + 1 == 2, "pass")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user