Browse Source

Merge pull request #1140 from Kelimion/compress_tests

Move `math/big` tests and integrate `strings` test into CI.
Jeroen van Rijn 4 years ago
parent
commit
98d25cdf4d

+ 5 - 5
.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,17 +69,17 @@ 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
+      - name: Core library tests
         shell: cmd
         run: |
           call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
-          cd core\math\big\tests
+          cd tests\core
           call build.bat
         timeout-minutes: 10
-      - name: core:image and core:compress tests
+      - 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
+          cd tests\core\math\big
           call build.bat
         timeout-minutes: 10

+ 0 - 9
core/math/big/tests/build.bat

@@ -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%

+ 5 - 1
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

+ 16 - 1
tests/core/build.bat

@@ -2,5 +2,20 @@
 set COMMON=-show-timings -no-bounds-check -vet -strict-style
 set PATH_TO_ODIN==..\..\odin
 python3 download_assets.py
+echo ---
+echo Running core:image tests
+echo ---
 %PATH_TO_ODIN% test image    %COMMON%
-%PATH_TO_ODIN% test compress %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

+ 13 - 0
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%

+ 0 - 0
core/math/big/tests/test.odin → tests/core/math/big/test.odin


+ 3 - 3
core/math/big/tests/test.py → 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)