Revision: 6029 http://ipcop.svn.sourceforge.net/ipcop/?rev=6029&view=rev Author: gespinasse Date: 2011-11-05 09:49:23 +0000 (Sat, 05 Nov 2011) Log Message: ----------- Fix test-parse-datetime bug that depend of timezone settings and date
Add a touch (and rm cleaning) to be able to not skip rm/fail-eperm test Reword the comment on running one test, remove '-C tests' as only working for non-gnulib tests Modified Paths: -------------- ipcop/trunk/lfs/coreutils Added Paths: ----------- ipcop/trunk/src/patches/coreutils-8.14_test-parse-datetime.patch Modified: ipcop/trunk/lfs/coreutils =================================================================== --- ipcop/trunk/lfs/coreutils 2011-11-05 07:23:49 UTC (rev 6028) +++ ipcop/trunk/lfs/coreutils 2011-11-05 09:49:23 UTC (rev 6029) @@ -86,6 +86,8 @@ $(TARGET) : $(firstword $(MAKEFILE_LIST)) $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xf $(DIR_DL)/$(DL_FILE) + # drop after 8.14, fix one test failure when DST boundary is crossed + cd $(DIR_APP)/gnulib-tests && patch -p2 -i $(DIR_PATCHES)/$(THISAPP)_test-parse-datetime.patch ifeq "$(STAGE)" "toolchain" # hostname is used on base stage by coreutils configure and perl base tests @@ -111,18 +113,23 @@ cd $(DIR_APP) && sed -i 's/doc man//' Makefile cd $(DIR_APP) && make -j $(PARALLELISM) ifeq "$(RUNNING_TEST)" "yes" - # to debug, run one test with make check -C tests TESTS=<test-name> VERBOSE=yes - # no test should fail there + # To run just one test, add TESTS=[full-test-name] VERBOSE=yes + + # To be able to run rm/fail-eperm test + touch /tmp/root-owned + + # No test should fail there cd $(DIR_APP) && make -j 1 NON_ROOT_USERNAME=nobody check-root &> $(DIR_TEST)/$(THISAPP)-$(STAGE_ORDER).log - # temporary during tests + # Temporary during tests echo "dummy:x:1000:nobody" >> /etc/group - # to be able to run non-root tests as nobody + # To be able to run non-root tests as nobody chown -R nobody $(DIR_APP) cd $(DIR_APP) && su-tools nobody -s /bin/bash -c "make -j 1 -k RUN_EXPENSIVE_TESTS=yes check" \ >> $(DIR_TEST)/$(THISAPP)-$(STAGE_ORDER).log 2>&1 endif # need to be outside ifeq/endif in case a test fail and you recompile without test -sed -i '/dummy/d' /etc/group + rm -f /tmp/root-owned cd $(DIR_APP) && make install-exec mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin Added: ipcop/trunk/src/patches/coreutils-8.14_test-parse-datetime.patch =================================================================== --- ipcop/trunk/src/patches/coreutils-8.14_test-parse-datetime.patch (rev 0) +++ ipcop/trunk/src/patches/coreutils-8.14_test-parse-datetime.patch 2011-11-05 09:49:23 UTC (rev 6029) @@ -0,0 +1,92 @@ +http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=56ddf0fdeb52ce76718e0594db4f567401e90a2c + +test-parse-datetime.c: avoid new DST-related false positive test failure + +authorJim Meyering <meyer...@redhat.com> + Sun, 30 Oct 2011 17:12:54 +0000 (18:12 +0100) +committerJim Meyering <meyer...@redhat.com> + Sun, 30 Oct 2011 17:12:54 +0000 (18:12 +0100) + + +* tests/test-parse-datetime.c (gmt_offset): Determine the "gmt_offset" based on the time/date we'll convert, not the current time. +Otherwise, the moment we cross a DST boundary like today's in Europe, (CEST to CET), that offset ends up being one hour off. + +diff --git a/tests/test-parse-datetime.c b/tests/test-parse-datetime.c + +index b9d08a6..22fe9bc 100644 (file) + + +--- a/tests/test-parse-datetime.c ++++ b/tests/test-parse-datetime.c +@@ -94,20 +94,17 @@ tm_diff (struct tm const *a, struct tm const *b) + #endif /* ! HAVE_TM_GMTOFF */ + + static long +-gmt_offset () ++gmt_offset (time_t s) + { +- time_t now; + long gmtoff; + +- time (&now); +- + #if !HAVE_TM_GMTOFF +- struct tm tm_local = *localtime (&now); +- struct tm tm_gmt = *gmtime (&now); ++ struct tm tm_local = *localtime (&s); ++ struct tm tm_gmt = *gmtime (&s); + + gmtoff = tm_diff (&tm_local, &tm_gmt); + #else +- gmtoff = localtime (&now)->tm_gmtoff; ++ gmtoff = localtime (&s)->tm_gmtoff; + #endif + + return gmtoff; +@@ -123,16 +120,17 @@ main (int argc _GL_UNUSED, char **argv) + const char *p; + int i; + long gmtoff; ++ time_t ref_time = 1304250918; + + set_program_name (argv[0]); + +- gmtoff = gmt_offset (); ++ gmtoff = gmt_offset (ref_time); + + + /* ISO 8601 extended date and time of day representation, + 'T' separator, local time zone */ + p = "2011-05-01T11:55:18"; +- expected.tv_sec = 1304250918 - gmtoff; ++ expected.tv_sec = ref_time - gmtoff; + expected.tv_nsec = 0; + ASSERT (parse_datetime (&result, p, 0)); + LOG (p, expected, result); +@@ -142,7 +140,7 @@ main (int argc _GL_UNUSED, char **argv) + /* ISO 8601 extended date and time of day representation, + ' ' separator, local time zone */ + p = "2011-05-01 11:55:18"; +- expected.tv_sec = 1304250918 - gmtoff; ++ expected.tv_sec = ref_time - gmtoff; + expected.tv_nsec = 0; + ASSERT (parse_datetime (&result, p, 0)); + LOG (p, expected, result); +@@ -153,7 +151,7 @@ main (int argc _GL_UNUSED, char **argv) + /* ISO 8601, extended date and time of day representation, + 'T' separator, UTC */ + p = "2011-05-01T11:55:18Z"; +- expected.tv_sec = 1304250918; ++ expected.tv_sec = ref_time; + expected.tv_nsec = 0; + ASSERT (parse_datetime (&result, p, 0)); + LOG (p, expected, result); +@@ -163,7 +161,7 @@ main (int argc _GL_UNUSED, char **argv) + /* ISO 8601, extended date and time of day representation, + ' ' separator, UTC */ + p = "2011-05-01 11:55:18Z"; +- expected.tv_sec = 1304250918; ++ expected.tv_sec = ref_time; + expected.tv_nsec = 0; + ASSERT (parse_datetime (&result, p, 0)); + LOG (p, expected, result); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Ipcop-svn mailing list Ipcop-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipcop-svn