* [PATCH 1/3] t7300: Basic tests for git-clean
@ 2007-05-06 18:09 Michael Spang
2007-05-06 19:08 ` [PATCH(amend)] Really run "git-clean -n" in test Michael Spang
0 siblings, 1 reply; 4+ messages in thread
From: Michael Spang @ 2007-05-06 18:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
This tests the -d, -n, -f, -x, and -X options to git-clean.
Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---
t/t7300-clean.sh | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 157 insertions(+), 0 deletions(-)
create mode 100755 t/t7300-clean.sh
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
new file mode 100755
index 0000000..1fb3850
--- /dev/null
+++ b/t/t7300-clean.sh
@@ -0,0 +1,157 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Michael Spang
+#
+
+test_description='git-clean basic tests'
+
+. ./test-lib.sh
+
+test_expect_success \
+ 'setup' \
+ "mkdir -p src &&
+ touch src/part1.c Makefile &&
+ echo build >> .gitignore &&
+ echo *.o >> .gitignore &&
+ git-add . &&
+ git-commit -m setup &&
+ touch src/part2.c README &&
+ git-add ."
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test -f obj.o &&
+ test -f build/lib.so"
+
+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_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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test ! -e docs &&
+ test -f obj.o &&
+ test -f build/lib.so"
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test ! -e obj.o &&
+ test -f build/lib.so"
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test ! -e docs &&
+ test ! -e obj.o &&
+ test ! -e build"
+
+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 ! -e obj.o &&
+ test -f build/lib.so"
+
+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 ! -e obj.o &&
+ test ! -e build"
+
+test_expect_failure \
+ 'clean.requireForce' \
+ "mkdir -p build docs &&
+ touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
+ git-config clean.requireForce true &&
+ git-clean"
+
+test_expect_success \
+ 'clean.requireForce and -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_expect_success \
+ 'clean.requireForce and -f' \
+ "git-clean -f &&
+ test -f README &&
+ test -f src/part1.c &&
+ test -f src/part2.c &&
+ test ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test -f obj.o &&
+ test -f build/lib.so"
+
+test_done
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH(amend)] Really run "git-clean -n" in test
2007-05-06 18:09 [PATCH 1/3] t7300: Basic tests for git-clean Michael Spang
@ 2007-05-06 19:08 ` Michael Spang
2007-05-06 19:18 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Michael Spang @ 2007-05-06 19:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---
Whoops.
t/t7300-clean.sh | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 1fb3850..1ada8da 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -125,14 +125,15 @@ test_expect_success \
test_expect_failure \
'clean.requireForce' \
- "mkdir -p build docs &&
- touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
- git-config clean.requireForce true &&
+ "git-config clean.requireForce true &&
git-clean"
test_expect_success \
'clean.requireForce and -n' \
- "test -f Makefile &&
+ "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 &&
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH(amend)] Really run "git-clean -n" in test
2007-05-06 19:08 ` [PATCH(amend)] Really run "git-clean -n" in test Michael Spang
@ 2007-05-06 19:18 ` Junio C Hamano
2007-05-06 19:50 ` [PATCH] t7300: Basic tests for git-clean Michael Spang
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2007-05-06 19:18 UTC (permalink / raw)
To: Michael Spang; +Cc: Git Mailing List
Michael Spang <mspang@uwaterloo.ca> writes:
> Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
> ---
>
> Whoops.
>
> t/t7300-clean.sh | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
Oops indeed.
* This is not an "amend"; you are following up an earlier patch of
your own. Marking such a patch as "amend" is only confusing.
Please do not do it.
> test_expect_failure \
> 'clean.requireForce' \
> - "mkdir -p build docs &&
> - touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
> - git-config clean.requireForce true &&
> + "git-config clean.requireForce true &&
> git-clean"
* Please do not do this. test_expect_failure, unless used for a
very simple single test, is almost always a bug. You would
not know which step of && chain failed, even though you may be
expecting the failure from the last one.
* I do not think a "this reformats every existing tests" patch
is needed nor wanted, but at least I'd like to see new scripts
and updates to the existing ones to be consistently formatted
like this:
test_expect_success 'name of the test' '
test body goes here &&
like this &&
and this
'
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] t7300: Basic tests for git-clean
2007-05-06 19:18 ` Junio C Hamano
@ 2007-05-06 19:50 ` Michael Spang
0 siblings, 0 replies; 4+ messages in thread
From: Michael Spang @ 2007-05-06 19:50 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
This tests the -d, -n, -f, -x, and -X options to git-clean.
Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---
This replaces 1/3 and the "amend".
I guess this is the desired format? The email you sent seemed to have
spaces on one of the lines, the others had tabs so I am using tabs.
t/t7300-clean.sh | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 180 insertions(+), 0 deletions(-)
create mode 100755 t/t7300-clean.sh
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
new file mode 100755
index 0000000..5c31e94
--- /dev/null
+++ b/t/t7300-clean.sh
@@ -0,0 +1,180 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Michael Spang
+#
+
+test_description='git-clean basic tests'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+
+ mkdir -p src &&
+ touch src/part1.c Makefile &&
+ echo build >> .gitignore &&
+ echo *.o >> .gitignore &&
+ git-add . &&
+ git-commit -m setup &&
+ touch src/part2.c README &&
+ git-add .
+
+'
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test -f obj.o &&
+ test -f build/lib.so
+
+'
+
+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_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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test ! -e docs &&
+ test -f obj.o &&
+ test -f build/lib.so
+
+'
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test ! -e obj.o &&
+ test -f build/lib.so
+
+'
+
+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 ! -e a.out &&
+ test ! -e src/part3.c &&
+ test ! -e docs &&
+ test ! -e obj.o &&
+ test ! -e build
+
+'
+
+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 ! -e obj.o &&
+ test -f build/lib.so
+
+'
+
+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 ! -e obj.o &&
+ test ! -e build
+
+'
+
+test_expect_success 'clean.requireForce' '
+
+ git-config clean.requireForce true &&
+ ! git-clean
+
+'
+
+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_expect_success 'clean.requireForce and -f' '
+
+ git-clean -f &&
+ test -f README &&
+ test -f src/part1.c &&
+ test -f src/part2.c &&
+ test ! -e a.out &&
+ test ! -e src/part3.c &&
+ test -f docs/manual.txt &&
+ test -f obj.o &&
+ test -f build/lib.so
+
+'
+
+test_done
--
1.5.2.rc1.4.g47e1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-05-06 19:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-06 18:09 [PATCH 1/3] t7300: Basic tests for git-clean Michael Spang
2007-05-06 19:08 ` [PATCH(amend)] Really run "git-clean -n" in test Michael Spang
2007-05-06 19:18 ` Junio C Hamano
2007-05-06 19:50 ` [PATCH] t7300: Basic tests for git-clean Michael Spang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).