From d51ba9e7e139803feaded8c04ab3074c2b82ce31 Mon Sep 17 00:00:00 2001 From: nephros Date: Tue, 26 Nov 2024 14:24:44 +0100 Subject: [PATCH 1/2] Test Cases: Add a git-style file-add patch --- .../add-a-file-git-style.pro | 6 ++++++ tests/patching/add-a-file-git-style/makediff.sh | 17 +++++++++++++++++ .../add-a-file-git-style/patch/patch.json | 11 +++++++++++ .../patch/unified_diff.patch | 7 +++++++ tests/patching/patching.pro | 1 + 5 files changed, 42 insertions(+) create mode 100644 tests/patching/add-a-file-git-style/add-a-file-git-style.pro create mode 100755 tests/patching/add-a-file-git-style/makediff.sh create mode 100644 tests/patching/add-a-file-git-style/patch/patch.json create mode 100644 tests/patching/add-a-file-git-style/patch/unified_diff.patch diff --git a/tests/patching/add-a-file-git-style/add-a-file-git-style.pro b/tests/patching/add-a-file-git-style/add-a-file-git-style.pro new file mode 100644 index 00000000..a871fa99 --- /dev/null +++ b/tests/patching/add-a-file-git-style/add-a-file-git-style.pro @@ -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 diff --git a/tests/patching/add-a-file-git-style/makediff.sh b/tests/patching/add-a-file-git-style/makediff.sh new file mode 100755 index 00000000..c9e24867 --- /dev/null +++ b/tests/patching/add-a-file-git-style/makediff.sh @@ -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 " --all -m "initial commit" >/dev/null +git commit --allow-empty --author "Test User " --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 " --all -m "second commit" >/dev/null +git diff HEAD~1 | tee ../patch/unified_diff.patch +popd >/dev/null + +rm -rf repo diff --git a/tests/patching/add-a-file-git-style/patch/patch.json b/tests/patching/add-a-file-git-style/patch/patch.json new file mode 100644 index 00000000..70632be8 --- /dev/null +++ b/tests/patching/add-a-file-git-style/patch/patch.json @@ -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 jeck that the reulting 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" + ] +} diff --git a/tests/patching/add-a-file-git-style/patch/unified_diff.patch b/tests/patching/add-a-file-git-style/patch/unified_diff.patch new file mode 100644 index 00000000..d344380d --- /dev/null +++ b/tests/patching/add-a-file-git-style/patch/unified_diff.patch @@ -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 diff --git a/tests/patching/patching.pro b/tests/patching/patching.pro index 27feb265..f70f3302 100644 --- a/tests/patching/patching.pro +++ b/tests/patching/patching.pro @@ -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 \ From 2035d28ea161149c141adcb6767601c1865817f0 Mon Sep 17 00:00:00 2001 From: olf Date: Thu, 28 Nov 2024 00:48:19 +0100 Subject: [PATCH 2/2] [patch.json] Fix typos --- tests/patching/add-a-file-git-style/patch/patch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/patching/add-a-file-git-style/patch/patch.json b/tests/patching/add-a-file-git-style/patch/patch.json index 70632be8..6b6a5c69 100644 --- a/tests/patching/add-a-file-git-style/patch/patch.json +++ b/tests/patching/add-a-file-git-style/patch/patch.json @@ -1,5 +1,5 @@ { - "description": "Patchmanager Test Case: Add a new file, Using a git-style patch. This changes nothing in the UI, please just jeck that the reulting files are in the correct place.", + "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",