mirror of
https://git.proxmox.com/git/proxmox-backup-qemu
synced 2025-10-19 11:20:43 +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
|
cd build; dpkg-buildpackage -b -us -uc --no-pre-clean
|
||||||
lintian $(DEB)
|
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
|
distclean: clean
|
||||||
|
|
||||||
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