From f7601a759b0bd9830fae772bcdab9210097f68bb Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 7 Sep 2021 19:47:37 +0200 Subject: [PATCH 1/4] Move math/big tests under `tests/`. --- .github/workflows/ci.yml | 9 +------ core/math/big/tests/build.bat | 9 ------- tests/core/build.bat | 25 +++++++++++++++++-- .../tests => tests/core/math/big}/test.odin | 0 .../big/tests => tests/core/math/big}/test.py | 6 ++--- 5 files changed, 27 insertions(+), 22 deletions(-) delete mode 100644 core/math/big/tests/build.bat rename {core/math/big/tests => tests/core/math/big}/test.odin (100%) rename {core/math/big/tests => tests/core/math/big}/test.py (95%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11705c87d..b2caf93aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,14 +69,7 @@ jobs: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin run examples/demo/demo.odin timeout-minutes: 10 - - name: core:math/big tests - shell: cmd - run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat - cd core\math\big\tests - call build.bat - timeout-minutes: 10 - - name: core:image and core:compress tests + - name: Tests for core:{image,compress,math} shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat diff --git a/core/math/big/tests/build.bat b/core/math/big/tests/build.bat deleted file mode 100644 index a9c0c2e6e..000000000 --- a/core/math/big/tests/build.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -set TEST_ARGS=-fast-tests -set TEST_ARGS= -set OUT_NAME=test_library -set COMMON=-build-mode:shared -show-timings -no-bounds-check -define:MATH_BIG_EXE=false -vet -strict-style -set PATH_TO_ODIN==..\..\..\..\odin -:%PATH_TO_ODIN% build . %COMMON% -o:minimal -out:%OUT_NAME% && python3 test.py %TEST_ARGS% -:%PATH_TO_ODIN% build . %COMMON% -o:size -out:%OUT_NAME% && python3 test.py %TEST_ARGS% -%PATH_TO_ODIN% build . %COMMON% -o:speed -out:%OUT_NAME% && python3 test.py %TEST_ARGS% \ No newline at end of file diff --git a/tests/core/build.bat b/tests/core/build.bat index f2a810cac..cda0b078f 100644 --- a/tests/core/build.bat +++ b/tests/core/build.bat @@ -1,6 +1,27 @@ @echo off set COMMON=-show-timings -no-bounds-check -vet -strict-style set PATH_TO_ODIN==..\..\odin -python3 download_assets.py +:python3 download_assets.py +echo --- +echo Running core:image tests +echo --- %PATH_TO_ODIN% test image %COMMON% -%PATH_TO_ODIN% test compress %COMMON% \ No newline at end of file +del image.exe +echo --- +echo Running core:compress tests +echo --- +%PATH_TO_ODIN% test compress %COMMON% +del compress.exe + +rem math/big tests +set TEST_ARGS=-fast-tests +set TEST_ARGS= +set OUT_NAME=math_big_test_library +set COMMON=-build-mode:shared -show-timings -no-bounds-check -define:MATH_BIG_EXE=false -vet -strict-style +echo --- +echo Running core:math/big tests +echo --- + +%PATH_TO_ODIN% build math/big %COMMON% -o:speed -out:%OUT_NAME% +python3 math/big/test.py %TEST_ARGS% +del %OUT_NAME%.* \ No newline at end of file diff --git a/core/math/big/tests/test.odin b/tests/core/math/big/test.odin similarity index 100% rename from core/math/big/tests/test.odin rename to tests/core/math/big/test.odin diff --git a/core/math/big/tests/test.py b/tests/core/math/big/test.py similarity index 95% rename from core/math/big/tests/test.py rename to tests/core/math/big/test.py index 44659a638..b819e268e 100644 --- a/core/math/big/tests/test.py +++ b/tests/core/math/big/test.py @@ -101,11 +101,11 @@ if args.no_random: # Where is the DLL? If missing, build using: `odin build . -build-mode:shared` # if platform.system() == "Windows": - LIB_PATH = os.getcwd() + os.sep + "test_library.dll" + LIB_PATH = os.getcwd() + os.sep + "math_big_test_library.dll" elif platform.system() == "Linux": - LIB_PATH = os.getcwd() + os.sep + "test_library.so" + LIB_PATH = os.getcwd() + os.sep + "math_big_test_library.so" elif platform.system() == "Darwin": - LIB_PATH = os.getcwd() + os.sep + "test_library.dylib" + LIB_PATH = os.getcwd() + os.sep + "math_big_test_library.dylib" else: print("Platform is unsupported.") exit(1) From fcb23abce435c34edb4464b9c349c91aab50d1f8 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 7 Sep 2021 19:57:08 +0200 Subject: [PATCH 2/4] Tests: Integrate `strings` into CI. --- tests/core/Makefile | 6 +++++- tests/core/build.bat | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/core/Makefile b/tests/core/Makefile index 7124af00b..b9dd0c9a2 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -1,7 +1,7 @@ ODIN=../../odin PYTHON=$(shell which python3) -all: download_test_assets image_test compress_test +all: download_test_assets image_test compress_test strings_test download_test_assets: $(PYTHON) download_assets.py @@ -13,3 +13,7 @@ image_test: compress_test: $(ODIN) test compress/test_core_compress.odin rm test_core_compress + +strings_test: + $(ODIN) test strings/test_core_strings.odin + rm test_core_strings diff --git a/tests/core/build.bat b/tests/core/build.bat index cda0b078f..23ee3abd4 100644 --- a/tests/core/build.bat +++ b/tests/core/build.bat @@ -1,18 +1,26 @@ @echo off set COMMON=-show-timings -no-bounds-check -vet -strict-style set PATH_TO_ODIN==..\..\odin -:python3 download_assets.py +python3 download_assets.py echo --- echo Running core:image tests echo --- %PATH_TO_ODIN% test image %COMMON% del image.exe + echo --- echo Running core:compress tests echo --- %PATH_TO_ODIN% test compress %COMMON% del compress.exe +echo --- +echo Running core:strings tests +echo --- +%PATH_TO_ODIN% test strings %COMMON% +del strings.exe + + rem math/big tests set TEST_ARGS=-fast-tests set TEST_ARGS= From c0c7b4cbda818150dc05fcac874a7d22aa73eb39 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 7 Sep 2021 20:13:03 +0200 Subject: [PATCH 3/4] Rename CI tests. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2caf93aa..e3ad8ecbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Odin run run: ./odin run examples/demo/demo.odin timeout-minutes: 10 - - name: core:image and core:compress tests + - name: Core library tests run: | cd tests/core make @@ -69,7 +69,7 @@ jobs: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat odin run examples/demo/demo.odin timeout-minutes: 10 - - name: Tests for core:{image,compress,math} + - name: Core library tests shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat From ce2f926ff750edabc349dc32bb331abd246b99a1 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 7 Sep 2021 20:24:02 +0200 Subject: [PATCH 4/4] Separate math/big test. --- .github/workflows/ci.yml | 7 +++++++ tests/core/build.bat | 16 +--------------- tests/core/math/big/build.bat | 13 +++++++++++++ 3 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 tests/core/math/big/build.bat diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3ad8ecbd..ce4f198e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,10 @@ jobs: cd tests\core call build.bat timeout-minutes: 10 + - name: core:math/big tests + shell: cmd + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat + cd tests\core\math\big + call build.bat + timeout-minutes: 10 diff --git a/tests/core/build.bat b/tests/core/build.bat index 23ee3abd4..6c0a42a29 100644 --- a/tests/core/build.bat +++ b/tests/core/build.bat @@ -18,18 +18,4 @@ echo --- echo Running core:strings tests echo --- %PATH_TO_ODIN% test strings %COMMON% -del strings.exe - - -rem math/big tests -set TEST_ARGS=-fast-tests -set TEST_ARGS= -set OUT_NAME=math_big_test_library -set COMMON=-build-mode:shared -show-timings -no-bounds-check -define:MATH_BIG_EXE=false -vet -strict-style -echo --- -echo Running core:math/big tests -echo --- - -%PATH_TO_ODIN% build math/big %COMMON% -o:speed -out:%OUT_NAME% -python3 math/big/test.py %TEST_ARGS% -del %OUT_NAME%.* \ No newline at end of file +del strings.exe \ No newline at end of file diff --git a/tests/core/math/big/build.bat b/tests/core/math/big/build.bat new file mode 100644 index 000000000..d567cdeb7 --- /dev/null +++ b/tests/core/math/big/build.bat @@ -0,0 +1,13 @@ +@echo off +rem math/big tests +set PATH_TO_ODIN==..\..\..\..\odin +set TEST_ARGS=-fast-tests +set TEST_ARGS= +set OUT_NAME=math_big_test_library +set COMMON=-build-mode:shared -show-timings -no-bounds-check -define:MATH_BIG_EXE=false -vet -strict-style +echo --- +echo Running core:math/big tests +echo --- + +%PATH_TO_ODIN% build . %COMMON% -o:speed -out:%OUT_NAME% +python3 test.py %TEST_ARGS% \ No newline at end of file