Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Add syntax tests and add missing use warnings #712

Merged
merged 6 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;