diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-05-30 00:05:24 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-05-30 00:05:24 +0200 |
commit | e00794a00569655792868bc812cb824c5f522e25 (patch) | |
tree | eaa02583438d4716c262201224d36a1a87384eef | |
parent | c68be800c7403569927ccbc5459c96404a7ba9cf (diff) | |
download | sbotools2-e00794a00569655792868bc812cb824c5f522e25.tar.xz |
test files: add restore_perf_dummy and make_slackbuilds_txt to tests that would need them
-rwxr-xr-x | t/04-install.t | 3 | ||||
-rwxr-xr-x | t/05-upgrade.t | 3 | ||||
-rwxr-xr-x | t/06-remove.t | 4 | ||||
-rwxr-xr-x | t/07-fail.t | 3 | ||||
-rwxr-xr-x | t/08-env.t | 4 | ||||
-rwxr-xr-x | t/09-multilib.t | 3 | ||||
-rwxr-xr-x | t/12-readme.t | 3 | ||||
-rwxr-xr-x | t/13-local-check.t | 3 | ||||
-rwxr-xr-x | t/14-jobs.t | 4 | ||||
-rwxr-xr-x | t/16-clean.t | 1 | ||||
-rwxr-xr-x | t/19-pkg-dir.t | 3 |
11 files changed, 22 insertions, 12 deletions
diff --git a/t/04-install.t b/t/04-install.t index 3156e9a..5b84a5c 100755 --- a/t/04-install.t +++ b/t/04-install.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove restore_perf_dummy /; if ($ENV{TEST_INSTALL}) { plan tests => 18; @@ -41,6 +41,7 @@ cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO"); system("mv /usr/sbo/repo/* /usr/sbo"); +restore_perf_dummy(); # 1-3: sboinstall nonexistentslackbuild sboinstall 'nonexistentslackbuild', { input => "y\ny", expected => qr/nonexistentslackbuild added to install queue.*Install queue: nonexistentslackbuild/s }; diff --git a/t/05-upgrade.t b/t/05-upgrade.t index 7082483..aaf2451 100755 --- a/t/05-upgrade.t +++ b/t/05-upgrade.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade restore_perf_dummy /; if ($ENV{TEST_INSTALL}) { plan tests => 14; @@ -55,6 +55,7 @@ sub cleanup { cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO"); +restore_perf_dummy(); sub install { cleanup(); diff --git a/t/06-remove.t b/t/06-remove.t index 97d53a9..1e92b52 100755 --- a/t/06-remove.t +++ b/t/06-remove.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove restore_perf_dummy /; if ($ENV{TEST_INSTALL}) { plan tests => 13; @@ -44,7 +44,7 @@ sub cleanup { cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO"); - +restore_perf_dummy(); # 1: sboremove nonexistentslackbuild sboinstall 'nonexistentslackbuild', { input => "y\ny", test => 0 }; diff --git a/t/07-fail.t b/t/07-fail.t index cd6dced..217bef3 100755 --- a/t/07-fail.t +++ b/t/07-fail.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo set_repo sboinstall sboremove sbosnap /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo set_repo sboinstall sboremove sbosnap restore_perf_dummy /; use File::Temp 'tempdir'; if ($ENV{TEST_INSTALL}) { @@ -84,6 +84,7 @@ sub cleanup { cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO-fail"); +restore_perf_dummy(); # 1: Failing slackbuild script sboinstall 'failingslackbuild', { input => "y\ny", expected => qr/Failures:\n failingslackbuild: failingslackbuild.SlackBuild return non-zero\n\z/, exit => 3 }; @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall restore_perf_dummy /; if ($ENV{TEST_INSTALL}) { plan tests => 5; @@ -38,7 +38,7 @@ sub cleanup { cleanup('/tmp/SBo', '/tmp'); make_slackbuilds_txt(); set_lo("$RealBin/LO"); - +restore_perf_dummy(); SKIP: { skip "Not testing unset OUTPUT", 1 if exists $ENV{TEST_OUTPUT} and $ENV{TEST_OUTPUT} ne ''; diff --git a/t/09-multilib.t b/t/09-multilib.t index 3c8602d..470b0a9 100755 --- a/t/09-multilib.t +++ b/t/09-multilib.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboclean /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboclean restore_perf_dummy /; use File::Temp 'tempdir'; $ENV{TEST_MULTILIB} //= 0; @@ -40,6 +40,7 @@ sub cleanup { cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO-multilib"); +restore_perf_dummy(); # 1: Testing multilibsbo sboinstall qw/ -p multilibsbo /, { input => "y\ny\ny", expected => qr/Cleaning for multilibsbo-compat32-1[.]0[.][.][.]\n/ }; diff --git a/t/12-readme.t b/t/12-readme.t index cfa73cf..ff69ac2 100755 --- a/t/12-readme.t +++ b/t/12-readme.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo sboinstall sboremove restore_perf_dummy /; if ($ENV{TEST_INSTALL}) { plan tests => 10; @@ -31,6 +31,7 @@ sub cleanup { cleanup(); make_slackbuilds_txt(); set_lo("$RealBin/LO-readme"); +restore_perf_dummy(); # 1: sboinstall envsettingtest - fail sboinstall 'envsettingtest', { input => "n\ny\ny", exit => 3, expected => qr{It looks like envsettingtest has options; would you like to set any when the slackbuild is run.*FOO isn't bar!.*envsettingtest: envsettingtest.SlackBuild return non-zero}s }; diff --git a/t/13-local-check.t b/t/13-local-check.t index edfdb78..3d79a9f 100755 --- a/t/13-local-check.t +++ b/t/13-local-check.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ make_slackbuilds_txt set_lo set_repo sbosnap sbocheck sboinstall sbofind /; +use Test::Sbotools qw/ make_slackbuilds_txt set_lo set_repo sbosnap sbocheck sboinstall sbofind restore_perf_dummy /; if ($ENV{TEST_INSTALL} and $ENV{TRAVIS}) { plan tests => 4; @@ -45,6 +45,7 @@ make_slackbuilds_txt(); set_lo("$RealBin/LO"); setup_gitrepo(); set_repo("file://$RealBin/gitrepo/"); +restore_perf_dummy(); # 1-2: sbofind without having a repo yet sbofind 'nonexistentslackbuild', { input => "n", expected => qr/It looks like you haven't run "sbosnap fetch" yet\.\nWould you like me to do this now\?.*Please run "sbosnap fetch"/ }; diff --git a/t/14-jobs.t b/t/14-jobs.t index fba1882..da1dee8 100755 --- a/t/14-jobs.t +++ b/t/14-jobs.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ set_lo set_jobs sboinstall sboremove sboconfig /; +use Test::Sbotools qw/ set_lo set_jobs sboinstall sboremove sboconfig restore_perf_dummy make_slackbuilds_txt /; if ($ENV{TEST_INSTALL}) { plan tests => 6; @@ -25,8 +25,10 @@ sub cleanup { } cleanup(); +make_slackbuilds_txt(); set_lo("$RealBin/LO-jobs"); set_jobs("FALSE"); +restore_perf_dummy(); # 1: sboinstall with jobs set to FALSE { diff --git a/t/16-clean.t b/t/16-clean.t index d46ede0..f935c10 100755 --- a/t/16-clean.t +++ b/t/16-clean.t @@ -27,6 +27,7 @@ set_lo("$RealBin/LO"); delete $ENV{TMP}; delete $ENV{OUTPUT}; cleanup(); +restore_perf_dummy(); # 1: check that build dir doesn't get cleaned set_noclean("TRUE"); diff --git a/t/19-pkg-dir.t b/t/19-pkg-dir.t index db44118..b2e8e93 100755 --- a/t/19-pkg-dir.t +++ b/t/19-pkg-dir.t @@ -7,7 +7,7 @@ use Test::More; use Capture::Tiny qw/ capture_merged /; use FindBin '$RealBin'; use lib $RealBin; -use Test::Sbotools qw/ set_pkg_dir make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade /; +use Test::Sbotools qw/ set_pkg_dir make_slackbuilds_txt set_lo sboconfig sboinstall sboupgrade restore_perf_dummy /; use File::Temp 'tempdir'; if ($ENV{TEST_INSTALL}) { @@ -41,6 +41,7 @@ make_slackbuilds_txt(); set_lo("$RealBin/LO"); my $pkgdir = tempdir(CLEANUP => 1); set_pkg_dir($pkgdir); +restore_perf_dummy(); # 1-2: install creates package in PKG_DIR sboinstall 'nonexistentslackbuild', { input => "y\ny", expected => qr!\Qnonexistentslackbuild-1.0-noarch-1_SBo.tgz stored in $pkgdir! }; |