I have attached an updated set of patches. The ChangeLog between the
last set and this is:

1. Fix missing $srcdir in proxied-https tests.
2. Remove extra CFLAGS env var from .travis.yml
3. Add extra suppressions to allow the test to pass on travis

However, the build still fails on Travis. It fails because the
assertion in the progress bar fires each time during the Turkish
locale tests. As it turns out, the translators decided not to heed the
specific instruction provided to them to keep the translation for ETA
to 3 columns only. As a result, the length of the progress bar exceeds
the screen width, causing the assertion to fire. I think we should
talk to the translators about this issue and ask them to fix it.


Apart from that, of there are no issues with this set of patches, I
will push them sometime later today.
Currently, a build on travis will be fired when a commit is pushed on
my GitHub clone of Wget. I will look into the POST API later. Maybe
some kind of a local git hook may work.

On 11 October 2015 at 17:18, Tim Rühsen <[email protected]> wrote:
> Am Sonntag, 11. Oktober 2015, 12:32:14 schrieb Darshit Shah:
>> However, I did come across a small problem. Travis currently accepts
>> open source build requests from GitHub only. So I don't think we can
>> use it from Savannah. Would it be a problem if we pushed the
>> .travis.yml to master and allow the builds to be fired from one of our
>> GitHub clones?
>
> Hi Darshit,
>
> IMO there is no problem.
>
> If there is no possibility to trigger a build from Savannah, we have to use
> Github. Or we have to trigger it manually...
>
> That is something that other people already asked for:
> http://kamranicus.com/blog/2015/03/29/triggering-a-travis-build-programmatically/
>
> Maybe you could give this a try (maybe using wget instead of curl ?).
> http://docs.travis-ci.com/user/triggering-builds/
>
> Regards, Tim
>



-- 
Thanking You,
Darshit Shah
From d1c26efb5f041a19d4997e00d69532aafb423425 Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Mon, 12 Oct 2015 05:19:18 +0530
Subject: [PATCH 4/4] Add suppressions for Valgrind 3.4 bug

    * tests/valgrind-suppressions: With valgrind<3.8 there seems to be a
    false positive with the memchr() method. Write specific suppressions
    to eliminate those.

    This patch *SHOULD* be revoked once most environments have
    progressed from Valgrind 3.4. Most importantly, if Travis-CI has,
    then revoke this patch.
---
 tests/valgrind-suppressions     | 172 ++++++++++++++++++++++++++++++++++++++++
 tests/valgrind-suppressions-ssl | 138 ++++++++++++++++++++++++++++++++
 2 files changed, 310 insertions(+)

diff --git a/tests/valgrind-suppressions b/tests/valgrind-suppressions
index 4026770..0d48eaf 100644
--- a/tests/valgrind-suppressions
+++ b/tests/valgrind-suppressions
@@ -6,3 +6,175 @@
    fun:idn_encode
    fun:url_parse
 }
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_set_cookie
+   fun:cookie_handle_set_cookie
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_set_cookie
+   fun:cookie_handle_set_cookie
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:extract_param
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:extract_param
+   fun:parse_set_cookie.constprop.4
+   fun:cookie_handle_set_cookie
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
diff --git a/tests/valgrind-suppressions-ssl b/tests/valgrind-suppressions-ssl
index 0250785..acfe273 100644
--- a/tests/valgrind-suppressions-ssl
+++ b/tests/valgrind-suppressions-ssl
@@ -26,3 +26,141 @@
    ...
    obj:*/libcrypto.so.*
 }
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   ...
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_set_cookie
+   fun:cookie_handle_set_cookie
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   ...
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:modify_param_name
+   fun:extract_param
+   fun:parse_set_cookie
+   fun:cookie_handle_set_cookie
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   ...
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
+
+{
+   Valgrind 3.4 bug suppresion
+   Memcheck:Cond
+   fun:memrchr
+   fun:parse_content_disposition
+   fun:check_file_output
+   fun:gethttp
+   fun:http_loop
+   fun:retrieve_url
+   fun:main
+}
-- 
2.6.1

From 5b33049a71aa07e579197c60175e08b16c973412 Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Sun, 11 Oct 2015 01:16:14 +0530
Subject: [PATCH 3/4] Add .travis.yml file and script for Travis-CI

    * .travis.yml: New file. Configuration file for Travis
    * contrib/travis-ci: New Bash script to compile and run tests on
    Travis.
