Skip to content

Commit

Permalink
Add three new Testcases: Version Checks (sailfishos-patches#430)
Browse files Browse the repository at this point in the history
THese allow playing around with version check strictness

Co-authored-by: nephros <nemo@pgxperiiia10>
  • Loading branch information
nephros and nephros authored May 7, 2023
1 parent 0b27fc4 commit f1c2200
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/patching/patch-a-bit-newer/patch-a-bit-newer.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-patch-a-bit-newer
patch.files = patch/unified_diff.patch patch/patch.json

INSTALLS += patch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this was added by patch-a-bit-newer patch
14 changes: 14 additions & 0 deletions tests/patching/patch-a-bit-newer/patch/patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"description": "Patchmanager Test Case: The version specified in the meta data is likely newer than this SFOS version (X.Y.0.99).\n PM should not allow to activate or install it.",
"name": "pm-test-patch-a-bit-newer",
"display_name": "PM Test Case 4-3: a bit newer",
"category": "other",
"author": "patchmanager",
"version": "1.0.0",
"compatible": [
"4.5.0.99",
"4.6.0.99",
"5.0.0.99",
"5.9.0.99"
]
}
5 changes: 5 additions & 0 deletions tests/patching/patch-a-bit-newer/patch/unified_diff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer b/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer
--- a/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer 1970-01-01 01:00:00.000000000 +0100
+++ b/usr/share/patchmanager-test/testfile-added-by-patch-a-bit-newer 2023-04-15 19:09:07.568614812 +0200
@@ -0,0 +1 @@
+this was added by patch-a-bit-newer patch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this was added by patch-too-new patch
6 changes: 6 additions & 0 deletions tests/patching/patch-too-new/patch-too-new.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-patch-too-new
patch.files = patch/unified_diff.patch patch/patch.json

INSTALLS += patch
11 changes: 11 additions & 0 deletions tests/patching/patch-too-new/patch/patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"description": "Patchmanager Test Case: The version specified in the meta data is very science fiction.\n PM should not allow to activate or install it.",
"name": "pm-test-patch-too-new",
"display_name": "PM Test Case 4-2: Too New",
"category": "other",
"author": "patchmanager",
"version": "1.0.0",
"compatible": [
"9.9.9.0"
]
}
5 changes: 5 additions & 0 deletions tests/patching/patch-too-new/patch/unified_diff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-too-new b/usr/share/patchmanager-test/testfile-added-by-patch-too-new
--- a/usr/share/patchmanager-test/testfile-added-by-patch-too-new 1970-01-01 01:00:00.000000000 +0100
+++ b/usr/share/patchmanager-test/testfile-added-by-patch-too-new 2023-04-15 18:55:53.475630091 +0200
@@ -0,0 +1 @@
+this was added by patch-too-new patch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this was added by patch-too-old patch
6 changes: 6 additions & 0 deletions tests/patching/patch-too-old/patch-too-old.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-patch-too-old
patch.files = patch/unified_diff.patch patch/patch.json

INSTALLS += patch
11 changes: 11 additions & 0 deletions tests/patching/patch-too-old/patch/patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"description": "Patchmanager Test Case: The version specified in the meta data is too old.\n PM should not allow to activate or install it.",
"name": "pm-test-patch-too-old",
"display_name": "PM Test Case 4-1: Too Old",
"category": "other",
"author": "patchmanager",
"version": "1.0.0",
"compatible": [
"0.0.1.10"
]
}
5 changes: 5 additions & 0 deletions tests/patching/patch-too-old/patch/unified_diff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
diff -Naur a/usr/share/patchmanager-test/testfile-added-by-patch-too-old b/usr/share/patchmanager-test/testfile-added-by-patch-too-old
--- a/usr/share/patchmanager-test/testfile-added-by-patch-too-old 1970-01-01 01:00:00.000000000 +0100
+++ b/usr/share/patchmanager-test/testfile-added-by-patch-too-old 2023-04-15 18:46:39.415912679 +0200
@@ -0,0 +1 @@
+this was added by patch-too-old patch
3 changes: 3 additions & 0 deletions tests/patching/patching.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
TEMPLATE = subdirs
SUBDIRS = app \
add-a-file \
patch-too-new \
patch-too-old \
patch-a-bit-newer \
32-to-64 \
64-to-32 \
32-to-64-alt \
Expand Down

0 comments on commit f1c2200

Please sign in to comment.