From 0a6c8afd77b9d3204d949d3d2f0c95ede13f5990 Mon Sep 17 00:00:00 2001 From: Mason James Date: Sat, 5 Mar 2022 15:30:21 +1300 Subject: [PATCH] Bug 19169: Add a test to detect unneeded 'atomicupdate' files to test... 1/ set git repo $ git reset --hard v21.11.03 2/ run test $ prove ./t OK 3/ apply patch 4/ run test again, observe FAIL $ prove ./t/00-check-atomic-updates.pl ./t/00-check-atomic-updates.pl .. 1/? # Failed test 'check for unhandled atomic updates: bug_29596.pl' # at ./t/00-check-atomic-updates.pl line 34. # 'bug_29596.pl' # matches '(?^u:.*pl$)' # Looks like you failed 1 test of 3. ./t/00-check-atomic-updates.pl .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests JD Amended patch: fix copyright year Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers --- t/00-check-atomic-updates.pl | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 t/00-check-atomic-updates.pl diff --git a/t/00-check-atomic-updates.pl b/t/00-check-atomic-updates.pl new file mode 100755 index 0000000000..d9ad730815 --- /dev/null +++ b/t/00-check-atomic-updates.pl @@ -0,0 +1,37 @@ +# Copyright 2022 Mason James +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use Test::More; +use File::Find; + +my $dir = ('installer/data/mysql/atomicupdate'); +my @files; + +find( \&wanted, $dir ); + +sub wanted { + push @files, $_; + return; +} + +foreach my $f (@files) { + next if $f eq 'skeleton.pl'; + unlike( $f, qr/.*pl$/, "check for unhandled atomic updates: $f" ); +} + +done_testing(); -- 2.39.5