Blob Blame History Raw
commit e0e4c93b80f36fc40a5d631a14615162f27f3371
Author: Andrew Price <anprice@redhat.com>
Date:   Mon Sep 8 12:03:40 2014 +0200

    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@redhat.com>

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;