Skip to content

Commit

Permalink
Set environment variables in the module t/env.pm, not in makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fortune9 committed May 17, 2015
1 parent 0fb1fd0 commit 4c9900a
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 99 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ t/pod-coverage.t
t/pod.t
t/tai.out
t/test.fa
t/env.pm
TODO
xt/boilerplate.t
Makefile.PL
21 changes: 15 additions & 6 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use 5.006;
use strict;
use warnings;
use ExtUtils::MakeMaker;
use File::Spec;

WriteMakefile(
NAME => 'Bio::CUA',
Expand Down Expand Up @@ -55,13 +56,21 @@ package MY; # other content MakeMaker can't produce
sub postamble
{
# The return will be directly write to makefile
my $postamble = <<POST;
export expected_file = t/expected.tsv
export seq_file = t/test.fa
export tRNA_file = t/dmel_r5_apr2006.tRNA_copy
POST

return $postamble;
# get the command to set environment variables
# my $os = $^O;
# my $set = $os =~ /MSWin/i? 'set' : 'export';
# my $expFile = File::Spec->catfile('t', 'expected.tsv');
# my $seqFile = File::Spec->catfile('t', 'test.fa');
# my $tRNAFile = File::Spec->catfile('t', 'dmel_r5_apr2006.tRNA_copy');
#
# my $postamble = <<POST;
#export expected_file = $expFile
#export seq_file = $seqFile
#export tRNA_file = $tRNAFile
#POST

# return $postamble;
}

# put subroutines here
2 changes: 2 additions & 0 deletions t/01-seqio.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use 5.006;
use strict;
use warnings;
use Test::More;
use lib 't';
use env;

# variables
my $sep = "\t";
Expand Down
2 changes: 2 additions & 0 deletions t/02-codontable.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use 5.006;
use strict;
use warnings;
use Test::More;
use lib 't';
use env;

# variables
my $sep = "\t";
Expand Down
2 changes: 2 additions & 0 deletions t/03-summarizer.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use 5.006;
use strict;
use warnings;
use Test::More;
use lib 't';
use env;

#unless ( $ENV{RELEASE_TESTING} ) {
# plan( skip_all => "Author tests not required for installation" );
Expand Down
7 changes: 5 additions & 2 deletions t/04-builder.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ use strict;
use warnings;
use Test::More;
use File::Basename;
use File::Spec;
use lib 't';
use env;

# variables
my $sep = "\t";
Expand All @@ -13,8 +16,8 @@ my $tRNAFile = $ENV{'tRNA_file'};
BAIL_OUT("environment variables NOT found")
unless($expectedFile and $seqFile and $tRNAFile);
my $dir = dirname(__FILE__);
my $caiFile = "$dir/cai.out";
my $taiFile = "$dir/tai.out";
my $caiFile = File::Spec->catfile($dir,"cai.out");
my $taiFile = File::Spec->catfile($dir,"tai.out");

my $module;
BEGIN {
Expand Down
8 changes: 6 additions & 2 deletions t/05-calculator.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ use strict;
use warnings;
use Test::More;
use File::Basename;
use Bio::CUA::SeqIO;
use File::Spec;
use lib 't';
use env;

my $sep = "\t";
my $seqFile = $ENV{'seq_file'};
my $expectedFile = $ENV{'expected_file'};
BAIL_OUT("environment variables NOT found")
unless($expectedFile and $seqFile);
my $dir = dirname(__FILE__);
my $caiFile = "$dir/cai.out";
my $taiFile = "$dir/tai.out";
my $caiFile = File::Spec->catfile($dir, "cai.out");
my $taiFile = File::Spec->catfile($dir, "tai.out");

my $module;
BEGIN {
Expand Down
86 changes: 43 additions & 43 deletions t/cai.out
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
GAG 1
ACG 0.744186046511628
CAC 1
CGG 0.540540540540541
CAA 0.380352644836272
CTG 1
ATC 1
ATT 0.414225941422594
CCC 1
TAC 1
GCT 0.309734513274336
CAT 0.537688442211055
TCC 0.845018450184502
TTC 1
AAA 0.398576512455516
TCA 0.254612546125461
ACA 0.469767441860465
GAA 0.394927536231884
AAC 1
CCG 0.878306878306878
CTC 0.386058981233244
TAT 0.537634408602151
ACG 0.744186046511628
CGC 1
GAT 0.892857142857143
ATA 0.284518828451883
CGT 0.371621621621622
ATC 1
AGT 0.450184501845018
GGA 0.537671232876712
CGA 0.364864864864865
TGT 0.23
CAG 1
GCA 0.274336283185841
CCC 1
TTG 0.329758713136729
CTG 1
GTC 0.565610859728507
GTA 0.194570135746606
CTA 0.190348525469169
TAT 0.537634408602151
ATT 0.414225941422594
AGA 0.243243243243243
CTT 0.142091152815013
AGC 1
GTG 1
TCG 0.712177121771218
AAA 0.398576512455516
CCA 0.587301587301587
GCC 1
AGA 0.243243243243243
GGC 1
AAG 1
GAG 1
TCA 0.254612546125461
TGC 1
GCG 0.47787610619469
ACC 1
ATA 0.284518828451883
GTT 0.330316742081448
GAC 1
GCT 0.309734513274336
CTC 0.386058981233244
AAC 1
CGG 0.540540540540541
CAA 0.380352644836272
TTA 0.0857908847184987
TTG 0.329758713136729
CGT 0.371621621621622
CTA 0.190348525469169
CTT 0.142091152815013
GGT 0.335616438356164
TCG 0.712177121771218
TGT 0.23
ACC 1
CCG 0.878306878306878
GGG 0.174657534246575
GTA 0.194570135746606
GTC 0.565610859728507
TGC 1
AGG 0.310810810810811
AAT 0.604477611940298
GGC 1
CAG 1
TCC 0.845018450184502
GGA 0.537671232876712
TTT 0.450261780104712
ACT 0.288372093023256
CAC 1
TCT 0.191881918819188
CGA 0.364864864864865
TAC 1
GTG 1
CCT 0.407407407407407
CGC 1
GAT 0.892857142857143
GCA 0.274336283185841
AAG 1
CCA 0.587301587301587
ACA 0.469767441860465
ACT 0.288372093023256
GAC 1
92 changes: 46 additions & 46 deletions t/tai.out
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
TGC 0.334608030592734
GCG 0.173996175908222
TCA 0.095640535372849
AAA 0.286806883365201
AAC 0.573613766730402
GAA 0.286806883365201
CTC 0.17208413001912
CCG 0.315487571701721
AGC 0.286806883365201
TAT 0.253824091778203
GGA 0.286806883365201
AGT 0.169216061185469
GTG 0.365200764818356
AAG 0.713193116634799
GAG 1
GGC 0.669216061185469
CCA 0.239039196940727
GCC 0.413001912045889
AAA 0.286806883365201
TCG 0.221797323135755
CTT 0.239005736137667
AGA 0.1434034416826
GCG 0.173996175908222
AGC 0.286806883365201
AGG 0.189292543021033
GGG 0.0917782026768642
CCG 0.315487571701721
ACC 0.309751434034417
ACG 0.235181644359465
GAG 1
CAC 0.239005736137667
CGG 0.152963671128107
GGT 0.394837476099426
CAA 0.191204588910134
CTG 0.413001912045889
ATC 0.309751434034417
ATT 0.430210325047801
CCC 0.240917782026769
TAC 0.430210325047801
TTA 0.191204588910134
CGG 0.152963671128107
AAC 0.573613766730402
CTC 0.17208413001912
GCT 0.573613766730402
CAT 0.141013384321224
TTC 0.382409177820268
GAC 0.669216061185469
GTT 0.286806883365201
TTT 0.225621414913958
CGA 0.478059273422562
GGA 0.286806883365201
AAT 0.338432122370937
GTG 0.365200764818356
CCT 0.334608030592734
TAC 0.430210325047801
TCT 0.382409177820268
CAC 0.239005736137667
ACT 0.430210325047801
CGC 0.344168260038241
CCT 0.334608030592734
GAT 0.394837476099426
CCA 0.239039196940727
AAG 0.713193116634799
GCA 0.09565965583174
GAA 0.286806883365201
ACA 0.286849904397706
ACT 0.430210325047801
GAC 0.669216061185469
ATA 0.0956453154875717
GTT 0.286806883365201
TTA 0.191204588910134
ACG 0.235181644359465
TTC 0.382409177820268
TCC 0.275334608030593
CAT 0.141013384321224
AGT 0.169216061185469
ATC 0.309751434034417
TGG 0.397705544933078
CGT 0.478011472275335
TTG 0.252390057361377
CTT 0.239005736137667
CTA 0.0956261950286807
GGT 0.394837476099426
TCG 0.221797323135755
GTA 0.0956309751434034
GGG 0.0917782026768642
ATA 0.0956453154875717
GAT 0.394837476099426
CGA 0.478059273422562
TGT 0.197418738049713
TGG 0.397705544933078
ATT 0.430210325047801
TAT 0.253824091778203
CTG 0.413001912045889
GTC 0.206500956022945
TGC 0.334608030592734
AGG 0.189292543021033
AAT 0.338432122370937
GTA 0.0956309751434034
CTA 0.0956261950286807
TTG 0.252390057361377
CCC 0.240917782026769
GCA 0.09565965583174
CAG 0.443594646271511
TCC 0.275334608030593
GGC 0.669216061185469

0 comments on commit 4c9900a

Please sign in to comment.