Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-12-21 15:48:57 +0100
committerAllan McRae <allan@archlinux.org>2015-01-11 18:58:25 +1000
commit0108884952415b4e7c5fe93a1422f441f4bea0aa (patch)
treebabc49508986c264136f8d5fb896749304559694 /test
parentd5f703729f60b604eec0e2d7bc59bb6cc273e66f (diff)
test makepkg-template: Add update-version-with-newest-option
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'test')
-rw-r--r--test/scripts/makepkg-template-tests/update-version-with-newest-option/PKGBUILD7
-rw-r--r--test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-bla-1.2.template1
-rw-r--r--test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.0.template6
-rw-r--r--test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.1.template7
-rw-r--r--test/scripts/makepkg-template-tests/update-version-with-newest-option/testcase-config29
5 files changed, 50 insertions, 0 deletions
diff --git a/test/scripts/makepkg-template-tests/update-version-with-newest-option/PKGBUILD b/test/scripts/makepkg-template-tests/update-version-with-newest-option/PKGBUILD
new file mode 100644
index 00000000..e1687cc8
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/update-version-with-newest-option/PKGBUILD
@@ -0,0 +1,7 @@
+pkgname=foo
+pkgver=1
+
+build() {
+# template start; name=perl-module; version=1.0
+# template end;
+}
diff --git a/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-bla-1.2.template b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-bla-1.2.template
new file mode 100644
index 00000000..b72e7d48
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-bla-1.2.template
@@ -0,0 +1 @@
+bla bla
diff --git a/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.0.template b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.0.template
new file mode 100644
index 00000000..415025ac
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.0.template
@@ -0,0 +1,6 @@
+echo "before bla template"
+# template input; name=perl-bla
+echo "after bla template"
+perl Makefile.pl
+make
+make install
diff --git a/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.1.template b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.1.template
new file mode 100644
index 00000000..5ad32c3c
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/update-version-with-newest-option/templates/perl-module-1.1.template
@@ -0,0 +1,7 @@
+echo "perl-module version 1.1"
+echo "before bla template"
+# template input; name=perl-bla
+echo "after bla template"
+perl Makefile.pl
+make
+make install
diff --git a/test/scripts/makepkg-template-tests/update-version-with-newest-option/testcase-config b/test/scripts/makepkg-template-tests/update-version-with-newest-option/testcase-config
new file mode 100644
index 00000000..5956a0a2
--- /dev/null
+++ b/test/scripts/makepkg-template-tests/update-version-with-newest-option/testcase-config
@@ -0,0 +1,29 @@
+arguments+=(-n)
+expected_exitcode=0
+
+_setup_testcase() {
+ ln -sr "templates/"{perl-bla-1.2.template,perl-bla.template}
+ ln -sr "templates/"{perl-module-1.1.template,perl-module.template}
+}
+
+IFS="" read -d '' expected_output <<'EOF'
+EOF
+
+IFS="" read -d '' expected_result <<'EOF'
+pkgname=foo
+pkgver=1
+
+build() {
+# template start; name=perl-module; version=1.1;
+echo "perl-module version 1.1"
+echo "before bla template"
+# template start; name=perl-bla; version=1.2;
+bla bla
+# template end;
+echo "after bla template"
+perl Makefile.pl
+make
+make install
+# template end;
+}
+EOF