local cbindings tests

- Adds cbindings tests to the makefile so they can be run locally, eg with make testLibstorage or make testAll
- Remove the separate workflow for running these tests in ci, opting instead to run them along with unit and integration tests
This commit is contained in:
E M 2026-02-12 19:41:34 +11:00
parent e375223500
commit 7b3eb027e2
No known key found for this signature in database
4 changed files with 29 additions and 12 deletions

View File

@ -63,6 +63,11 @@ jobs:
path: tests/integration/logs/
retention-days: 1
## Part 3 Tests ##
- name: Libstorage tests
if: matrix.tests == 'libstorage' || matrix.tests == 'all'
run: make -j${ncpu} testLibstorage
status:
if: always()
needs: [build]

View File

@ -100,14 +100,3 @@ jobs:
with:
os: linux
nim_version: ${{ env.nim_version }}
- name: C Binding build
run: |
make -j${ncpu} update
make -j${ncpu} libstorage
- name: C Binding test
run: |
cd examples/c
gcc -o storage storage.c -L../../build -lstorage -Wl,-rpath,../../ -pthread
LD_LIBRARY_PATH=../../build ./storage

View File

@ -83,6 +83,9 @@ endif
deps \
libbacktrace \
test \
testAll \
testIntegration \
testLibstorage \
update
ifeq ($(NIM_PARAMS),)
@ -144,8 +147,19 @@ testIntegration: | build deps
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim testIntegration $(TEST_PARAMS) $(NIM_PARAMS) --define:ws_resubscribe=240 build.nims
# Builds a C example that uses the libstorage C library and runs it
testLibstorage: | build deps libstorage
cd examples/c && \
if [ "$(detected_OS)" = "Windows" ]; then \
gcc -o storage.exe storage.c -L../../build -lstorage -pthread && \
PATH=../../build:$$PATH ./storage.exe; \
else \
gcc -o storage storage.c -L../../build -lstorage -Wl,-rpath,../../ -pthread && \
LD_LIBRARY_PATH=../../build ./storage; \
fi
# Builds and runs all tests (except for Taiko L2 tests)
testAll: | build deps
testAll: | build deps testLibstorage
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim testAll $(NIM_PARAMS) build.nims

View File

@ -109,10 +109,19 @@ integration_test () {
fi
}
# outputs a libstorage test job
libstorage_test () {
job_tests="libstorage"
job_includes=""
job
}
# outputs jobs for all test types
all_tests () {
unit_test
integration_test
libstorage_test
}
# outputs jobs for the specified operating systems and all test types