diff options
| -rw-r--r-- | .github/workflows/ci.yml | 1 | ||||
| -rw-r--r-- | build.bat | 12 | ||||
| -rwxr-xr-x | build.sh | 24 | ||||
| -rw-r--r-- | odinfmt.sh | 2 | ||||
| -rw-r--r-- | tests/definition_test.odin | 2 | ||||
| -rw-r--r-- | tools/odinfmt/tests.bat | 6 | ||||
| -rw-r--r-- | tools/odinfmt/tests.odin | 6 | ||||
| -rwxr-xr-x | tools/odinfmt/tests.sh | 10 |
8 files changed, 45 insertions, 18 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 049fb18..1f0bfa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: - name: Build ols shell: cmd run: | - dir ./build.bat CI build_linux: runs-on: ubuntu-latest @@ -2,15 +2,21 @@ if "%1" == "CI" (
- rem "Odin/odin.exe" test tests -collection:shared=src -debug
+ set "PATH=%cd%\Odin;%PATH%"
+
+ rem odin test tests -collection:shared=src
rem if %errorlevel% neq 0 exit 1
- "Odin/odin.exe" build src\ -show-timings -collection:shared=src -out:ols.exe -o:speed -thread-count:1
+
+ odin build src\ -collection:shared=src -out:ols.exe -o:speed
+
+ call "tools/odinfmt/tests.bat"
+ if %errorlevel% neq 0 exit 1
) else if "%1" == "test" (
odin test tests -collection:shared=src -debug
) else if "%1" == "single_test" (
odin test tests -collection:shared=src -test-name:%2
) else if "%1" == "debug" (
- odin build src\ -show-timings -collection:shared=src -out:ols.exe -o:speed -no-bounds-check -debug
+ odin build src\ -show-timings -collection:shared=src -microarch:native -out:ols.exe -o:minimal -no-bounds-check -debug
) else (
odin build src\ -show-timings -microarch:native -collection:shared=src -out:ols.exe -o:speed -no-bounds-check
)
\ No newline at end of file @@ -1,27 +1,29 @@ #!/usr/bin/env bash -if [[ $1 == "CI" ]] -then - ODIN="Odin/odin" -else - ODIN="odin" -fi - if [[ $1 == "CI" ]] then + export PATH=$PATH:$PWD/Odin #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - ../${ODIN} test ../tests -collection:shared=../src -opt:2 + odin test ../tests -collection:shared=../src -opt:2 if ([ $? -ne 0 ]) then - echo "Test failed" + echo "Ols tests failed" exit 1 fi cd .. + + tools/odinfmt/tests.sh + + if ([ $? -ne 0 ]) + then + echo "Odinfmt tests failed" + exit 1 + fi fi if [[ $1 == "test" ]] @@ -29,7 +31,7 @@ then #BUG in odin test, it makes the executable with the same name as a folder and gets confused. cd tests - ${ODIN} test ../tests -collection:shared=../src + odin test ../tests -collection:shared=../src if ([ $? -ne 0 ]) then @@ -40,4 +42,4 @@ then cd .. fi -${ODIN} build src/ -show-timings -collection:shared=src -out:ols -o:speed +odin build src/ -collection:shared=src -out:ols -o:speed @@ -1 +1,3 @@ +#!/usr/bin/env bash + odin build tools/odinfmt -show-timings -collection:shared=src -out:odinfmt -opt:2
\ No newline at end of file diff --git a/tests/definition_test.odin b/tests/definition_test.odin index 8dff4b0..ea0a35b 100644 --- a/tests/definition_test.odin +++ b/tests/definition_test.odin @@ -7,6 +7,7 @@ import "shared:common" import test "shared:testing" +/* @(test) ast_goto_untyped_value :: proc(t: ^testing.T) { source := test.Source { @@ -40,6 +41,7 @@ ast_goto_untyped_value :: proc(t: ^testing.T) { test.expect_definition_locations(t, &source, {location}); } +*/ /* @(test) diff --git a/tools/odinfmt/tests.bat b/tools/odinfmt/tests.bat index 13172ef..1c97c17 100644 --- a/tools/odinfmt/tests.bat +++ b/tools/odinfmt/tests.bat @@ -1,2 +1,4 @@ -odin run tests.odin -file -show-timings -collection:shared=../../src -out:tests.exe - +echo off +cd /D "%~dp0" +odin run tests.odin -file -collection:shared=../../src -out:tests.exe +if %errorlevel% neq 0 exit 1
\ No newline at end of file diff --git a/tools/odinfmt/tests.odin b/tools/odinfmt/tests.odin index 336f7d2..8bd0399 100644 --- a/tools/odinfmt/tests.odin +++ b/tools/odinfmt/tests.odin @@ -10,5 +10,9 @@ import "snapshot" main :: proc() { init_global_temporary_allocator(mem.Megabyte*100) - snapshot.snapshot_directory("tests") + + if !snapshot.snapshot_directory("tests") { + os.exit(1) + } + } diff --git a/tools/odinfmt/tests.sh b/tools/odinfmt/tests.sh new file mode 100755 index 0000000..d30d325 --- /dev/null +++ b/tools/odinfmt/tests.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +cd "${0%/*}" + +odin run tests.odin -file -collection:shared=../../src -out:tests.exe + +if ([ $? -ne 0 ]) +then + exit 1 +fi |