From 8a6ca145cb1e60c0786ed1aeefc5807b371ee1b9 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Thu, 16 Feb 2023 10:38:52 +0100 Subject: [PATCH] - added some basic tests --- t/00-load.t | 9 +++++++++ t/01-manifest.t | 15 +++++++++++++++ t/01-pod-coverage.t | 24 ++++++++++++++++++++++++ t/01-pod.t | 16 ++++++++++++++++ t/01-test_basics.t | 19 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 t/00-load.t create mode 100644 t/01-manifest.t create mode 100644 t/01-pod-coverage.t create mode 100644 t/01-pod.t create mode 100644 t/01-test_basics.t diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..fda6077 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,9 @@ +#!perl -T + +use Test::More tests => 1; + +BEGIN { + use_ok( 'SLUB::LZA::Rosetta::TA' ) || print "Bail out!\n"; +} + +diag( "Testing SLUB::LZA::Rosetta::TA $SLUB::LZA::Rosetta::TA::VERSION, Perl $], $^X" ); diff --git a/t/01-manifest.t b/t/01-manifest.t new file mode 100644 index 0000000..e0b558e --- /dev/null +++ b/t/01-manifest.t @@ -0,0 +1,15 @@ +#!perl -T +use 5.006; +use strict; +use warnings; +use Test::More; + +unless ( $ENV{RELEASE_TESTING} ) { + plan( skip_all => "Author tests not required for installation" ); +} + +my $min_tcm = 0.9; +eval "use Test::CheckManifest $min_tcm"; +plan skip_all => "Test::CheckManifest $min_tcm required" if $@; + +ok_manifest(); diff --git a/t/01-pod-coverage.t b/t/01-pod-coverage.t new file mode 100644 index 0000000..f5728a5 --- /dev/null +++ b/t/01-pod-coverage.t @@ -0,0 +1,24 @@ +#!perl -T +use 5.006; +use strict; +use warnings; +use Test::More; + +unless ( $ENV{RELEASE_TESTING} ) { + plan( skip_all => "Author tests not required for installation" ); +} + +# Ensure a recent version of Test::Pod::Coverage +my $min_tpc = 1.08; +eval "use Test::Pod::Coverage $min_tpc"; +plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" + if $@; + +# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, +# but older versions don't recognize some common documentation styles +my $min_pc = 0.18; +eval "use Pod::Coverage $min_pc"; +plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" + if $@; + +all_pod_coverage_ok(); diff --git a/t/01-pod.t b/t/01-pod.t new file mode 100644 index 0000000..4d3a0ce --- /dev/null +++ b/t/01-pod.t @@ -0,0 +1,16 @@ +#!perl -T +use 5.006; +use strict; +use warnings; +use Test::More; + +unless ( $ENV{RELEASE_TESTING} ) { + plan( skip_all => "Author tests not required for installation" ); +} + +# Ensure a recent version of Test::Pod +my $min_tp = 1.22; +eval "use Test::Pod $min_tp"; +plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; + +all_pod_files_ok(); diff --git a/t/01-test_basics.t b/t/01-test_basics.t new file mode 100644 index 0000000..c31953d --- /dev/null +++ b/t/01-test_basics.t @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w +use strict; +use warnings; +use diagnostics; +use Test::More tests => 10; +use Test::Exception; + +# simple tests +use_ok("SLUB::LZA::Rosetta::TA"); +use_ok("SLUB::LZA::Rosetta::TA::Crypt"); +use_ok("SLUB::LZA::Rosetta::TA::Log"); +use_ok("SLUB::LZA::Rosetta::TA::SOAP"); +use_ok("SLUB::LZA::Rosetta::TA::SRU"); +use_ok("SLUB::LZA::Rosetta::TA::common_sru"); +use_ok("SLUB::LZA::Rosetta::TA::Command::count"); +use_ok("SLUB::LZA::Rosetta::TA::Command::init"); +use_ok("SLUB::LZA::Rosetta::TA::Command::log"); +use_ok("SLUB::LZA::Rosetta::TA::Command::search"); +1; -- GitLab