add a simple test program

This commit is contained in:
Dietmar Maurer 2019-09-13 09:57:01 +02:00
parent 14a98631c9
commit 3458ddc112
2 changed files with 25 additions and 0 deletions

View File

@ -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:

22
test.c Normal file
View File

@ -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);
}