gfs2-utils: RHEL7 - gfs2-utils tests: Build unit tests with consistent cpp flags

Andrew Price andyp at fedoraproject.org
Mon Sep 8 17:34:59 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=e0e4c93b80f36fc40a5d631a14615162f27f3371
Commit:        e0e4c93b80f36fc40a5d631a14615162f27f3371
Parent:        959b5cdce8602632d72b324b0a15b73cafc6dfd3
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Mon Sep 8 12:03:40 2014 +0200
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Mon Sep 8 11:33:53 2014 +0100

gfs2-utils tests: Build unit tests with consistent cpp flags

The check_rgrp unit test was failing on ARM and s390 due to struct
gfs2_sbd having a different alignment from libgfs2. This was due to the
unit tests being built with different options to libgfs2. Fix up the
unit test CPPFLAGS to make sure the alignment is consistent.

Also bump the test timeout for check_rgrp to make sure it completes on
slower build machines.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 tests/Makefile.am  |    6 ++++++
 tests/check_rgrp.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 70e77ef..b912dfa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,16 +15,22 @@ UNIT_CFLAGS = \
 UNIT_LDADD = \
 	$(top_builddir)/gfs2/libgfs2/libgfs2.la \
 	@check_LIBS@
+UNIT_CPPFLAGS = \
+	-D_FILE_OFFSET_BITS=64 \
+	-D_LARGEFILE64_SOURCE \
+	-D_GNU_SOURCE
 
 check_PROGRAMS = $(UNIT_TESTS)
 
 check_meta_SOURCES = $(UNIT_SOURCES) check_meta.c
 check_meta_CFLAGS = $(UNIT_CFLAGS)
 check_meta_LDADD = $(UNIT_LDADD)
+check_meta_CPPFLAGS = $(UNIT_CPPFLAGS)
 
 check_rgrp_SOURCES = $(UNIT_SOURCES) check_rgrp.c
 check_rgrp_CFLAGS = $(UNIT_CFLAGS)
 check_rgrp_LDADD = $(UNIT_LDADD)
+check_rgrp_CPPFLAGS = $(UNIT_CPPFLAGS)
 endif
 
 # The `:;' works around a Bash 3.2 bug when the output is not writable.
diff --git a/tests/check_rgrp.c b/tests/check_rgrp.c
index d113846..e5fca8d 100644
--- a/tests/check_rgrp.c
+++ b/tests/check_rgrp.c
@@ -125,7 +125,7 @@ static Suite * libgfs2_suite(void)
 	tcase_add_test(tc_rgrp, test_rbm_find_good);
 	tcase_add_test(tc_rgrp, test_rbm_find_bad);
 	tcase_add_test(tc_rgrp, test_rbm_find_lastblock);
-	tcase_set_timeout(tc_rgrp, 60);
+	tcase_set_timeout(tc_rgrp, 120);
 	suite_add_tcase(s, tc_rgrp);
 
 	return s;


More information about the cluster-commits mailing list