diff options
author | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-11-04 15:36:50 +0100 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-11-04 15:45:07 +0100 |
commit | 6336058cedeecb91a64ed69143b8b5221d08e16c (patch) | |
tree | 44d735a35789cdb2a4ee28bc7afd46118eb2c75c /test/t | |
parent | ef394e8db2af178e91ed15cc63905016d00952f4 (diff) |
Testsuite: Add flavour detection
Diffstat (limited to 'test/t')
-rw-r--r-- | test/t/00-basic.t | 9 | ||||
-rw-r--r-- | test/t/samples/etc.debian8-debian-version/debian_version | 1 | ||||
-rw-r--r-- | test/t/samples/etc.debian8-os-release/debian_version | 1 | ||||
-rw-r--r-- | test/t/samples/etc.debian8-os-release/os-release | 8 | ||||
-rw-r--r-- | test/t/samples/etc.fedora24/os-release | 14 |
5 files changed, 32 insertions, 1 deletions
diff --git a/test/t/00-basic.t b/test/t/00-basic.t index ae8eff77d..49d6f6871 100644 --- a/test/t/00-basic.t +++ b/test/t/00-basic.t @@ -5,7 +5,7 @@ use Test::Exception; use lib 'lib'; use_ok 'Exim::Runtest', qw(:all) or BAIL_OUT 'Can not load the module'; -can_ok 'Exim::Runtest', qw(mailgroup dynamic_socket exim_binary); +can_ok 'Exim::Runtest', qw(mailgroup dynamic_socket exim_binary flavour flavours); pod_coverage_ok 'Exim::Runtest' => 'docs complete'; subtest 'mailgroup' => sub { @@ -39,4 +39,11 @@ subtest 'exim_binary' => sub { is_deeply [exim_binary(@argv2)], ["$cwd/t/samples/foo", @argv2[1,$#argv2]] => 'got the binary as rel path from argv'; }; +subtest 'flavour' => sub { + is flavour('t/samples/etc.debian8-os-release'), 'debian8' => 'got flavour debian8 from os-release'; + is flavour('t/samples/etc.debian8-debian-version'), 'debian8' => 'got flavour debian8 from debian_version'; + is flavour('t/samples/etc.fedora24'), 'fedora24' => 'got flavour fedora24 from os-release'; + is_deeply [flavours()], ['debian8'] => 'got available flavours'; +}; + done_testing; diff --git a/test/t/samples/etc.debian8-debian-version/debian_version b/test/t/samples/etc.debian8-debian-version/debian_version new file mode 100644 index 000000000..48c26da3e --- /dev/null +++ b/test/t/samples/etc.debian8-debian-version/debian_version @@ -0,0 +1 @@ +8.6 diff --git a/test/t/samples/etc.debian8-os-release/debian_version b/test/t/samples/etc.debian8-os-release/debian_version new file mode 100644 index 000000000..48c26da3e --- /dev/null +++ b/test/t/samples/etc.debian8-os-release/debian_version @@ -0,0 +1 @@ +8.6 diff --git a/test/t/samples/etc.debian8-os-release/os-release b/test/t/samples/etc.debian8-os-release/os-release new file mode 100644 index 000000000..120c51b08 --- /dev/null +++ b/test/t/samples/etc.debian8-os-release/os-release @@ -0,0 +1,8 @@ +PRETTY_NAME="Debian GNU/Linux 8 (jessie)" +NAME="Debian GNU/Linux" +VERSION_ID="8" +VERSION="8 (jessie)" +ID=debian +HOME_URL="http://www.debian.org/" +SUPPORT_URL="http://www.debian.org/support" +BUG_REPORT_URL="https://bugs.debian.org/" diff --git a/test/t/samples/etc.fedora24/os-release b/test/t/samples/etc.fedora24/os-release new file mode 100644 index 000000000..f962ae641 --- /dev/null +++ b/test/t/samples/etc.fedora24/os-release @@ -0,0 +1,14 @@ +NAME=Fedora +VERSION="24 (Twenty Four)" +ID=fedora +VERSION_ID=24 +PRETTY_NAME="Fedora 24 (Twenty Four)" +ANSI_COLOR="0;34" +CPE_NAME="cpe:/o:fedoraproject:fedora:24" +HOME_URL="https://fedoraproject.org/" +BUG_REPORT_URL="https://bugzilla.redhat.com/" +REDHAT_BUGZILLA_PRODUCT="Fedora" +REDHAT_BUGZILLA_PRODUCT_VERSION=24 +REDHAT_SUPPORT_PRODUCT="Fedora" +REDHAT_SUPPORT_PRODUCT_VERSION=24 +PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy |