mirror of
https://github.com/kdave/btrfs-progs
synced 2025-05-05 01:17:56 +00:00
btrfs-progs: test: extend library-test coverage
Add test for linkage error of lookup_path_rootid. The built binary has to be run to catch also run-time errors. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e5362f5feb
commit
15f2582e54
@ -446,10 +446,14 @@ test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64
|
|||||||
library-test: $(libs_shared) library-test.o
|
library-test: $(libs_shared) library-test.o
|
||||||
@echo " [LD] $@"
|
@echo " [LD] $@"
|
||||||
$(Q)$(CC) $(CFLAGS) -o library-test library-test.o $(LDFLAGS) -lbtrfs
|
$(Q)$(CC) $(CFLAGS) -o library-test library-test.o $(LDFLAGS) -lbtrfs
|
||||||
|
@echo " [TEST] $@"
|
||||||
|
$(Q)./$@
|
||||||
|
|
||||||
library-test.static: $(libs_static) library-test.o
|
library-test.static: $(libs_static) library-test.o
|
||||||
@echo " [LD] $@"
|
@echo " [LD] $@"
|
||||||
$(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
|
$(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
|
||||||
|
@echo " [TEST] $@"
|
||||||
|
$(Q)./$@
|
||||||
|
|
||||||
test-build: test-build-pre test-build-real
|
test-build: test-build-pre test-build-real
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "send-stream.h"
|
#include "send-stream.h"
|
||||||
|
#include "btrfs-list.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reduced code snippet from snapper.git/snapper/Btrfs.cc
|
* Reduced code snippet from snapper.git/snapper/Btrfs.cc
|
||||||
@ -62,8 +63,15 @@ static int test_send_stream_api() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int test_list_rootid() {
|
||||||
|
u64 treeid;
|
||||||
|
|
||||||
|
return btrfs_list_get_path_rootid(-1, &treeid);
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
test_send_stream_api();
|
test_send_stream_api();
|
||||||
|
test_list_rootid();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user