]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
make : add test and update CI (#2897)
authoralonfaraj <redacted>
Wed, 30 Aug 2023 09:42:51 +0000 (12:42 +0300)
committerGitHub <redacted>
Wed, 30 Aug 2023 09:42:51 +0000 (12:42 +0300)
* build ci: run make test

* makefile:
- add all
- add test

* enable tests/test-tokenizer-0-llama

* fix path to model

* remove gcc-8 from macos build test

* Update Makefile

* Update Makefile

.github/workflows/build.yml
Makefile

index 10320ad1fc137a7d6dcc6b6f988d7fc35f249316..20fd8c2b58361b45f25b87f8209e75e7ce69d6f3 100644 (file)
@@ -41,6 +41,12 @@ jobs:
         run: |
           CC=gcc-8 make
 
+      - name: Test
+        id: make_test
+        run: |
+          CC=gcc-8 make tests
+          make test
+
   ubuntu-latest-cmake:
     runs-on: ubuntu-latest
 
@@ -157,6 +163,12 @@ jobs:
         run: |
           make
 
+      - name: Test
+        id: make_test
+        run: |
+          make tests
+          make test
+
   macOS-latest-cmake:
     runs-on: macos-latest
 
index c8b8a92d717aac190f4d4a5b8dd6a8152d261941..bd2d92869271999c9fcb88074d6850706dc16acc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,23 @@ TEST_TARGETS = tests/test-llama-grammar tests/test-grammar-parser tests/test-dou
 
 default: $(BUILD_TARGETS)
 
+test:
+       @echo "Running tests..."
+       @for test_target in $(TEST_TARGETS); do \
+               if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
+                       ./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
+               elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
+                       continue; \
+               elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
+                       continue; \
+               else \
+                       ./$$test_target; \
+               fi; \
+       done
+       @echo "All tests have been run."
+
+all: $(BUILD_TARGETS) $(TEST_TARGETS)
+
 ifndef UNAME_S
 UNAME_S := $(shell uname -s)
 endif