summaryrefslogtreecommitdiffstats
path: root/src/libsigrok-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsigrok-test.c')
-rw-r--r--src/libsigrok-test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/libsigrok-test.c b/src/libsigrok-test.c
new file mode 100644
index 0000000..cfb23c6
--- /dev/null
+++ b/src/libsigrok-test.c
@@ -0,0 +1,26 @@
+/*
+ * This file is part of MXE. See LICENSE.md for licensing information.
+ */
+
+#include <stdio.h>
+#include <libsigrok/libsigrok.h>
+
+int main(int argc, char **argv)
+{
+ int ret;
+ struct sr_context *sr_ctx;
+ (void)argc;
+ (void)argv;
+
+ if ((ret = sr_init(&sr_ctx)) != SR_OK) {
+ printf("Error initializing libsigrok (%s): %s.\n",
+ sr_strerror_name(ret), sr_strerror(ret));
+ return 1;
+ }
+ if ((ret = sr_exit(sr_ctx)) != SR_OK) {
+ printf("Error shutting down libsigrok (%s): %s.\n",
+ sr_strerror_name(ret), sr_strerror(ret));
+ return 1;
+ }
+ return 0;
+}