summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libotr-test.c14
-rw-r--r--src/libotr.mk5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/libotr-test.c b/src/libotr-test.c
new file mode 100644
index 0000000..77a6b07
--- /dev/null
+++ b/src/libotr-test.c
@@ -0,0 +1,14 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <libotr/proto.h>
+#include <libotr/userstate.h>
+
+int main() {
+ OtrlUserState userstate;
+ OTRL_INIT;
+ userstate = otrl_userstate_create();
+ otrl_userstate_free(userstate);
+ return 0;
+}
diff --git a/src/libotr.mk b/src/libotr.mk
index 215713c..5b30e46 100644
--- a/src/libotr.mk
+++ b/src/libotr.mk
@@ -26,4 +26,9 @@ define $(PKG)_BUILD
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' \
$(if $(BUILD_SHARED), LDFLAGS=-no-undefined) $(MXE_DISABLE_CRUFT)
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_CRUFT)
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --cflags --libs`
endef