git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [StGIT PATCH 0/2] New and improved tests
@ 2007-08-07  2:43 Karl Hasselström
  2007-08-07  2:43 ` [StGIT PATCH 1/2] New test: make sure that popping doesn't change patch order Karl Hasselström
  2007-08-07  2:43 ` [StGIT PATCH 2/2] Verify patch status during the test Karl Hasselström
  0 siblings, 2 replies; 3+ messages in thread
From: Karl Hasselström @ 2007-08-07  2:43 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

One new and one improved test, both primarily useful for making sure
the DAG pseries doesn't break anything, since no one else has managed
to produce bugs that mess up the patch order.

This far. So they might be worth having anyway. :-)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [StGIT PATCH 1/2] New test: make sure that popping doesn't change patch order
  2007-08-07  2:43 [StGIT PATCH 0/2] New and improved tests Karl Hasselström
@ 2007-08-07  2:43 ` Karl Hasselström
  2007-08-07  2:43 ` [StGIT PATCH 2/2] Verify patch status during the test Karl Hasselström
  1 sibling, 0 replies; 3+ messages in thread
From: Karl Hasselström @ 2007-08-07  2:43 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

This is mostly useful in conjunction with the DAG appliedness patches,
since getting this right with a plain series file _ought_ to be
trivial. Nevertheless ...

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 t/t1203-pop.sh |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/t/t1203-pop.sh b/t/t1203-pop.sh
new file mode 100755
index 0000000..0a311d4
--- /dev/null
+++ b/t/t1203-pop.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright (c) 2007 Karl Hasselström
+test_description='Test the pop command'
+. ./test-lib.sh
+
+test_expect_success \
+    'Initialize the StGIT repository' \
+    'stg init'
+
+test_expect_success \
+    'Create ten patches' '
+    for i in 0 1 2 3 4 5 6 7 8 9; do
+        stg new p$i -m p$i;
+    done &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4 p5 p6 p7 p8 p9" ] &&
+    [ "$(echo $(stg unapplied))" = "" ]
+'
+
+test_expect_success \
+    'Pop half the patches' '
+    stg pop -n 5 &&
+    [ "$(echo $(stg applied))" = "p0 p1 p2 p3 p4" ] &&
+    [ "$(echo $(stg unapplied))" = "p5 p6 p7 p8 p9" ]
+'
+
+test_expect_success \
+    'Pop the remaining patches' '
+    stg pop -a &&
+    [ "$(echo $(stg applied))" = "" ] &&
+    [ "$(echo $(stg unapplied))" = "p0 p1 p2 p3 p4 p5 p6 p7 p8 p9" ]
+'
+
+test_done

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [StGIT PATCH 2/2] Verify patch status during the test
  2007-08-07  2:43 [StGIT PATCH 0/2] New and improved tests Karl Hasselström
  2007-08-07  2:43 ` [StGIT PATCH 1/2] New test: make sure that popping doesn't change patch order Karl Hasselström
@ 2007-08-07  2:43 ` Karl Hasselström
  1 sibling, 0 replies; 3+ messages in thread
From: Karl Hasselström @ 2007-08-07  2:43 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 t/t1200-push-modified.sh |   55 +++++++++++++++++++++++++++-------------------
 1 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/t/t1200-push-modified.sh b/t/t1200-push-modified.sh
index 324b3b0..0e408d0 100755
--- a/t/t1200-push-modified.sh
+++ b/t/t1200-push-modified.sh
@@ -19,23 +19,26 @@ specify --merged, then rollback and retry with the correct flag.'
 test_create_repo foo
 
 test_expect_success \
-    'Clone tree and setup changes' \
-    "stg clone foo bar &&
-     (cd bar && stg new p1 -m p1 &&
-      printf 'a\nc\n' > file && stg add file && stg refresh &&
-      stg new p2 -m p2 &&
-      printf 'a\nb\nc\n' > file && stg refresh
-     )
-"
+    'Clone tree and setup changes' '
+    stg clone foo bar &&
+    (
+        cd bar && stg new p1 -m p1 &&
+        printf "a\nc\n" > file && stg add file && stg refresh &&
+        stg new p2 -m p2 &&
+        printf "a\nb\nc\n" > file && stg refresh &&
+        [ "$(echo $(stg applied))" = "p1 p2" ] &&
+        [ "$(echo $(stg unapplied))" = "" ]
+    )
+'
 
 test_expect_success \
-    'Port those patches to orig tree' \
-    '(cd foo &&
-      GIT_DIR=../bar/.git git-format-patch --stdout \
-          $(cd ../bar && stg id base@master)..HEAD |
-      git-am -3 -k
-     )
-    '
+    'Port those patches to orig tree' '
+    (
+        cd foo &&
+        GIT_DIR=../bar/.git git-format-patch --stdout \
+          $(cd ../bar && stg id base@master)..HEAD | git-am -3 -k
+    )
+'
 
 test_expect_success \
     'Pull to sync with parent, preparing for the problem' \
@@ -51,15 +54,21 @@ test_expect_failure \
 "
 
 test_expect_success \
-    'Rollback the push' \
-    "(cd bar && stg push --undo
-     )
-"
+    'Rollback the push' '
+    (
+        cd bar && stg push --undo &&
+        [ "$(echo $(stg applied))" = "" ] &&
+        [ "$(echo $(stg unapplied))" = "p1 p2" ]
+    )
+'
 
 test_expect_success \
-    'Push those patches while checking they were merged upstream' \
-    "(cd bar && stg push --merged --all
-     )
-"
+    'Push those patches while checking they were merged upstream' '
+    (
+        cd bar && stg push --merged --all
+        [ "$(echo $(stg applied))" = "p1 p2" ] &&
+        [ "$(echo $(stg unapplied))" = "" ]
+    )
+'
 
 test_done

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-07  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07  2:43 [StGIT PATCH 0/2] New and improved tests Karl Hasselström
2007-08-07  2:43 ` [StGIT PATCH 1/2] New test: make sure that popping doesn't change patch order Karl Hasselström
2007-08-07  2:43 ` [StGIT PATCH 2/2] Verify patch status during the test Karl Hasselström

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).