From 3458ddc112e723c550eb80dbfd8ad9cd168f3bb0 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 13 Sep 2019 09:57:01 +0200 Subject: [PATCH] add a simple test program --- Makefile | 3 +++ test.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test.c diff --git a/Makefile b/Makefile index ba7fa9e..47d1850 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ $(DEB): build cd build; dpkg-buildpackage -b -us -uc --no-pre-clean lintian $(DEB) +test: test.c proxmox-backup-qemu.h + gcc test.c -o test -lc -Wl,-rpath=./target/debug -L ./target/debug/ -l proxmox_backup_qemu + distclean: clean clean: diff --git a/test.c b/test.c new file mode 100644 index 0000000..c2a59d1 --- /dev/null +++ b/test.c @@ -0,0 +1,22 @@ +#include "stdio.h" +#include "stdlib.h" +#include "proxmox-backup-qemu.h" + +void test_cb(void *data) { + printf("callback called\n"); +} + +void main(void) { + + printf("This is a test\n"); + ProxmoxBackupHandle *pbs = proxmox_backup_connect(); + + printf("Start write\n"); + proxmox_backup_write_data_async(pbs, NULL, 0, test_cb, NULL); + + printf("Join\n"); + proxmox_backup_disconnect(pbs); + + printf("Done\n"); + exit(0); +}