Skip to content

Commit b6c4b84

Browse files
committed
test: add unittest target to Makefile
Introduces a 'unittest' target to run only unit tests and updates the help output accordingly.
1 parent e83a721 commit b6c4b84

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ ifneq ($(COVERAGE),false)
204204
genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR)
205205
endif
206206

207+
# Run only unit tests
208+
unittest: $(TARGET) $(DIST_DIR)/unit$(EXE)
209+
$(SQLITE3) ":memory:" -cmd ".bail on" ".load ./$(TARGET)" "SELECT cloudsync_version();"
210+
./$(DIST_DIR)/unit$(EXE)
211+
207212
$(OPENSSL):
208213
git clone https://github.com/openssl/openssl.git $(CURL_DIR)/src/openssl
209214

@@ -404,8 +409,9 @@ help:
404409
@echo " all - Build the extension (default)"
405410
@echo " clean - Remove built files"
406411
@echo " test [COVERAGE=true] - Test the extension with optional coverage output"
412+
@echo " unittest - Run only unit tests (test/unit.c)"
407413
@echo " help - Display this help message"
408414
@echo " xcframework - Build the Apple XCFramework"
409415
@echo " aar - Build the Android AAR package"
410416

411-
.PHONY: all clean test extension help version xcframework aar
417+
.PHONY: all clean test unittest extension help version xcframework aar

0 commit comments

Comments
 (0)