Skip to content

Commit

Permalink
Test: Add syntax tests and add missing use warnings (#712)
Browse files Browse the repository at this point in the history
* Test: Add syntax tests and add missing use warnings

* Test: Add missing test dependency

* Test: Drop fancy tilde in test file name. Order is not so important

* Simplify syntax test

* Remove unused modules
  • Loading branch information
nicomen authored Oct 31, 2024
1 parent fcc82a9 commit be6df92
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ requires "File::Copy::Recursive";
requires "Moo", ">= 2.0";

test_requires "Test::MockModule";
test_requires "Test::Strict";
1 change: 1 addition & 0 deletions share/shutter/resources/modules/Shutter/App/AboutDialog.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::AboutDialog;
#--------------------------------------
use utf8;
use strict;
use warnings;
use Gtk3;

#Glib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::GlobalSettings;
#--------------------------------------
use utf8;
use strict;
use warnings;

#Glib
use Glib qw/TRUE FALSE/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::HelperFunctions;
#--------------------------------------
use utf8;
use strict;
use warnings;
use Gtk3;

#Glib
Expand Down
1 change: 1 addition & 0 deletions share/shutter/resources/modules/Shutter/App/Menu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::Menu;
#--------------------------------------
use utf8;
use strict;
use warnings;
use Gtk3;

#Glib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::Optional::Exif;
#--------------------------------------
use utf8;
use strict;
use warnings;

use Glib qw/TRUE FALSE/;

Expand Down
1 change: 1 addition & 0 deletions share/shutter/resources/modules/Shutter/App/Toolbar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package Shutter::App::Toolbar;
#--------------------------------------
use utf8;
use strict;
use warnings;
use Gtk3;

#Glib
Expand Down
1 change: 1 addition & 0 deletions share/shutter/resources/modules/Shutter/Upload/FTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ package Shutter::Upload::FTP;

use utf8;
use strict;
use warnings;
use Net::FTP;
use URI;
use URI::Split qw(uri_split);
Expand Down
1 change: 1 addition & 0 deletions share/shutter/resources/modules/Shutter/Upload/Shared.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package Shutter::Upload::Shared;

use utf8;
use strict;
use warnings;
use POSIX qw/setlocale/;
use Locale::gettext;
use Glib qw/TRUE FALSE/;
Expand Down
1 change: 1 addition & 0 deletions share/shutter/resources/modules/X11/Protocol/Ext/XFIXES.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BEGIN { require 5 }
package X11::Protocol::Ext::XFIXES;
use X11::Protocol 'padded';
use strict;
use warnings;
use Carp;

use vars '$VERSION', '@CARP_NOT';
Expand Down
19 changes: 19 additions & 0 deletions t/syntax.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
use Test::Strict;

use FindBin qw/$Bin/;

# Check syntax, use strict and use warnings on all perl files

local $Test::Strict::TEST_WARNINGS = 1;

my @dirs = ('t', 'bin', "$Bin/../share/shutter/resources/modules/");

all_perl_files_ok(@dirs);

done_testing;

0 comments on commit be6df92

Please sign in to comment.