summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-10-06 13:40:24 +0200
committerDavid Sterba <dsterba@suse.com>2016-10-24 14:57:19 +0200
commit6f306e8d62f8cca23fcb3aa56b3594d1ac531359 (patch)
tree3e85bfcabec04b1c4c0fe6bd25d86a5cd3caf467 /Makefile.in
parent32a168684e1564f54245f907e1a7c9c6b8d6a5d8 (diff)
btrfs-progs: tests: make the ioctl-test actually useful
Enhance the test to verify ioctl uniqueness, compare the defined values against the hardcoded expected values, and take care of the 32bit/64bit compatibility workarounds. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in27
1 files changed, 24 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index 95c42705..844423d4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -392,9 +392,30 @@ quick-test: $(objects) $(libs) quick-test.o
@echo " [LD] $@"
$(Q)$(CC) $(CFLAGS) -o quick-test $(objects) $(libs) quick-test.o $(LDFLAGS) $(LIBS)
-ioctl-test: $(objects) $(libs) ioctl-test.o
- @echo " [LD] $@"
- $(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) $(libs) ioctl-test.o $(LDFLAGS) $(LIBS)
+ioctl-test-32.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
+ @echo " [CC32] $@"
+ $(Q)$(CC) $(CFLAGS) -m32 -c $< -o $@
+
+ioctl-test-64.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
+ @echo " [CC64] $@"
+ $(Q)$(CC) $(CFLAGS) -m64 -c $< -o $@
+
+ioctl-test-32: ioctl-test-32.o
+ @echo " [LD32] $@"
+ $(Q)$(CC) $(CFLAGS) -m32 -o $@ $< $(LDFLAGS)
+ @echo " ?[PAHOLE] $@.pahole"
+ -$(Q)pahole $@ > $@.pahole
+
+ioctl-test-64: ioctl-test-64.o
+ @echo " [LD64] $@"
+ $(Q)$(CC) $(CFLAGS) -m64 -o $@ $< $(LDFLAGS)
+ @echo " ?[PAHOLE] $@.pahole"
+ -$(Q)pahole $@ > $@.pahole
+
+test-ioctl: ioctl-test-32 ioctl-test-64
+ @echo " [TEST/ioctl]"
+ $(Q)./ioctl-test-32 > ioctl-test-32.log
+ $(Q)./ioctl-test-64 > ioctl-test-64.log
send-test: $(objects) $(libs) send-test.o
@echo " [LD] $@"