---
 .travis.yml       | 36 ++++++++++++++++++++++++++++++++++++
 contrib/travis-ci | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+)
 create mode 100644 .travis.yml
 create mode 100755 contrib/travis-ci

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..bb8bfa4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,36 @@
+# TODO:
+# Send change emails to bug-wget
+sudo: no
+
+language: c
+
+compiler:
+    - gcc
+    - clang
+
+env:
+    - PERLLIB=$PERLLIB:../../tests PERL5LIB=$PERL5LIB:../../tests
+
+addons:
+    apt:
+        packages:
+            - automake
+            - autoconf
+            - autopoint
+            - flex
+            - texinfo
+            - pkg-config
+            - libgnutls-dev
+            - libssl-dev
+            - make
+            - libhttp-daemon-perl
+            - libio-socket-ssl-perl
+            - libidn11-dev
+            - gettext
+            - texlive
+            - python3
+            - valgrind
+            - language-pack-tr
+
+script:
+    - ./contrib/travis-ci
diff --git a/contrib/travis-ci b/contrib/travis-ci
new file mode 100755
index 0000000..696906a
--- /dev/null
+++ b/contrib/travis-ci
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Set a stricter bash mode
+set -e
+set -u
+
+# Get the number of cores on the machine. We can use any many to run tests in
+# parallel.
+# CORES=$(grep -c ^processor /proc/cpuinfo 2> /dev/null || echo 0)
+# if [ $CORES -lt 1 ]; then CORES=1; fi
+#
+# For some reason. /proc/cpuinfo reports 16 cores on Travis, while the docs
+# claim that each instance has only 2 cores. We belive the docs and force a
+# value of only 2 here.
+CORES=2
+
+# Run `make distclean`. This is currently not required and results in an error
+# on Travis. But eventually with cached directories, this may be useful.
+echo "Running: make distclean"
+make distclean > /dev/null || true
+echo
+
+# Define a large number of Warning flags for the compiler. Hopefully, someone
+# will sit and analyze the output to clean the warnings from the codebase.
+CFLAGS="-std=c89 -pedantic -O2 -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition"
+
+# A cachefile for ./configure. I'm not sure if this is any useful.
+CACHEFILE=$PWD/config_check.cache
+
+# measure time consumed and print it at the end of the script
+START=$(date +%s.%N)
+
+echo "Running: ./bootstrap"
+./bootstrap
+echo
+
+# the compiler changed, so we have to remove the cache file here
+rm -f "$CACHEFILE"
+
+for options in "" "--with-ssl=openssl"; do
+  export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE --enable-valgrind-tests $options"
+  echo "  ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS=\"$CFLAGS\""
+  ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS"
+
+  for xLCALL in C tr_TR.utf8; do
+    export TESTS_ENVIRONMENT="LC_ALL=$xLCALL VALGRIND_TESTS=1"
+    echo "    TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\" make distcheck CFLAGS=$CFLAGS -j$CORES"
+    make distcheck CFLAGS="$CFLAGS" -j$CORES
+  done
+done
+
+END=$(date +%s.%N)
+echo "Duration: $((END-START))"
-- 
2.6.1

From eac08410981186a49f8f36ea490e0a4f6d436d74 Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Sun, 11 Oct 2015 00:37:01 +0530
Subject: [PATCH 2/4] Fix Test-ftp-pasv-not-supported.px

    * tests/Test-ftp-pasv-not-supported.px: We do *NOT* expect any
    downloaded files. Also, do not negate the Test response.

    The test originally expected a downloaded file, but this is not
    true. As a result, the test would fail and return exit code 1. This
    was presumably the reason why the test result was negated before
    returning to the shell. Fix this issue, so that the test runs
    correctly without any hacks.
---
 tests/Test-ftp-pasv-not-supported.px | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/tests/Test-ftp-pasv-not-supported.px b/tests/Test-ftp-pasv-not-supported.px
index 97d0610..1a473ad 100755
--- a/tests/Test-ftp-pasv-not-supported.px
+++ b/tests/Test-ftp-pasv-not-supported.px
@@ -41,11 +41,7 @@ my $cmdline = $WgetTest::WGETPATH . " -S ftp://localhost:{{port}}/afile.txt";;
 
 my $expected_error_code = 8;
 
-my %expected_downloaded_files = (
-    'afile.txt' => {
-        content => $afile,
-    },
-);
+my %expected_downloaded_files = ();
 
 ###############################################################################
 
@@ -55,6 +51,6 @@ my $the_test = FTPTest->new (
                              cmdline => $cmdline,
                              errcode => $expected_error_code,
                              output => \%expected_downloaded_files);
-exit !$the_test->run();
+exit $the_test->run();
 
 # vim: et ts=4 sw=4
-- 
2.6.1

