summaryrefslogtreecommitdiffstats
path: root/test/scripts/makepkg-template-tests
diff options
context:
space:
mode:
Diffstat (limited to 'test/scripts/makepkg-template-tests')
-rw-r--r--test/scripts/makepkg-template-tests/compose-multiple-template-dirs/PKGBUILD5
-rw-r--r--test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/build/build-1.template1
-rw-r--r--test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/package/package-1.template1
-rw-r--r--test/scripts/makepkg-template-tests/compose-multiple-template-dirs/testcase-config18
-rw-r--r--test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD4
-rw-r--r--test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD.expanded6
-rw-r--r--test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/first/perl-module-1.0.template1
-rw-r--r--test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/last/perl-module-1.0.template1
-rw-r--r--test/scripts/makepkg-template-tests/last-template-dir-has-precedece/testcase-config15
-rw-r--r--test/scripts/makepkg-template-tests/missing-template-file/testcase-config2
-rw-r--r--test/scripts/makepkg-template-tests/missing-template-symlink/testcase-config4
-rw-r--r--test/scripts/makepkg-template-tests/template-without-version/testcase-config2
12 files changed, 56 insertions, 4 deletions
diff --git a/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/PKGBUILD b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/PKGBUILD
new file mode 100644
index 00000000..f8e09f8a
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/PKGBUILD
@@ -0,0 +1,5 @@
+pkgname=foo
+pkgver=1
+
+# template input; name=build; version=1;
+# template input; name=package; version=1;
diff --git a/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/build/build-1.template b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/build/build-1.template
new file mode 100644
index 00000000..81f2745c
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/build/build-1.template
@@ -0,0 +1 @@
+build() {}
diff --git a/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/package/package-1.template b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/package/package-1.template
new file mode 100644
index 00000000..056096fd
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/templates/package/package-1.template
@@ -0,0 +1 @@
+package() {}
diff --git a/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/testcase-config b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/testcase-config
new file mode 100644
index 00000000..3c58a617
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/compose-multiple-template-dirs/testcase-config
@@ -0,0 +1,18 @@
+arguments+=(--template-dir $testdir/$testcase/templates/build)
+arguments+=(--template-dir $testdir/$testcase/templates/package)
+expected_exitcode=0
+
+IFS="" read -d '' expected_output <<'EOF'
+EOF
+
+IFS="" read -d '' expected_result <<'EOF'
+pkgname=foo
+pkgver=1
+
+# template start; name=build; version=1;
+build() {}
+# template end;
+# template start; name=package; version=1;
+package() {}
+# template end;
+EOF
diff --git a/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD
new file mode 100644
index 00000000..2813b757
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD
@@ -0,0 +1,4 @@
+pkgname=foo
+pkgver=1
+
+# template input; name=perl-module; version=1.0;
diff --git a/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD.expanded b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD.expanded
new file mode 100644
index 00000000..c1dbeb4a
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/PKGBUILD.expanded
@@ -0,0 +1,6 @@
+pkgname=foo
+pkgver=1
+
+# template start; name=perl-module; version=1.0;
+this should be included
+# template end;
diff --git a/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/first/perl-module-1.0.template b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/first/perl-module-1.0.template
new file mode 100644
index 00000000..2649f782
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/first/perl-module-1.0.template
@@ -0,0 +1 @@
+this should be overwritten
diff --git a/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/last/perl-module-1.0.template b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/last/perl-module-1.0.template
new file mode 100644
index 00000000..409e8d43
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/templates/last/perl-module-1.0.template
@@ -0,0 +1 @@
+this should be included
diff --git a/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/testcase-config b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/testcase-config
new file mode 100644
index 00000000..fe38d659
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/last-template-dir-has-precedece/testcase-config
@@ -0,0 +1,15 @@
+arguments+=(--template-dir $testdir/$testcase/templates/first)
+arguments+=(--template-dir $testdir/$testcase/templates/last)
+expected_exitcode=0
+
+IFS="" read -d '' expected_output <<'EOF'
+EOF
+
+IFS="" read -d '' expected_result <<'EOF'
+pkgname=foo
+pkgver=1
+
+# template start; name=perl-module; version=1.0;
+this should be included
+# template end;
+EOF
diff --git a/test/scripts/makepkg-template-tests/missing-template-file/testcase-config b/test/scripts/makepkg-template-tests/missing-template-file/testcase-config
index bdfde40d..2fc400e3 100644
--- a/test/scripts/makepkg-template-tests/missing-template-file/testcase-config
+++ b/test/scripts/makepkg-template-tests/missing-template-file/testcase-config
@@ -7,7 +7,7 @@ _setup_testcase() {
# set IFS="" if you want trailing new lines, otherwise remove it
IFS="" read -d '' expected_output <<'EOF'
-failed to open './makepkg-template-tests/missing-template-file/templates/perl-module-1.0.template': No such file or directory
+Failed to find template file matching 'perl-module-1.0.template'
EOF
IFS="" read -d '' expected_result <<'EOF'
diff --git a/test/scripts/makepkg-template-tests/missing-template-symlink/testcase-config b/test/scripts/makepkg-template-tests/missing-template-symlink/testcase-config
index c0eabe0d..8f4c8b88 100644
--- a/test/scripts/makepkg-template-tests/missing-template-symlink/testcase-config
+++ b/test/scripts/makepkg-template-tests/missing-template-symlink/testcase-config
@@ -1,8 +1,8 @@
arguments+=()
-expected_exitcode=255
+expected_exitcode=2
IFS="" read -d '' expected_output <<'EOF'
-Couldn't detect version for template 'perl-module'
+Failed to find template file matching 'perl-module.template'
EOF
IFS="" read -d '' expected_result <<'EOF'
diff --git a/test/scripts/makepkg-template-tests/template-without-version/testcase-config b/test/scripts/makepkg-template-tests/template-without-version/testcase-config
index ec04f2fa..b078f51a 100644
--- a/test/scripts/makepkg-template-tests/template-without-version/testcase-config
+++ b/test/scripts/makepkg-template-tests/template-without-version/testcase-config
@@ -2,7 +2,7 @@ arguments+=()
expected_exitcode=255
IFS="" read -d '' expected_output <<'EOF'
-Couldn't detect version for template 'template-without_version'
+Couldn't detect version for template './makepkg-template-tests/template-without-version/templates/template-without_version.template'
EOF
IFS="" read -d '' expected_result <<'EOF'