-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from cancerit/feature/prerelease_n_basic_tests
Feature/prerelease n basic tests
- Loading branch information
Showing
9 changed files
with
250 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
/README.md | ||
/perl/MYMETA.json | ||
/perl/MYMETA.yml | ||
/perl/docs/ | ||
/perl/perltidy.LOG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
bin/compare_CN_and_fusion.pl | ||
bin/compare_overlapping_fusions.pl | ||
bin/defuse.pl | ||
bin/filter_fusions.pl | ||
bin/process_qcstats.pl | ||
bin/star_fusion.pl | ||
bin/star_mapping.pl | ||
bin/tophat_add_strand.pl | ||
bin/tophat_fusion.pl | ||
config/defuse.ini | ||
config/star.ini | ||
config/tophat.ini | ||
docs.tar.gz | ||
docs/pod_html/_blkbluw.css | ||
docs/pod_html/_blkcynw.css | ||
docs/pod_html/_blkgrng.css | ||
docs/pod_html/_blkmagw.css | ||
docs/pod_html/_grygrnk.css | ||
docs/pod_html/_grygrnw.css | ||
docs/pod_html/_podly.js | ||
docs/pod_html/_whtgrng.css | ||
docs/pod_html/_whtnavk.css | ||
docs/pod_html/_whtprpk.css | ||
docs/pod_html/_whtpurk.css | ||
docs/pod_html/compare_overlapping_fusions.html | ||
docs/pod_html/defuse.html | ||
docs/pod_html/filter_fusions.html | ||
docs/pod_html/index.html | ||
docs/pod_html/star_fusion.html | ||
docs/pod_html/star_mapping.html | ||
docs/pod_html/tophat_add_strand.html | ||
docs/pod_html/tophat_fusion.html | ||
docs/reports_html/common.js | ||
docs/reports_html/cover.14 | ||
docs/reports_html/cover.css | ||
docs/reports_html/coverage.html | ||
docs/reports_html/css.js | ||
docs/reports_html/index.html | ||
docs/reports_html/lib-Sanger-CGP-CgpRna-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-CgpRna-pm.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm--branch.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-FusionAnnotation-pm.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm--branch.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-CompareFusions-Implement-pm.html | ||
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm--branch.html | ||
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-Defuse-Implement-pm.html | ||
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm--branch.html | ||
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-RnaQC-Implement-pm.html | ||
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm--branch.html | ||
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm--subroutine.html | ||
docs/reports_html/lib-Sanger-CGP-Star-Implement-pm.html | ||
docs/reports_html/standardista-table-sorting.js | ||
docs/reports_text/coverage.txt | ||
lib/Sanger/CGP/CgpRna.pm | ||
lib/Sanger/CGP/CompareFusions/FusionAnnotation.pm | ||
lib/Sanger/CGP/CompareFusions/Implement.pm | ||
lib/Sanger/CGP/Defuse/Implement.pm | ||
lib/Sanger/CGP/RnaQC/Implement.pm | ||
lib/Sanger/CGP/Star/Implement.pm | ||
lib/Sanger/CGP/Tophat/Implement.pm | ||
Makefile.PL | ||
MANIFEST This list of files | ||
perltidy.LOG | ||
t/1_pm_compile.t | ||
t/2_pl_compile.t | ||
t/data/tst.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# this is a catch all to ensure all modules do compile | ||
# added as lots of 'use' functionality is dynamic in pipeline | ||
# and need to be sure that all modules compile. | ||
# simple 'perl -c' is unlikely to work on head scripts any more. | ||
|
||
use strict; | ||
use Data::Dumper; | ||
use Test::More; | ||
use List::Util qw(first); | ||
use File::Find; | ||
use Cwd; | ||
use Try::Tiny qw(try finally); | ||
use File::Spec; | ||
|
||
use FindBin qw($Bin); | ||
my $lib_path = "$Bin/../lib"; | ||
|
||
# Add modules here that cannot be instantiated (should be extended and have no 'new') | ||
# or need a set of inputs - these should be tested in own test script | ||
use constant MODULE_SKIP => qw(); | ||
|
||
|
||
my $init_cwd = getcwd; | ||
|
||
my @modules; | ||
try { | ||
chdir($lib_path); | ||
find({ wanted => \&build_module_set, no_chdir => 1 }, './'); | ||
} finally { | ||
chdir $init_cwd; | ||
die "The try block died with: @_\n" if(@_); | ||
}; | ||
|
||
for my $mod(@modules) { | ||
use_ok($mod) or BAIL_OUT("Unable to 'use' module $mod"); | ||
} | ||
|
||
for my $mod(@modules) { | ||
ok($mod->VERSION, "Check version inheritance exists ($mod)"); | ||
if($mod->can('new')) { # only try new on things that have new defined | ||
new_ok($mod) unless( first {$mod eq $_} MODULE_SKIP ); | ||
} | ||
} | ||
|
||
done_testing(); | ||
|
||
sub build_module_set { | ||
if($_ =~ m/\.pm$/) { | ||
|
||
my ($dir_str,$file) = (File::Spec->splitpath( $_ ))[1,2]; | ||
$file =~ s/\.pm$//; | ||
my @dirs = File::Spec->splitdir( $dir_str ); | ||
shift @dirs; | ||
push @modules, (join '::', @dirs).$file; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# this is a catch all to ensure all modules do compile | ||
# added as lots of 'use' functionality is dynamic in pipeline | ||
# and need to be sure that all modules compile. | ||
# simple 'perl -c' is unlikely to work on head scripts any more. | ||
|
||
use strict; | ||
use Data::Dumper; | ||
use Test::More; | ||
use List::Util qw(first); | ||
use Try::Tiny qw(try catch); | ||
use autodie qw(:all); | ||
use File::Find; | ||
|
||
use FindBin qw($Bin); | ||
my $script_path = "$Bin/../bin"; | ||
|
||
use constant COMPILE_SKIP => qw(); | ||
|
||
my $perl = $^X; | ||
|
||
my @scripts; | ||
find({ wanted => \&build_path_set, no_chdir => 1 }, $script_path); | ||
|
||
for(@scripts) { | ||
my $script = $_; | ||
if( first {$script =~ m/$_$/} COMPILE_SKIP ) { | ||
note("SKIPPING: Script with known issues: $script"); | ||
next; | ||
} | ||
my $message = "Compilation check: $script"; | ||
my $command = "$perl -c $script"; | ||
my ($pid, $process); | ||
try { | ||
$pid = open $process, $command.' 2>&1 |'; | ||
while(<$process>){}; | ||
close $process; | ||
pass($message); | ||
} | ||
catch { | ||
fail($message); | ||
}; | ||
} | ||
|
||
done_testing(); | ||
|
||
sub build_path_set { | ||
push @scripts, $_ if($_ =~ m/\.pl$/); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
set -eu # exit on first error or undefined value in subtitution | ||
set -o pipefail | ||
|
||
# get current directory | ||
INIT_DIR=`pwd` | ||
|
||
# get location of this file | ||
MY_PATH="`dirname \"$0\"`" # relative | ||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized | ||
if [ -z "$MY_PATH" ] ; then | ||
# error; for some reason, the path is not accessible | ||
# to the script (e.g. permissions re-evaled after suid) | ||
echo Failed to determine location of script >2 | ||
exit 1 # fail | ||
fi | ||
# change into the location of the script | ||
cd $MY_PATH/perl | ||
rm -rf blib | ||
rm -rf docs | ||
|
||
echo '### Running perl tests ###' | ||
|
||
export HARNESS_PERL_SWITCHES=-MDevel::Cover=-db,reports,-ignore,'t/.*\.t' | ||
mkdir -p docs/reports_text | ||
prove -w -I lib | ||
echo | ||
echo '### Generating test/pod coverage reports ###' | ||
# removed 'condition' from coverage as '||' 'or' doesn't work properly | ||
cover -coverage branch,subroutine,pod -report_c0 50 -report_c1 85 -report_c2 100 -report html_basic reports -silent | ||
cover -coverage branch,subroutine,pod -report text reports -silent > docs/reports_text/coverage.txt | ||
rm -rf reports/structure reports/digests reports/cover.13 reports/runs | ||
cp reports/coverage.html reports/index.html | ||
mv reports docs/reports_html | ||
unset HARNESS_PERL_SWITCHES | ||
|
||
echo '### Generating POD ###' | ||
mkdir -p docs/pod_html | ||
perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' lib:bin docs/pod_html > /dev/null | ||
|
||
echo '### Archiving docs folder ###' | ||
tar cz -f docs.tar.gz docs | ||
|
||
# generate manifest, and cleanup | ||
echo '### Generating MANIFEST ###' | ||
# delete incase any files are moved, the make target just adds stuff | ||
rm -f MANIFEST | ||
# cleanup things which could break the manifest | ||
rm -rf install_tmp | ||
perl Makefile.PL > /dev/null | ||
make manifest &> /dev/null | ||
rm -f Makefile MANIFEST.bak pm_to_blib MYMETA.* | ||
|
||
# change back to original dir | ||
cd $INIT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters