* [PATCH 0/5] Btrfs-progs updates to build
@ 2014-11-07 17:06 David Sterba
2014-11-07 17:06 ` [PATCH 1/5] btrfs-progs: build, add basic build test for library David Sterba
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
We've managed to break build of snapper two times now, a new make rule
'test-build' should help us to check the build. Static build is not required to
pass due to dependency on static libs that may not be widely available.
David Sterba (5):
btrfs-progs: build, add basic build test for library
btrfs-progs: build, add make target for a build test
btrfs-progs: build, gather utilities that are not built by default
btrfs-progs: build, update the clean rule
btrfs-progs: update .gitignore
.gitignore | 4 ++++
Makefile | 28 ++++++++++++++++++++----
library-test.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 97 insertions(+), 4 deletions(-)
create mode 100644 library-test.c
--
1.8.4.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] btrfs-progs: build, add basic build test for library
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
@ 2014-11-07 17:06 ` David Sterba
2014-11-07 17:06 ` [PATCH 2/5] btrfs-progs: build, add make target for a build test David Sterba
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Basic test based on snapper code that uses the send stream API.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Makefile | 8 +++++++
library-test.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
create mode 100644 library-test.c
diff --git a/Makefile b/Makefile
index 203597c3e23e..99b03658a406 100644
--- a/Makefile
+++ b/Makefile
@@ -240,6 +240,14 @@ send-test: $(objects) $(libs) send-test.o
@echo " [LD] $@"
$(Q)$(CC) $(CFLAGS) -o send-test $(objects) send-test.o $(LDFLAGS) $(LIBS) -lpthread
+library-test: $(libs_shared) library-test.o
+ @echo " [LD] $@"
+ $(Q)$(CC) $(CFLAGS) -o library-test library-test.o $(LDFLAGS) -lbtrfs
+
+library-test.static: $(libs_static) library-test.o
+ @echo " [LD] $@"
+ $(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
+
manpages:
$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
diff --git a/library-test.c b/library-test.c
new file mode 100644
index 000000000000..142188a73b45
--- /dev/null
+++ b/library-test.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2014 SUSE. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
+#include "kerncompat.h"
+#include "version.h"
+#include "send-stream.h"
+
+/*
+ * Reduced code snippet from snapper.git/snapper/Btrfs.cc
+ */
+struct btrfs_send_ops send_ops = {
+ .subvol = NULL,
+ .snapshot = NULL,
+ .mkfile = NULL,
+ .mkdir = NULL,
+ .mknod = NULL,
+ .mkfifo = NULL,
+ .mksock = NULL,
+ .symlink = NULL,
+ .rename = NULL,
+ .link = NULL,
+ .unlink = NULL,
+ .rmdir = NULL,
+ .write = NULL,
+ .clone = NULL,
+ .set_xattr = NULL,
+ .remove_xattr = NULL,
+ .truncate = NULL,
+ .chmod = NULL,
+ .chown = NULL,
+ .utimes = NULL,
+ .update_extent = NULL,
+};
+
+/*
+ * Link test only, not intended to be executed.
+ */
+static int test_send_stream_api() {
+ int ret;
+ int fd = -1;
+
+#if BTRFS_LIB_VERSION < 101
+ ret = btrfs_read_and_process_send_stream(fd, &send_ops, NULL, 0);
+#else
+ ret = btrfs_read_and_process_send_stream(fd, &send_ops, NULL, 0, 1);
+#endif
+ return ret;
+}
+
+int main() {
+ test_send_stream_api();
+
+ return 0;
+}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] btrfs-progs: build, add make target for a build test
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
2014-11-07 17:06 ` [PATCH 1/5] btrfs-progs: build, add basic build test for library David Sterba
@ 2014-11-07 17:06 ` David Sterba
2014-11-07 17:06 ` [PATCH 3/5] btrfs-progs: build, gather utilities that are not built by default David Sterba
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
A quick check that everything still builds.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Makefile | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Makefile b/Makefile
index 99b03658a406..126dc593ddfb 100644
--- a/Makefile
+++ b/Makefile
@@ -248,6 +248,13 @@ library-test.static: $(libs_static) library-test.o
@echo " [LD] $@"
$(Q)$(CC) $(CFLAGS) -o library-test-static library-test.o $(LDFLAGS) $(libs_static)
+test-build:
+ $(MAKE) clean-all
+ $(MAKE) library-test
+ -$(MAKE) library-test.static
+ $(MAKE) -j 8 all
+ -$(MAKE) -j 8 static
+
manpages:
$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] btrfs-progs: build, gather utilities that are not built by default
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
2014-11-07 17:06 ` [PATCH 1/5] btrfs-progs: build, add basic build test for library David Sterba
2014-11-07 17:06 ` [PATCH 2/5] btrfs-progs: build, add make target for a build test David Sterba
@ 2014-11-07 17:06 ` David Sterba
2014-11-07 17:06 ` [PATCH 4/5] btrfs-progs: build, update the clean rule David Sterba
2014-11-07 17:06 ` [PATCH 5/5] btrfs-progs: update .gitignore David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Add them to build test and to clean rules.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Makefile | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 126dc593ddfb..b597ad8e9b89 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,9 @@ progs = mkfs.btrfs btrfs-debug-tree btrfsck \
btrfs btrfs-map-logical btrfs-image btrfs-zero-log btrfs-convert \
btrfs-find-root btrfstune btrfs-show-super
+progs_extra = btrfs-corrupt-block btrfs-fragments btrfs-calc-size \
+ btrfs-select-super
+
progs_static = $(foreach p,$(progs),$(p).static)
# external libs required by various binaries; for btrfs-foo,
@@ -254,6 +257,7 @@ test-build:
-$(MAKE) library-test.static
$(MAKE) -j 8 all
-$(MAKE) -j 8 static
+ $(MAKE) -j 8 $(progs_extra)
manpages:
$(Q)$(MAKE) $(MAKEOPTS) -C Documentation
@@ -266,7 +270,8 @@ clean: $(CLEANDIRS)
btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfsck \
btrfs.static mkfs.btrfs.static btrfs-calc-size \
version.h $(check_defs) \
- $(libs) $(lib_links)
+ $(libs) $(lib_links) \
+ $(progs_extra)
clean-doc:
@echo "Cleaning Documentation"
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] btrfs-progs: build, update the clean rule
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
` (2 preceding siblings ...)
2014-11-07 17:06 ` [PATCH 3/5] btrfs-progs: build, gather utilities that are not built by default David Sterba
@ 2014-11-07 17:06 ` David Sterba
2014-11-07 17:06 ` [PATCH 5/5] btrfs-progs: update .gitignore David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Remove duplicate files, add extra progs, add library test binaries.
Signed-off-by: David Sterba <dsterba@suse.cz>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index b597ad8e9b89..4cae30c179b5 100644
--- a/Makefile
+++ b/Makefile
@@ -266,12 +266,12 @@ clean-all: clean-doc clean
clean: $(CLEANDIRS)
@echo "Cleaning"
- $(Q)rm -f $(progs) cscope.out *.o *.o.d btrfs-convert btrfs-image btrfs-select-super \
- btrfs-zero-log btrfstune dir-test ioctl-test quick-test send-test btrfsck \
- btrfs.static mkfs.btrfs.static btrfs-calc-size \
+ $(Q)rm -f $(progs) cscope.out *.o *.o.d \
+ dir-test ioctl-test quick-test send-test library-test library-test-static \
+ btrfs.static mkfs.btrfs.static \
version.h $(check_defs) \
$(libs) $(lib_links) \
- $(progs_extra)
+ $(progs_static) $(progs_extra)
clean-doc:
@echo "Cleaning Documentation"
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] btrfs-progs: update .gitignore
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
` (3 preceding siblings ...)
2014-11-07 17:06 ` [PATCH 4/5] btrfs-progs: build, update the clean rule David Sterba
@ 2014-11-07 17:06 ` David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-11-07 17:06 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Signed-off-by: David Sterba <dsterba@suse.cz>
---
.gitignore | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.gitignore b/.gitignore
index fc8c07a22f7f..e637b170714b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*.o
*.static.o
*.o.d
+tags
.cc-defines.h
version.h
version
@@ -30,8 +31,11 @@ btrfs-show-super
btrfs-zero-log
btrfs-corrupt-block
btrfs-select-super
+btrfs-calc-size
btrfstune
libbtrfs.a
libbtrfs.so
libbtrfs.so.0
libbtrfs.so.0.1
+library-test
+library-test-static
--
1.8.4.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-11-07 17:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 17:06 [PATCH 0/5] Btrfs-progs updates to build David Sterba
2014-11-07 17:06 ` [PATCH 1/5] btrfs-progs: build, add basic build test for library David Sterba
2014-11-07 17:06 ` [PATCH 2/5] btrfs-progs: build, add make target for a build test David Sterba
2014-11-07 17:06 ` [PATCH 3/5] btrfs-progs: build, gather utilities that are not built by default David Sterba
2014-11-07 17:06 ` [PATCH 4/5] btrfs-progs: build, update the clean rule David Sterba
2014-11-07 17:06 ` [PATCH 5/5] btrfs-progs: update .gitignore David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.