Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/patching/add-a-file-git-style/add-a-file-git-style.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEMPLATE = aux

patch.path = /usr/share/patchmanager/patches/pm-test-case-add-a-file-git-style
patch.files = patch/unified_diff.patch patch/patch.json

INSTALLS += patch
17 changes: 17 additions & 0 deletions tests/patching/add-a-file-git-style/makediff.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

mkdir repo
pushd repo >/dev/null
git init
mkdir -p usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests
printf 'this file already exists\n' > usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests/pre-existing-file
git add --all >/dev/null
git commit --author "Test User <test@example.org>" --all -m "initial commit" >/dev/null
git commit --allow-empty --author "Test User <test@example.org>" --all -m "empty commit" >/dev/null
printf 'this file is new\n' > usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests/post-existing-file
git add --all >/dev/null
git commit --author "Test User <test@example.org>" --all -m "second commit" >/dev/null
git diff HEAD~1 | tee ../patch/unified_diff.patch
popd >/dev/null

rm -rf repo
11 changes: 11 additions & 0 deletions tests/patching/add-a-file-git-style/patch/patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"description": "Patchmanager Test Case: Add a new file, using a git-style patch. This changes nothing in the UI, please just check that the resulting files are in the correct place.",
"name": "pm-test-case-add-a-file-git-style",
"display_name": "PM Test Case 3.1",
"category": "other",
"author": "patchmanager",
"version": "1.0.0",
"compatible": [
"5.0.0.29"
]
}
7 changes: 7 additions & 0 deletions tests/patching/add-a-file-git-style/patch/unified_diff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests/post-existing-file b/usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests/post-existing-file
new file mode 100644
index 0000000..1848ba0
--- /dev/null
+++ b/usr/lib/qt5/qml/org/SfietKonstantin/patchmanagertests/post-existing-file
@@ -0,0 +1 @@
+this file is new
1 change: 1 addition & 0 deletions tests/patching/patching.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = app \
add-a-file \
add-a-file-git-style \
patch-too-new \
patch-too-old \
patch-a-bit-newer \
Expand Down