Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7D70F429E25 for ; Fri, 18 Nov 2011 07:21:23 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cq9zqGObnP0L for ; Fri, 18 Nov 2011 07:21:19 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 24F09431FD0 for ; Fri, 18 Nov 2011 07:21:19 -0800 (PST) Received: by bkaq10 with SMTP id q10so3867369bka.26 for ; Fri, 18 Nov 2011 07:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; bh=smtuXbAO23TMkFSZFRtFuAcsRmCBSXLvFMUXsFsdZgw=; b=k6f/NgUMiT32249/OIrDeD7dWoy0ypwuho/9vnVDm3MKt9PYRuCgcgzkXJnZJFkUdm D0NJsdKyzz31wv92YbbutARcI78ElkBn2G/apZL5CgGD7mDOQBiru4g03f6zm3jtPdvu 0sxU9Gtc0j8InAGn4pckz0imdcSlvcxXIDIkg= Received: by 10.205.132.148 with SMTP id hu20mr3705286bkc.117.1321629677441; Fri, 18 Nov 2011 07:21:17 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id cc2sm969523bkb.8.2011.11.18.07.21.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Nov 2011 07:21:16 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH] test: fix sed error in basic tests Date: Fri, 18 Nov 2011 19:21:00 +0400 Message-Id: <1321629660-10093-1-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.7.3 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 15:21:23 -0000 The error is easy to miss, because the test passes and stderr is not printed. But if you run basic tests in verbose mode (./basic --verbose), you get: sed: can't read notmuch-test: No such file or directory The issue is that sed command is given two files: notmuch-test and $TEST_DIRECTORY/notmuch-test. And there is no notmuch-test file in the current directory (test/tmp.basic/). The patch just removes the non-existing file from the sed command. --- test/basic | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/test/basic b/test/basic index 38db2ba..032c9f7 100755 --- a/test/basic +++ b/test/basic @@ -34,41 +34,41 @@ test_expect_success 'tests clean up after themselves' ' ' cleaner=no test_expect_code 1 'tests clean up even after a failure' ' test_when_finished cleaner=yes && (exit 1) ' if test $clean$cleaner != yesyes then say "bug in test framework: cleanup commands do not work reliably" exit 1 fi test_expect_code 2 'failure to clean up causes the test to fail' ' test_when_finished "(exit 2)" ' # Ensure that all tests are being run test_begin_subtest 'Ensure that all available tests will be run by notmuch-test' -eval $(sed -n -e '/^TESTS="$/,/^"$/p' notmuch-test $TEST_DIRECTORY/notmuch-test) +eval $(sed -n -e '/^TESTS="$/,/^"$/p' $TEST_DIRECTORY/notmuch-test) tests_in_suite=$(for i in $TESTS; do echo $i; done | sort) available=$(ls -1 $TEST_DIRECTORY/ | \ sed -r -e "/^(aggregate-results.sh|Makefile|Makefile.local|notmuch-test)/d" \ -e "/^(README|test-lib.sh|test-lib.el|test-results|tmp.*|valgrind|corpus*)/d" \ -e "/^(emacs.expected-output|smtp-dummy|smtp-dummy.c|test-verbose|symbol-test.cc)/d" \ -e "/^(test.expected-output|.*~)/d" \ -e "/^(gnupg-secret-key.asc)/d" \ -e "/^(gnupg-secret-key.NOTE)/d" \ -e "/^(atomicity.gdb)/d" \ | sort) test_expect_equal "$tests_in_suite" "$available" EXPECTED=$TEST_DIRECTORY/test.expected-output suppress_diff_date() { sed -e 's/\(.*\-\-\- test-verbose\.4\.\expected\).*/\1/' \ -e 's/\(.*\+\+\+ test-verbose\.4\.\output\).*/\1/' } test_begin_subtest "Ensure that test output is suppressed unless the test fails" output=$(cd $TEST_DIRECTORY; ./test-verbose 2>&1 | suppress_diff_date) -- 1.7.7.3