From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Subject: [PATCH v2 1/2] modernize t7300 Date: Sun, 6 Dec 2015 09:58:25 -0500 Message-ID: <1449413906-23256-1-git-send-email-rouzier@gmail.com> References: Cc: James Rouzier , sunshine@sunshineco.com To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Dec 06 15:59:24 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a5amW-0005kA-QE for gcvg-git-2@plane.gmane.org; Sun, 06 Dec 2015 15:59:21 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbbLFO7J (ORCPT ); Sun, 6 Dec 2015 09:59:09 -0500 Received: from mail-qg0-f44.google.com ([209.85.192.44]:34410 "EHLO mail-qg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbbLFO6z (ORCPT ); Sun, 6 Dec 2015 09:58:55 -0500 Received: by qgeb1 with SMTP id b1so127317837qge.1 for ; Sun, 06 Dec 2015 06:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GllWdBAeCjG9EubL/yi7uenYyY1KvjbjBdC+ZAcEn1g=; b=TwNJ7TPvU923aUbQqay9gmlUEwsR4lGsCArWa3QM0RokwEJtiW2wSQN1U0CwV6t0n3 C2oNmsIbOltyMh5SWg/GDnpaWw0GRcblKGRYTzXLyUTqTdZ17hEpaNsTB20O0VG9GdjY Lvuc0wjyoiIvAvTHbYX31PSSFiPrij3QZMtMzLOs6oRtN1jhhuN63/f1Wy2wYOXMa5kh S9bxBJN0NRiDak285y1oNyV4Ve27uME0vFNCst6M+2jluPoVfUnoU8bQwHygaoMkaSP0 hL3/PMPnRzmxJ7TSezFS8+MxrkWGYfk4tUD+I9HanSDpUejD2lTihuZn2cjKMLlGioO+ NISA== X-Received: by 10.140.157.82 with SMTP id d79mr32746915qhd.71.1449413934593; Sun, 06 Dec 2015 06:58:54 -0800 (PST) Received: from centos6-oc.jr.inverse.ca (modemcable080.32-81-70.mc.videotron.ca. [70.81.32.80]) by smtp.gmail.com with ESMTPSA id z72sm9327588qkz.46.2015.12.06.06.58.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Dec 2015 06:58:53 -0800 (PST) X-Mailer: git-send-email 2.3.6 In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: From: James Rouzier --- t/t7300-clean.sh | 382 +++++++++++++++++++++++++++---------------------------- 1 file changed, 190 insertions(+), 192 deletions(-) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 86ceb38..d555bb6 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -28,15 +28,15 @@ test_expect_success 'git clean with skip-worktree .gitignore' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so && + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so && git update-index --no-skip-worktree .gitignore && git checkout .gitignore ' @@ -46,15 +46,15 @@ test_expect_success 'git clean' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -63,15 +63,15 @@ test_expect_success 'git clean src/' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean src/ && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -80,15 +80,15 @@ test_expect_success 'git clean src/ src/' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean src/ src/ && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -97,16 +97,16 @@ test_expect_success 'git clean with prefix' ' mkdir -p build docs src/test && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so src/test/1.c && (cd src/ && git clean) && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test ! -f src/part3.c && - test -f src/test/1.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_missing src/part3.c && + test_path_is_file src/test/1.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -160,16 +160,16 @@ test_expect_success 'git clean -d with prefix and path' ' mkdir -p build docs src/feature && touch a.out src/part3.c src/feature/file.c docs/manual.txt obj.o build/lib.so && (cd src/ && git clean -d feature/) && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test -f src/part3.c && - test ! -f src/feature/file.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_file src/part3.c && + test_path_is_missing src/feature/file.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -179,16 +179,16 @@ test_expect_success SYMLINKS 'git clean symbolic link' ' touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && ln -s docs/manual.txt src/part4.c && git clean && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test ! -f src/part4.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_missing src/part4.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -196,13 +196,13 @@ test_expect_success 'git clean with wildcard' ' touch a.clean b.clean other.c && git clean "*.clean" && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.clean && - test ! -f b.clean && - test -f other.c + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.clean && + test_path_is_missing b.clean && + test_path_is_file other.c ' @@ -211,15 +211,15 @@ test_expect_success 'git clean -n' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -n && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_file src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -228,15 +228,15 @@ test_expect_success 'git clean -d' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -d && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test ! -d docs && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_missing docs && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -245,16 +245,16 @@ test_expect_success 'git clean -d src/ examples/' ' mkdir -p build docs examples && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so examples/1.c && git clean -d src/ examples/ && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test ! -f src/part3.c && - test ! -f examples/1.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_missing src/part3.c && + test_path_is_missing examples/1.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -263,15 +263,15 @@ test_expect_success 'git clean -x' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -x && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test ! -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_missing obj.o && + test_path_is_file build/lib.so ' @@ -280,15 +280,15 @@ test_expect_success 'git clean -d -x' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -d -x && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test ! -d docs && - test ! -f obj.o && - test ! -d build + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_missing docs && + test_path_is_missing obj.o && + test_path_is_missing build ' @@ -297,15 +297,15 @@ test_expect_success 'git clean -d -x with ignored tracked directory' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -d -x -e src && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test -f src/part3.c && - test ! -d docs && - test ! -f obj.o && - test ! -d build + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_file src/part3.c && + test_path_is_missing docs && + test_path_is_missing obj.o && + test_path_is_missing build ' @@ -314,15 +314,15 @@ test_expect_success 'git clean -X' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -X && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test -f src/part3.c && - test -f docs/manual.txt && - test ! -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_file src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_missing obj.o && + test_path_is_file build/lib.so ' @@ -331,15 +331,15 @@ test_expect_success 'git clean -d -X' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -d -X && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test -f src/part3.c && - test -f docs/manual.txt && - test ! -f obj.o && - test ! -d build + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_file src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_missing obj.o && + test_path_is_missing build ' @@ -348,15 +348,15 @@ test_expect_success 'git clean -d -X with ignored tracked directory' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -d -X -e src && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test ! -f obj.o && - test ! -d build + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_missing obj.o && + test_path_is_missing build ' @@ -379,29 +379,29 @@ test_expect_success 'clean.requireForce and -n' ' mkdir -p build docs && touch a.out src/part3.c docs/manual.txt obj.o build/lib.so && git clean -n && - test -f Makefile && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test -f a.out && - test -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file Makefile && + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_file a.out && + test_path_is_file src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' test_expect_success 'clean.requireForce and -f' ' git clean -f && - test -f README && - test -f src/part1.c && - test -f src/part2.c && - test ! -f a.out && - test ! -f src/part3.c && - test -f docs/manual.txt && - test -f obj.o && - test -f build/lib.so + test_path_is_file README && + test_path_is_file src/part1.c && + test_path_is_file src/part2.c && + test_path_is_missing a.out && + test_path_is_missing src/part3.c && + test_path_is_file docs/manual.txt && + test_path_is_file obj.o && + test_path_is_file build/lib.so ' @@ -444,11 +444,11 @@ test_expect_success 'nested git work tree' ' test_commit deeply.nested deeper.world ) && git clean -f -d && - test -f foo/.git/index && - test -f foo/hello.world && - test -f baz/boo/.git/index && - test -f baz/boo/deeper.world && - ! test -d bar + test_path_is_file foo/.git/index && + test_path_is_file foo/hello.world && + test_path_is_file baz/boo/.git/index && + test_path_is_file baz/boo/deeper.world && + test_path_is_missing bar ' test_expect_success 'should clean things that almost look like git but are not' ' @@ -609,32 +609,30 @@ test_expect_success 'force removal of nested git work tree' ' test_commit deeply.nested deeper.world ) && git clean -f -f -d && - ! test -d foo && - ! test -d bar && - ! test -d baz + test_path_is_missing foo && + test_path_is_missing bar && + test_path_is_missing baz ' test_expect_success 'git clean -e' ' rm -fr repo && mkdir repo && - ( - cd repo && - git init && - touch known 1 2 3 && - git add known && - git clean -f -e 1 -e 2 && - test -e 1 && - test -e 2 && - ! (test -e 3) && - test -e known - ) + cd repo && + git init && + touch known 1 2 3 && + git add known && + git clean -f -e 1 -e 2 && + test_path_is_file 1 && + test_path_is_file 2 && + test_path_is_missing 3 && + test_path_is_file known ' test_expect_success SANITY 'git clean -d with an unreadable empty directory' ' mkdir foo && chmod a= foo && git clean -dfx foo && - ! test -d foo + test_path_is_missing foo ' test_expect_success 'git clean -d respects pathspecs (dir is prefix of pathspec)' ' -- 2.3.6