Test case for apply
authorJoachim Breitner <mail@joachim-breitner.de>
Sun, 22 Aug 2010 17:59:05 +0000 (17:59 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Sun, 22 Aug 2010 17:59:05 +0000 (17:59 +0000)
tests/apply1/after/changes [new file with mode: 0644]
tests/apply1/after/patches/series [new file with mode: 0644]
tests/apply1/after/patches/testpatch [new file with mode: 0644]
tests/apply1/after/src/code [new file with mode: 0644]
tests/apply1/after/src/newfile [new file with mode: 0644]
tests/apply1/before/changes [new file with mode: 0644]
tests/apply1/before/patches/series [new file with mode: 0644]
tests/apply1/before/patches/testpatch [new file with mode: 0644]
tests/apply1/before/src/code [new file with mode: 0644]
tests/apply1/before/src/oldfile [new file with mode: 0644]
tests/apply1/run.sh [new file with mode: 0644]

diff --git a/tests/apply1/after/changes b/tests/apply1/after/changes
new file mode 100644 (file)
index 0000000..325ceab
--- /dev/null
@@ -0,0 +1,5 @@
+unreleased:
+ * Some change
+
+version 0.1:
+ * Initial Version
diff --git a/tests/apply1/after/patches/series b/tests/apply1/after/patches/series
new file mode 100644 (file)
index 0000000..9f964bd
--- /dev/null
@@ -0,0 +1 @@
+testpatch
diff --git a/tests/apply1/after/patches/testpatch b/tests/apply1/after/patches/testpatch
new file mode 100644 (file)
index 0000000..a3cc8de
--- /dev/null
@@ -0,0 +1,32 @@
+Index: before/changes
+===================================================================
+--- before.orig/changes        2010-08-22 19:25:48.000000000 +0200
++++ before/changes     2010-08-22 19:26:49.000000000 +0200
+@@ -1,5 +1,6 @@
+ unreleased:
+  * Some change
++ * Adding feature A
+ version 0.1:
+  * Initial Version
+Index: before/src/code
+===================================================================
+--- before.orig/src/code       2010-08-22 19:25:48.000000000 +0200
++++ before/src/code    2010-08-22 19:26:54.000000000 +0200
+@@ -1,3 +1,3 @@
+ This is the code.
+-It has some lines.
++It has some lines that we change to implement feature A.
+ That we want to edit.
+Index: before/src/newfile
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ before/src/newfile 2010-08-22 19:27:23.000000000 +0200
+@@ -0,0 +1 @@
++This is a newly added file.
+Index: before/src/oldfile
+===================================================================
+--- before.orig/src/oldfile    2010-08-22 19:27:45.000000000 +0200
++++ /dev/null  1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-This file should be removed
diff --git a/tests/apply1/after/src/code b/tests/apply1/after/src/code
new file mode 100644 (file)
index 0000000..c43dbbc
--- /dev/null
@@ -0,0 +1,3 @@
+This is the code.
+It has some lines that we change to implement feature A.
+That we want to edit.
diff --git a/tests/apply1/after/src/newfile b/tests/apply1/after/src/newfile
new file mode 100644 (file)
index 0000000..1751cf6
--- /dev/null
@@ -0,0 +1 @@
+This is a newly added file.
diff --git a/tests/apply1/before/changes b/tests/apply1/before/changes
new file mode 100644 (file)
index 0000000..325ceab
--- /dev/null
@@ -0,0 +1,5 @@
+unreleased:
+ * Some change
+
+version 0.1:
+ * Initial Version
diff --git a/tests/apply1/before/patches/series b/tests/apply1/before/patches/series
new file mode 100644 (file)
index 0000000..9f964bd
--- /dev/null
@@ -0,0 +1 @@
+testpatch
diff --git a/tests/apply1/before/patches/testpatch b/tests/apply1/before/patches/testpatch
new file mode 100644 (file)
index 0000000..a3cc8de
--- /dev/null
@@ -0,0 +1,32 @@
+Index: before/changes
+===================================================================
+--- before.orig/changes        2010-08-22 19:25:48.000000000 +0200
++++ before/changes     2010-08-22 19:26:49.000000000 +0200
+@@ -1,5 +1,6 @@
+ unreleased:
+  * Some change
++ * Adding feature A
+ version 0.1:
+  * Initial Version
+Index: before/src/code
+===================================================================
+--- before.orig/src/code       2010-08-22 19:25:48.000000000 +0200
++++ before/src/code    2010-08-22 19:26:54.000000000 +0200
+@@ -1,3 +1,3 @@
+ This is the code.
+-It has some lines.
++It has some lines that we change to implement feature A.
+ That we want to edit.
+Index: before/src/newfile
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ before/src/newfile 2010-08-22 19:27:23.000000000 +0200
+@@ -0,0 +1 @@
++This is a newly added file.
+Index: before/src/oldfile
+===================================================================
+--- before.orig/src/oldfile    2010-08-22 19:27:45.000000000 +0200
++++ /dev/null  1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-This file should be removed
diff --git a/tests/apply1/before/src/code b/tests/apply1/before/src/code
new file mode 100644 (file)
index 0000000..1646544
--- /dev/null
@@ -0,0 +1,3 @@
+This is the code.
+It has some lines.
+That we want to edit.
diff --git a/tests/apply1/before/src/oldfile b/tests/apply1/before/src/oldfile
new file mode 100644 (file)
index 0000000..fcd381c
--- /dev/null
@@ -0,0 +1 @@
+This file should be removed
diff --git a/tests/apply1/run.sh b/tests/apply1/run.sh
new file mode 100644 (file)
index 0000000..eb85884
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -e
+
+cd $(dirname $0)
+
+if test -x ../../dist/build/ipatch/ipatch
+then IPATCH=$PWD/../../dist/build/ipatch/ipatch
+else IPATCH=ipatch
+fi
+
+rm -rf tmp
+
+cp -r before/ tmp
+cd tmp
+export PATH="..:$PATH"
+( echo nyyyyyy
+)| $IPATCH apply patches/testpatch
+
+cd ..
+diff -ur after tmp
+rm -rf tmp
+echo "Test done"
+