Skip to content

Commit

Permalink
Create 01_script_syntax.t
Browse files Browse the repository at this point in the history
  • Loading branch information
rvosa authored Nov 21, 2024
1 parent ddf395f commit 0876277
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/01_script_syntax.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use Test::More;
use Path::Tiny;
use strict;
use warnings;

# Get all Perl scripts
my @scripts = glob "workflow/scripts/*.pl";

# Plan the number of tests
plan tests => scalar(@scripts);

# Test each script
for my $script (@scripts) {
my $output = `perl -cw $script 2>&1`;
my $exit_code = $? >> 8;
ok($exit_code == 0, "$script syntax is valid")
or diag("Script failed syntax check: $output");
}

done_testing();

0 comments on commit 0876277

Please sign in to comment.