mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-26 16:23:55 +00:00
utilize odin test -all-packages instead of (make/bat) scripts for running tests
This commit is contained in:
225
.github/workflows/ci.yml
vendored
225
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
@@ -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_*
|
||||
4
tests/benchmark/all.odin
Normal file
4
tests/benchmark/all.odin
Normal file
@@ -0,0 +1,4 @@
|
||||
package benchmarks
|
||||
|
||||
@(require) import "crypto"
|
||||
@(require) import "hash"
|
||||
@@ -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
|
||||
@@ -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_*
|
||||
@@ -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
|
||||
@@ -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())
|
||||
sys.exit(main())
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
@echo off
|
||||
odin test . -define:ODIN_TEST_TRACK_MEMORY=true -define:ODIN_TEST_PROGRESS_WIDTH=12 -vet -strict-style
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
39
tests/core/normal.odin
Normal file
39
tests/core/normal.odin
Normal file
@@ -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"
|
||||
@@ -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)
|
||||
}
|
||||
5
tests/core/speed.odin
Normal file
5
tests/core/speed.odin
Normal file
@@ -0,0 +1,5 @@
|
||||
// Tests intended to be ran with optimizations on
|
||||
package tests_core
|
||||
|
||||
@(require) import "crypto"
|
||||
@(require) import "hash"
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,4 +1,4 @@
|
||||
package test_128
|
||||
package test_internal
|
||||
|
||||
import "core:testing"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
10
tests/vendor/Makefile
vendored
10
tests/vendor/Makefile
vendored
@@ -1,10 +0,0 @@
|
||||
ODIN=../../odin
|
||||
ODINFLAGS=
|
||||
|
||||
OS=$(shell uname)
|
||||
|
||||
ifeq ($(OS), OpenBSD)
|
||||
ODINFLAGS:=$(ODINFLAGS) -extra-linker-flags:-L/usr/local/lib
|
||||
endif
|
||||
|
||||
all:
|
||||
3
tests/vendor/all.odin
vendored
Normal file
3
tests/vendor/all.odin
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
package tests_vendor
|
||||
|
||||
@(require) import "glfw"
|
||||
8
tests/vendor/build.bat
vendored
8
tests/vendor/build.bat
vendored
@@ -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
|
||||
1
tests/vendor/glfw/test_vendor_glfw.odin
vendored
1
tests/vendor/glfw/test_vendor_glfw.odin
vendored
@@ -1,3 +1,4 @@
|
||||
//+build darwin, windows
|
||||
package test_vendor_glfw
|
||||
|
||||
import "core:testing"
|
||||
|
||||
Reference in New Issue
Block a user