summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2017-03-16 05:16:58 (GMT)
committerBoris Pek <tehnick-8@yandex.ru>2017-03-20 14:35:18 (GMT)
commitb57256b51ff29c2184a5b89ad1b9b209065c2f84 (patch)
treebd7afa5808d49e0494ff0ec1977bb1bb96a77a5a
parent0758a5b0f43cbc81477487e615c5a047de927567 (diff)
downloadmxe-b57256b51ff29c2184a5b89ad1b9b209065c2f84.zip
mxe-b57256b51ff29c2184a5b89ad1b9b209065c2f84.tar.gz
mxe-b57256b51ff29c2184a5b89ad1b9b209065c2f84.tar.bz2
libotr: add test
-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