diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2884fb301..0aa6a7277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,184 +29,99 @@ jobs: gmake release ./odin version ./odin report + gmake -C vendor/stb/src + gmake -C vendor/cgltf/src + gmake -C vendor/miniaudio/src ./odin check examples/all -vet -strict-style -target:netbsd_amd64 ./odin check examples/all -vet -strict-style -target:netbsd_arm64 - (cd tests/core; gmake all_bsd) - (cd tests/internal; gmake all_bsd) + ./odin test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false + ./odin test tests/core/speed.odin -file -all-packages -o:speed -define:ODIN_TEST_FANCY=false + ./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false + ./odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false (cd tests/issues; ./run.sh) - (cd tests/benchmark; gmake all) - build_linux: - name: Ubuntu Build, Check, and Test - runs-on: ubuntu-latest + ci: + strategy: + fail-fast: false + matrix: + # MacOS 13 runs on Intel, 14 runs on ARM + os: [ubuntu-latest, macos-13, macos-14] + runs-on: ${{ matrix.os }} + name: ${{ matrix.os == 'macos-14' && 'MacOS ARM' || (matrix.os == 'macos-13' && 'MacOS Intel' || 'Ubuntu') }} Build, Check, and Test + timeout-minutes: 15 steps: - uses: actions/checkout@v1 - - name: Download LLVM + + - name: Download LLVM (Linux) + if: matrix.os == 'ubuntu-latest' run: | wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 17 echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH - - name: build odin - run: ./build_odin.sh release - - name: Odin version - run: ./odin version - timeout-minutes: 1 - - name: Odin report - run: ./odin report - timeout-minutes: 1 - - name: Compile needed Vendor - run: | - make -C $(./odin root)/vendor/stb/src - make -C $(./odin root)/vendor/cgltf/src - make -C $(./odin root)/vendor/miniaudio/src - timeout-minutes: 10 - - name: Odin check - run: ./odin check examples/demo -vet - timeout-minutes: 10 - - name: Odin run - run: ./odin run examples/demo - timeout-minutes: 10 - - name: Odin run -debug - run: ./odin run examples/demo -debug - timeout-minutes: 10 - - name: Odin check examples/all - run: ./odin check examples/all -strict-style - timeout-minutes: 10 - - name: Core library tests - run: | - cd tests/core - make - timeout-minutes: 10 - - name: Vendor library tests - run: | - cd tests/vendor - make - timeout-minutes: 10 - - name: Odin internals tests - run: | - cd tests/internal - make - timeout-minutes: 10 - - name: Odin core library benchmarks - run: | - cd tests/benchmark - make - timeout-minutes: 10 - - name: Odin check examples/all for Linux i386 - run: ./odin check examples/all -vet -strict-style -target:linux_i386 - timeout-minutes: 10 - - name: Odin check examples/all for Linux arm64 - run: ./odin check examples/all -vet -strict-style -target:linux_arm64 - timeout-minutes: 10 - - name: Odin check examples/all for FreeBSD amd64 - run: ./odin check examples/all -vet -strict-style -target:freebsd_amd64 - timeout-minutes: 10 - - name: Odin check examples/all for OpenBSD amd64 - run: ./odin check examples/all -vet -strict-style -target:openbsd_amd64 - timeout-minutes: 10 - build_macOS: - name: MacOS Build, Check, and Test - runs-on: macos-13 - steps: - - uses: actions/checkout@v1 - - name: Download LLVM, and setup PATH + + - name: Download LLVM (MacOS Intel) + if: matrix.os == 'macos-13' run: | brew install llvm@17 echo "/usr/local/opt/llvm@17/bin" >> $GITHUB_PATH - - name: build odin - run: ./build_odin.sh release - - name: Odin version - run: ./odin version - timeout-minutes: 1 - - name: Odin report - run: ./odin report - timeout-minutes: 1 - - name: Compile needed Vendor - run: | - make -C $(./odin root)/vendor/stb/src - make -C $(./odin root)/vendor/cgltf/src - make -C $(./odin root)/vendor/miniaudio/src - timeout-minutes: 10 - - name: Odin check - run: ./odin check examples/demo -vet - timeout-minutes: 10 - - name: Odin run - run: ./odin run examples/demo - timeout-minutes: 10 - - name: Odin run -debug - run: ./odin run examples/demo -debug - timeout-minutes: 10 - - name: Odin check examples/all - run: ./odin check examples/all -strict-style - timeout-minutes: 10 - - name: Core library tests - run: | - cd tests/core - make - timeout-minutes: 10 - - name: Odin internals tests - run: | - cd tests/internal - make - timeout-minutes: 10 - - name: Odin core library benchmarks - run: | - cd tests/benchmark - make - timeout-minutes: 10 - build_macOS_arm: - name: MacOS ARM Build, Check, and Test - runs-on: macos-14 # This is an arm/m1 runner. - steps: - - uses: actions/checkout@v1 - - name: Download LLVM and setup PATH + + - name: Download LLVM (MacOS ARM) + if: matrix.os == 'macos-14' run: | brew install llvm@17 echo "/opt/homebrew/opt/llvm@17/bin" >> $GITHUB_PATH - - name: build odin + + - name: Build Odin run: ./build_odin.sh release - name: Odin version run: ./odin version - timeout-minutes: 1 - name: Odin report run: ./odin report - timeout-minutes: 1 - name: Compile needed Vendor run: | make -C $(./odin root)/vendor/stb/src make -C $(./odin root)/vendor/cgltf/src make -C $(./odin root)/vendor/miniaudio/src - timeout-minutes: 10 - name: Odin check run: ./odin check examples/demo -vet - timeout-minutes: 10 - name: Odin run run: ./odin run examples/demo - timeout-minutes: 10 - name: Odin run -debug run: ./odin run examples/demo -debug - timeout-minutes: 10 - name: Odin check examples/all run: ./odin check examples/all -strict-style - timeout-minutes: 10 - - name: Core library tests + - name: Normal Core library tests + run: ./odin test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false + - name: Optimized Core library tests + run: ./odin test tests/core/speed.odin -o:speed -file -all-packages -define:ODIN_TEST_FANCY=false + - name: Vendor library tests + run: ./odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false + - name: Internals tests + run: ./odin test tests/internal -all-packages -define:ODIN_TEST_FANCY=false + - name: Core library benchmarks + run: ./odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false + - name: GitHub Issue tests run: | - cd tests/core - make - timeout-minutes: 10 - - name: Odin internals tests - run: | - cd tests/internal - make - timeout-minutes: 10 - - name: Odin core library benchmarks - run: | - cd tests/benchmark - make - timeout-minutes: 10 + cd tests/issues + ./run.sh + + - name: Odin check examples/all for Linux i386 + run: ./odin check examples/all -vet -strict-style -target:linux_i386 + if: matrix.os == 'ubuntu-latest' + - name: Odin check examples/all for Linux arm64 + run: ./odin check examples/all -vet -strict-style -target:linux_arm64 + if: matrix.os == 'ubuntu-latest' + - name: Odin check examples/all for FreeBSD amd64 + run: ./odin check examples/all -vet -strict-style -target:freebsd_amd64 + if: matrix.os == 'ubuntu-latest' + - name: Odin check examples/all for OpenBSD amd64 + run: ./odin check examples/all -vet -strict-style -target:openbsd_amd64 + if: matrix.os == 'ubuntu-latest' + build_windows: name: Windows Build, Check, and Test runs-on: windows-2022 + timeout-minutes: 15 steps: - uses: actions/checkout@v1 - name: build Odin @@ -216,79 +131,67 @@ jobs: ./build.bat 1 - name: Odin version run: ./odin version - timeout-minutes: 1 - name: Odin report run: ./odin report - timeout-minutes: 1 - name: Odin check shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin check examples/demo -vet - timeout-minutes: 10 - name: Odin run shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin run examples/demo - timeout-minutes: 10 - name: Odin run -debug shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin run examples/demo -debug - timeout-minutes: 10 - name: Odin check examples/all shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin check examples/all -strict-style - timeout-minutes: 10 - name: Core library tests shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat - cd tests\core - call build.bat - timeout-minutes: 10 + odin test tests/core/normal.odin -file -all-packages -define:ODIN_TEST_FANCY=false + - name: Optimized core library tests + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat + odin test tests/core/speed.odin -o:speed -file -all-packages -define:ODIN_TEST_FANCY=false - name: Core library benchmarks shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat - cd tests\benchmark - call build.bat - timeout-minutes: 10 + odin test tests/benchmark -all-packages -define:ODIN_TEST_FANCY=false - name: Vendor library tests shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat - cd tests\vendor - call build.bat - timeout-minutes: 10 + odin test tests/vendor -all-packages -define:ODIN_TEST_FANCY=false - name: Odin internals tests shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat - cd tests\internal - call build.bat - timeout-minutes: 10 + odin test tests/internal -all-packages -define:ODIN_TEST_FANCY=false - name: Odin documentation tests shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat cd tests\documentation call build.bat - timeout-minutes: 10 - name: core:math/big tests shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat cd tests\core\math\big call build.bat - timeout-minutes: 10 - name: Odin check examples/all for Windows 32bits shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin check examples/all -strict-style -target:windows_i386 - timeout-minutes: 10 diff --git a/tests/benchmark/Makefile b/tests/benchmark/Makefile deleted file mode 100644 index 840174dbb..000000000 --- a/tests/benchmark/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -ODIN=../../odin -COMMON=-no-bounds-check -vet -strict-style -define:ODIN_TEST_FANCY=false - -all: crypto_bench \ - hash_bench - -crypto_bench: - $(ODIN) test crypto $(COMMON) -o:speed -out:bench_crypto - -hash_bench: - $(ODIN) test hash $(COMMON) -o:speed -out:bench_hash - -clean: - rm bench_* \ No newline at end of file diff --git a/tests/benchmark/all.odin b/tests/benchmark/all.odin new file mode 100644 index 000000000..d1b7662e2 --- /dev/null +++ b/tests/benchmark/all.odin @@ -0,0 +1,4 @@ +package benchmarks + +@(require) import "crypto" +@(require) import "hash" diff --git a/tests/benchmark/build.bat b/tests/benchmark/build.bat deleted file mode 100644 index 30b030066..000000000 --- a/tests/benchmark/build.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo off -set COMMON=-no-bounds-check -vet -strict-style -define:ODIN_TEST_FANCY=false -set PATH_TO_ODIN==..\..\odin - -echo --- -echo Running core:crypto benchmarks -echo --- -%PATH_TO_ODIN% test crypto %COMMON% -o:speed -out:bench_crypto.exe || exit /b - -echo --- -echo Running core:hash benchmarks -echo --- -%PATH_TO_ODIN% test hash %COMMON% -o:speed -out:bench_hash.exe || exit /b diff --git a/tests/core/Makefile b/tests/core/Makefile deleted file mode 100644 index 79af9c3c7..000000000 --- a/tests/core/Makefile +++ /dev/null @@ -1,115 +0,0 @@ -ODIN=../../odin -PYTHON=$(shell which python3) -COMMON=-no-bounds-check -vet -strict-style -define:ODIN_TEST_FANCY=false - -all: all_bsd \ - net_test - -all_bsd: download_test_assets \ - c_libc_test \ - compress_test \ - container_test \ - crypto_test \ - encoding_test \ - filepath_test \ - fmt_test \ - hash_test \ - i18n_test \ - image_test \ - linalg_glsl_math_test \ - match_test \ - math_test \ - noise_test \ - odin_test \ - os_exit_test \ - reflect_test \ - runtime_test \ - slice_test \ - strconv_test \ - strings_test \ - thread_test \ - time_test - -download_test_assets: - $(PYTHON) download_assets.py - -c_libc_test: - $(ODIN) test c/libc $(COMMON) -out:test_core_libc - -compress_test: - $(ODIN) test compress $(COMMON) -out:test_core_compress - -container_test: - $(ODIN) test container $(COMMON) -out:test_core_container - -crypto_test: - $(ODIN) test crypto $(COMMON) -o:speed -out:test_crypto - -encoding_test: - $(ODIN) test encoding/base64 $(COMMON) -out:test_base64 - $(ODIN) test encoding/cbor $(COMMON) -out:test_cbor - $(ODIN) test encoding/hex $(COMMON) -out:test_hex - $(ODIN) test encoding/hxa $(COMMON) -out:test_hxa - $(ODIN) test encoding/json $(COMMON) -out:test_json - $(ODIN) test encoding/varint $(COMMON) -out:test_varint - $(ODIN) test encoding/xml $(COMMON) -out:test_xml - -filepath_test: - $(ODIN) test path/filepath $(COMMON) -out:test_core_filepath - -fmt_test: - $(ODIN) test fmt $(COMMON) -out:test_core_fmt - -hash_test: - $(ODIN) test hash $(COMMON) -o:speed -out:test_hash - -image_test: - $(ODIN) test image $(COMMON) -out:test_core_image - -i18n_test: - $(ODIN) test text/i18n $(COMMON) -out:test_core_i18n - -match_test: - $(ODIN) test text/match $(COMMON) -out:test_core_match - -math_test: - $(ODIN) test math $(COMMON) -out:test_core_math - -linalg_glsl_math_test: - $(ODIN) test math/linalg/glsl $(COMMON) -out:test_linalg_glsl_math - -noise_test: - $(ODIN) test math/noise $(COMMON) -out:test_noise - -net_test: - $(ODIN) test net $(COMMON) -out:test_core_net - -os_exit_test: - $(ODIN) run os/test_core_os_exit.odin -file -out:test_core_os_exit && exit 1 || exit 0 - -odin_test: - $(ODIN) test odin $(COMMON) -out:test_core_odin - -reflect_test: - $(ODIN) test reflect $(COMMON) -out:test_core_reflect - -runtime_test: - $(ODIN) test runtime $(COMMON) -out:test_core_runtime - -slice_test: - $(ODIN) test slice $(COMMON) -out:test_core_slice - -strconv_test: - $(ODIN) test strconv $(COMMON) -out:test_core_strconv - -strings_test: - $(ODIN) test strings $(COMMON) -out:test_core_strings - -thread_test: - $(ODIN) test thread $(COMMON) -out:test_core_thread - -time_test: - $(ODIN) test time $(COMMON) -out:test_core_time - -clean: - rm test_* \ No newline at end of file diff --git a/tests/core/build.bat b/tests/core/build.bat deleted file mode 100644 index 18506408a..000000000 --- a/tests/core/build.bat +++ /dev/null @@ -1,124 +0,0 @@ -@echo off -set COMMON=-no-bounds-check -vet -strict-style -define:ODIN_TEST_FANCY=false -set PATH_TO_ODIN==..\..\odin -python3 download_assets.py -echo --- -echo Running core:c/libc tests -echo --- -%PATH_TO_ODIN% test c\libc %COMMON% -out:test_libc.exe || exit /b - -echo --- -echo Running core:compress tests -echo --- -%PATH_TO_ODIN% test compress %COMMON% -out:test_core_compress.exe || exit /b - -echo --- -echo Running core:container tests -echo --- -%PATH_TO_ODIN% test container %COMMON% -out:test_core_container.exe || exit /b - -echo --- -echo Running core:crypto tests -echo --- -%PATH_TO_ODIN% test crypto %COMMON% -o:speed -out:test_crypto.exe || exit /b - -echo --- -echo Running core:encoding tests -echo --- -%PATH_TO_ODIN% test encoding/base64 %COMMON% -out:test_base64.exe || exit /b -%PATH_TO_ODIN% test encoding/cbor %COMMON% -out:test_cbor.exe || exit /b -%PATH_TO_ODIN% test encoding/hex %COMMON% -out:test_hex.exe || exit /b -%PATH_TO_ODIN% test encoding/hxa %COMMON% -out:test_hxa.exe || exit /b -%PATH_TO_ODIN% test encoding/json %COMMON% -out:test_json.exe || exit /b -%PATH_TO_ODIN% test encoding/varint %COMMON% -out:test_varint.exe || exit /b -%PATH_TO_ODIN% test encoding/xml %COMMON% -out:test_xml.exe || exit /b - -echo --- -echo Running core:path/filepath tests -echo --- -%PATH_TO_ODIN% test path/filepath %COMMON% -out:test_core_filepath.exe || exit /b - -echo --- -echo Running core:fmt tests -echo --- -%PATH_TO_ODIN% test fmt %COMMON% -out:test_core_fmt.exe || exit /b - -echo --- -echo Running core:hash tests -echo --- -%PATH_TO_ODIN% test hash %COMMON% -o:speed -out:test_core_hash.exe || exit /b - -echo --- -echo Running core:image tests -echo --- -%PATH_TO_ODIN% test image %COMMON% -out:test_core_image.exe || exit /b - -echo --- -echo Running core:text/i18n tests -echo --- -%PATH_TO_ODIN% test text\i18n %COMMON% -out:test_core_i18n.exe || exit /b - -echo --- -echo Running text:match tests -echo --- -%PATH_TO_ODIN% test text/match %COMMON% -out:test_core_match.exe || exit /b - -echo --- -echo Running core:math tests -echo --- -%PATH_TO_ODIN% test math %COMMON% -out:test_core_math.exe || exit /b - -echo --- -echo Running core:math/linalg/glsl tests -echo --- -%PATH_TO_ODIN% test math/linalg/glsl %COMMON% -out:test_linalg_glsl.exe || exit /b - -echo --- -echo Running core:math/noise tests -echo --- -%PATH_TO_ODIN% test math/noise %COMMON% -out:test_noise.exe || exit /b - -echo --- -echo Running core:net -echo --- -%PATH_TO_ODIN% test net %COMMON% -out:test_core_net.exe || exit /b - -echo --- -echo Running core:odin tests -echo --- -%PATH_TO_ODIN% test odin %COMMON% -o:size -out:test_core_odin.exe || exit /b - -echo --- -echo Running core:reflect tests -echo --- -%PATH_TO_ODIN% test reflect %COMMON% -out:test_core_reflect.exe || exit /b - -echo --- -echo Running core:runtime tests -echo --- -%PATH_TO_ODIN% test runtime %COMMON% -out:test_core_runtime.exe || exit /b - -echo --- -echo Running core:slice tests -echo --- -%PATH_TO_ODIN% test slice %COMMON% -out:test_core_slice.exe || exit /b - -echo --- -echo Running core:strconv tests -echo --- -%PATH_TO_ODIN% test strconv %COMMON% -out:test_core_strconv.exe || exit /b - -echo --- -echo Running core:strings tests -echo --- -%PATH_TO_ODIN% test strings %COMMON% -out:test_core_strings.exe || exit /b - -echo --- -echo Running core:thread tests -echo --- -%PATH_TO_ODIN% test thread %COMMON% -out:test_core_thread.exe || exit /b - -echo --- -echo Running core:time tests -echo --- -%PATH_TO_ODIN% test time %COMMON% -out:test_core_time.exe || exit /b \ No newline at end of file diff --git a/tests/core/download_assets.py b/tests/core/download_assets.py index 8e124954f..fc4a71cdc 100644 --- a/tests/core/download_assets.py +++ b/tests/core/download_assets.py @@ -8,7 +8,7 @@ import hashlib import hmac TEST_SUITES = ['PNG', 'XML', 'BMP'] -DOWNLOAD_BASE_PATH = "assets/{}" +DOWNLOAD_BASE_PATH = sys.argv[1] + "/{}" ASSETS_BASE_URL = "https://raw.githubusercontent.com/odin-lang/test-assets/master/{}/{}" HMAC_KEY = "https://odin-lang.org" HMAC_HASH = hashlib.sha3_512 @@ -352,4 +352,4 @@ def main(): return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/tests/core/image/build.bat b/tests/core/image/build.bat deleted file mode 100644 index 5a07971b8..000000000 --- a/tests/core/image/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -odin test . -define:ODIN_TEST_TRACK_MEMORY=true -define:ODIN_TEST_PROGRESS_WIDTH=12 -vet -strict-style diff --git a/tests/core/net/test_core_net.odin b/tests/core/net/test_core_net.odin index 3cbb7fa34..6aada88a6 100644 --- a/tests/core/net/test_core_net.odin +++ b/tests/core/net/test_core_net.odin @@ -8,6 +8,7 @@ A test suite for `core:net` */ +//+build !netbsd package test_core_net import "core:testing" @@ -552,4 +553,4 @@ binstr_to_address :: proc(t: ^testing.T, binstr: string) -> (address: net.Addres return nil } panic("Invalid test case") -} \ No newline at end of file +} diff --git a/tests/core/normal.odin b/tests/core/normal.odin new file mode 100644 index 000000000..f23763a59 --- /dev/null +++ b/tests/core/normal.odin @@ -0,0 +1,39 @@ +package tests_core + +import rlibc "core:c/libc" + +@(init) +download_assets :: proc() { + if rlibc.system("python3 " + ODIN_ROOT + "tests/core/download_assets.py " + ODIN_ROOT + "tests/core/assets") != 0 { + panic("downloading test assets failed!") + } +} + +@(require) import "c/libc" +@(require) import "compress" +@(require) import "container" +@(require) import "encoding/base64" +@(require) import "encoding/cbor" +@(require) import "encoding/hex" +@(require) import "encoding/hxa" +@(require) import "encoding/json" +@(require) import "encoding/varint" +@(require) import "encoding/xml" +@(require) import "fmt" +@(require) import "image" +@(require) import "math" +@(require) import "math/big" +@(require) import "math/linalg/glsl" +@(require) import "math/noise" +@(require) import "net" +@(require) import "odin" +@(require) import "path/filepath" +@(require) import "reflect" +@(require) import "runtime" +@(require) import "slice" +@(require) import "strconv" +@(require) import "strings" +@(require) import "text/i18n" +@(require) import "text/match" +@(require) import "thread" +@(require) import "time" diff --git a/tests/core/os/test_core_os_exit.odin b/tests/core/os/test_core_os_exit.odin deleted file mode 100644 index 2ab274f5e..000000000 --- a/tests/core/os/test_core_os_exit.odin +++ /dev/null @@ -1,10 +0,0 @@ -// Tests that Odin run returns exit code of built executable on Unix -// Needs exit status to be inverted to return 0 on success, e.g. -// $(./odin run tests/core/os/test_core_os_exit.odin && exit 1 || exit 0) -package test_core_os_exit - -import "core:os" - -main :: proc() { - os.exit(1) -} diff --git a/tests/core/speed.odin b/tests/core/speed.odin new file mode 100644 index 000000000..555d30f5e --- /dev/null +++ b/tests/core/speed.odin @@ -0,0 +1,5 @@ +// Tests intended to be ran with optimizations on +package tests_core + +@(require) import "crypto" +@(require) import "hash" diff --git a/tests/internal/Makefile b/tests/internal/Makefile deleted file mode 100644 index 307badb41..000000000 --- a/tests/internal/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -ODIN=../../odin -COMMON=-file -vet -strict-style -o:minimal - -all: all_bsd asan_test - -all_bsd: rtti_test map_test pow_test 128_test string_compare_test - -rtti_test: - $(ODIN) test test_rtti.odin $(COMMON) - -map_test: - $(ODIN) test test_map.odin $(COMMON) - -pow_test: - $(ODIN) test test_pow.odin $(COMMON) - -128_test: - $(ODIN) test test_128.odin $(COMMON) - -string_compare_test: - $(ODIN) test test_string_compare.odin $(COMMON) - -asan_test: - $(ODIN) test test_asan.odin $(COMMON) -sanitize:address -debug diff --git a/tests/internal/build.bat b/tests/internal/build.bat deleted file mode 100644 index edaa2684b..000000000 --- a/tests/internal/build.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -set PATH_TO_ODIN==..\..\odin -set COMMON=-file -vet -strict-style -o:minimal -%PATH_TO_ODIN% test test_rtti.odin %COMMON% || exit /b -%PATH_TO_ODIN% test test_map.odin %COMMON% || exit /b -%PATH_TO_ODIN% test test_pow.odin %COMMON% || exit /b -%PATH_TO_ODIN% test test_asan.odin %COMMON% || exit /b -%PATH_TO_ODIN% test test_128.odin %COMMON% || exit /b -%PATH_TO_ODIN% test test_string_compare.odin %COMMON% || exit /b \ No newline at end of file diff --git a/tests/internal/test_128.odin b/tests/internal/test_128.odin index 1aa7487b6..7b7d655e8 100644 --- a/tests/internal/test_128.odin +++ b/tests/internal/test_128.odin @@ -1,4 +1,4 @@ -package test_128 +package test_internal import "core:testing" diff --git a/tests/internal/test_asan.odin b/tests/internal/test_asan.odin index 66f3c6547..1ac599acf 100644 --- a/tests/internal/test_asan.odin +++ b/tests/internal/test_asan.odin @@ -1,5 +1,5 @@ // Intended to contain code that would trigger asan easily if the abi was set up badly. -package test_asan +package test_internal import "core:testing" diff --git a/tests/internal/test_map.odin b/tests/internal/test_map.odin index fa13244ac..a9a8cf5d4 100644 --- a/tests/internal/test_map.odin +++ b/tests/internal/test_map.odin @@ -1,4 +1,4 @@ -package test_internal_map +package test_internal import "core:log" import "base:intrinsics" @@ -309,4 +309,4 @@ set_delete_random_key_value :: proc(t: ^testing.T) { } seed_incr += 1 } -} \ No newline at end of file +} diff --git a/tests/internal/test_pow.odin b/tests/internal/test_pow.odin index 609087fb2..d1939ace5 100644 --- a/tests/internal/test_pow.odin +++ b/tests/internal/test_pow.odin @@ -1,4 +1,4 @@ -package test_internal_math_pow +package test_internal @(require) import "core:log" import "core:math" @@ -42,4 +42,4 @@ pow_test :: proc(t: ^testing.T) { testing.expectf(t, _v1 == _v2, "Expected math.pow2_f16(%d) == math.pow(2, %d) (= %04x), got %04x", exp, exp, _v1, _v2) } } -} \ No newline at end of file +} diff --git a/tests/internal/test_rtti.odin b/tests/internal/test_rtti.odin index ec5508208..e72c107b2 100644 --- a/tests/internal/test_rtti.odin +++ b/tests/internal/test_rtti.odin @@ -1,4 +1,4 @@ -package test_internal_rtti +package test_internal import "core:fmt" import "core:testing" @@ -43,4 +43,4 @@ rtti_test :: proc(t: ^testing.T) { l_s := fmt.tprintf("%s", l_buggy) testing.expectf(t, g_s == EXPECTED_REPR, "Expected fmt.tprintf(\"%%s\", g_s)) to return \"%v\", got \"%v\"", EXPECTED_REPR, g_s) testing.expectf(t, l_s == EXPECTED_REPR, "Expected fmt.tprintf(\"%%s\", l_s)) to return \"%v\", got \"%v\"", EXPECTED_REPR, l_s) -} \ No newline at end of file +} diff --git a/tests/internal/test_string_compare.odin b/tests/internal/test_string_compare.odin index 63b62cc96..32a93ddf5 100644 --- a/tests/internal/test_string_compare.odin +++ b/tests/internal/test_string_compare.odin @@ -1,4 +1,4 @@ -package test_internal_string_compare +package test_internal import "core:testing" @@ -54,4 +54,4 @@ string_compare :: proc(t: ^testing.T) { } } } -} \ No newline at end of file +} diff --git a/tests/issues/run.bat b/tests/issues/run.bat index f3e3daba9..299e08791 100644 --- a/tests/issues/run.bat +++ b/tests/issues/run.bat @@ -10,7 +10,6 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style ..\..\..\odin test ..\test_issue_829.odin %COMMON% || exit /b ..\..\..\odin test ..\test_issue_1592.odin %COMMON% || exit /b ..\..\..\odin test ..\test_issue_2056.odin %COMMON% || exit /b -..\..\..\odin test ..\test_issue_2087.odin %COMMON% || exit /b ..\..\..\odin build ..\test_issue_2113.odin %COMMON% -debug || exit /b ..\..\..\odin test ..\test_issue_2466.odin %COMMON% || exit /b ..\..\..\odin test ..\test_issue_2615.odin %COMMON% || exit /b diff --git a/tests/issues/run.sh b/tests/issues/run.sh index a5280485e..e17cb4c73 100755 --- a/tests/issues/run.sh +++ b/tests/issues/run.sh @@ -13,7 +13,6 @@ set -x $ODIN test ../test_issue_829.odin $COMMON $ODIN test ../test_issue_1592.odin $COMMON $ODIN test ../test_issue_2056.odin $COMMON -$ODIN test ../test_issue_2087.odin $COMMON $ODIN build ../test_issue_2113.odin $COMMON -debug $ODIN test ../test_issue_2466.odin $COMMON $ODIN test ../test_issue_2615.odin $COMMON diff --git a/tests/vendor/Makefile b/tests/vendor/Makefile deleted file mode 100644 index 7d6b84978..000000000 --- a/tests/vendor/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -ODIN=../../odin -ODINFLAGS= - -OS=$(shell uname) - -ifeq ($(OS), OpenBSD) - ODINFLAGS:=$(ODINFLAGS) -extra-linker-flags:-L/usr/local/lib -endif - -all: diff --git a/tests/vendor/all.odin b/tests/vendor/all.odin new file mode 100644 index 000000000..1ce56e786 --- /dev/null +++ b/tests/vendor/all.odin @@ -0,0 +1,3 @@ +package tests_vendor + +@(require) import "glfw" diff --git a/tests/vendor/build.bat b/tests/vendor/build.bat deleted file mode 100644 index 84ab2f1ef..000000000 --- a/tests/vendor/build.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off -set COMMON=-show-timings -no-bounds-check -vet -strict-style -define:ODIN_TEST_FANCY=false -set PATH_TO_ODIN==..\..\odin - -echo --- -echo Running vendor:glfw tests -echo --- -%PATH_TO_ODIN% test glfw %COMMON% -out:vendor_glfw.exe || exit /b \ No newline at end of file diff --git a/tests/vendor/glfw/test_vendor_glfw.odin b/tests/vendor/glfw/test_vendor_glfw.odin index 4254ebb09..8a7fb0d0a 100644 --- a/tests/vendor/glfw/test_vendor_glfw.odin +++ b/tests/vendor/glfw/test_vendor_glfw.odin @@ -1,3 +1,4 @@ +//+build darwin, windows package test_vendor_glfw import "core:testing"