From 287f7a575e8d09d695a9a3e9a95c0196f03648f4 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 21 Dec 2014 15:48:57 +0100 Subject: test makepkg-template: Add keep-old-version Signed-off-by: Florian Pritz --- .../keep-old-version/PKGBUILD | 15 +++++++++++ .../templates/perl-bla-1.2.template | 1 + .../templates/perl-module-1.0.template | 6 +++++ .../templates/perl-module-1.1.template | 7 ++++++ .../keep-old-version/testcase-config | 29 ++++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 test/scripts/makepkg-template-tests/keep-old-version/PKGBUILD create mode 100644 test/scripts/makepkg-template-tests/keep-old-version/templates/perl-bla-1.2.template create mode 100644 test/scripts/makepkg-template-tests/keep-old-version/templates/perl-module-1.0.template create mode 100644 test/scripts/makepkg-template-tests/keep-old-version/templates/perl-module-1.1.template create mode 100644 test/scripts/makepkg-template-tests/keep-old-version/testcase-config (limited to 'test') diff --git a/test/scripts/makepkg-template-tests/keep-old-version/PKGBUILD b/test/scripts/makepkg-template-tests/keep-old-version/PKGBUILD new file mode 100644 index 00000000..09da2e03 --- /dev/null +++ b/test/scripts/makepkg-template-tests/keep-old-version/PKGBUILD @@ -0,0 +1,15 @@ +pkgname=foo +pkgver=1 + +build() { +# template start; name=perl-module; version=1.0; +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; +} diff --git a/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-bla-1.2.template b/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-bla-1.2.template new file mode 100644 index 00000000..b72e7d48 --- /dev/null +++ b/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-bla-1.2.template @@ -0,0 +1 @@ +bla bla diff --git a/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-module-1.0.template b/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-module-1.0.template new file mode 100644 index 00000000..415025ac --- /dev/null +++ b/test/scripts/makepkg-template-tests/keep-old-version/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/keep-old-version/templates/perl-module-1.1.template b/test/scripts/makepkg-template-tests/keep-old-version/templates/perl-module-1.1.template new file mode 100644 index 00000000..5ad32c3c --- /dev/null +++ b/test/scripts/makepkg-template-tests/keep-old-version/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/keep-old-version/testcase-config b/test/scripts/makepkg-template-tests/keep-old-version/testcase-config new file mode 100644 index 00000000..b9448a08 --- /dev/null +++ b/test/scripts/makepkg-template-tests/keep-old-version/testcase-config @@ -0,0 +1,29 @@ +arguments+=() +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} +} + +# set IFS="" if you want trailing new lines, otherwise remove it +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.0; +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 -- cgit v1.2.3-24-g4f1b