From c4faec22d9e38634001d310233226eccced3a889 Mon Sep 17 00:00:00 2001
From: Darshit Shah <[email protected]>
Date: Mon, 28 Sep 2015 20:53:48 +0530
Subject: [PATCH 1/4] Fix make distcheck failures in Perl SSL Tests

    * tests/Makefile.am: Add valgrind-suppressions-ssl to EXTRA_DIST
    * tests/Test-proxied-https-auth-keepalive.px: Find valgrind in
    correct path during make distcheck
    * tests/Test-proxied-https-auth.px: Same
---
 tests/Makefile.am                          |  2 +-
 tests/Test-proxied-https-auth-keepalive.px | 13 ++++++++++++-
 tests/Test-proxied-https-auth.px           | 13 ++++++++++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index daf162f..d3bb6a5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -132,7 +132,7 @@ PX_TESTS = \
 
 EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              WgetTests.pm WgetFeature.pm WgetFeature.cfg $(PX_TESTS) \
-             certs valgrind-suppressions
+             certs valgrind-suppressions valgrind-suppressions-ssl
 
 check_PROGRAMS = unit-tests
 unit_tests_SOURCES =
diff --git a/tests/Test-proxied-https-auth-keepalive.px b/tests/Test-proxied-https-auth-keepalive.px
index e407f31..b5c2b66 100755
--- a/tests/Test-proxied-https-auth-keepalive.px
+++ b/tests/Test-proxied-https-auth-keepalive.px
@@ -12,6 +12,8 @@ my $cert_path;
 my $key_path;
 my $srcdir;
 
+our $VALGRIND_SUPP_FILE;
+
 if (@ARGV) {
     $srcdir = shift @ARGV;
 } elsif (defined $ENV{srcdir}) {
@@ -146,11 +148,20 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee"
     . " https://no.such.domain/needs-auth.txt";;
 $cmdline =~ s/{{port}}/$SOCKET->sockport()/e;
 
+if (defined $srcdir) {
+    $VALGRIND_SUPP_FILE = $srcdir . '/valgrind-suppressions-ssl';
+} else {
+    $VALGRIND_SUPP_FILE = './valgrind-suppressions-ssl';
+}
+
 my $valgrind = $ENV{VALGRIND_TESTS};
 if (!defined $valgrind || $valgrind eq "" || $valgrind == 0) {
     # Valgrind not requested - leave $cmdline as it is
 } elsif ($valgrind == 1) {
-    $cmdline = "valgrind --suppressions=valgrind-suppressions-ssl --error-exitcode=301 --leak-check=yes --track-origins=yes " . $cmdline;
+    $cmdline =
+      'valgrind --suppressions=' . $VALGRIND_SUPP_FILE
+      . ' --error-exitcode=301 --leak-check=yes --track-origins=yes '
+      . $cmdline;
 } else {
     $cmdline = $valgrind . " " . $cmdline;
 }
diff --git a/tests/Test-proxied-https-auth.px b/tests/Test-proxied-https-auth.px
index 1daefe8..e797ef1 100755
--- a/tests/Test-proxied-https-auth.px
+++ b/tests/Test-proxied-https-auth.px
@@ -12,6 +12,8 @@ my $cert_path;
 my $key_path;
 my $srcdir;
 
+our $VALGRIND_SUPP_FILE;
+
 if (@ARGV) {
     $srcdir = shift @ARGV;
 } elsif (defined $ENV{srcdir}) {
@@ -145,11 +147,20 @@ my $cmdline = $WgetTest::WGETPATH . " --user=fiddle-dee-dee"
     . " https://no.such.domain/needs-auth.txt";;
 $cmdline =~ s/{{port}}/$SOCKET->sockport()/e;
 
+if (defined $srcdir) {
+    $VALGRIND_SUPP_FILE = $srcdir . '/valgrind-suppressions-ssl';
+} else {
+    $VALGRIND_SUPP_FILE = './valgrind-suppressions-ssl';
+}
+
 my $valgrind = $ENV{VALGRIND_TESTS};
 if (!defined $valgrind || $valgrind eq "" || $valgrind == 0) {
     # Valgrind not requested - leave $cmdline as it is
 } elsif ($valgrind == 1) {
-    $cmdline = "valgrind  --suppressions=valgrind-suppressions-ssl --error-exitcode=301 --leak-check=yes --track-origins=yes " . $cmdline;
+    $cmdline =
+      'valgrind --suppressions=' . $VALGRIND_SUPP_FILE
+      . ' --error-exitcode=301 --leak-check=yes --track-origins=yes '
+      . $cmdline;
 } else {
     $cmdline = $valgrind . " " . $cmdline;
 }
-- 
2.6.1

Reply via email to