Example test and git hooks

This commit is contained in:
Riyyi
2026-08-03 21:51:48 +02:00
parent 7e3762a442
commit b3da887cc8
4 changed files with 24 additions and 2 deletions
+7 -1
View File
@@ -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
```
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)
"$SCRIPT_DIR/../fmt.sh"
"$SCRIPT_DIR/../test.sh"
Executable
+9
View File
@@ -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
View File
@@ -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")
} }