mirror of
https://git.proxmox.com/git/proxmox-backup-qemu
synced 2025-10-18 22:18:17 +00:00
add a simple test program
This commit is contained in:
parent
14a98631c9
commit
3458ddc112
3
Makefile
3
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:
|
||||
|
22
test.c
Normal file
22
test.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user