Skip to content

Commit

Permalink
Add 'test_author' 'make' target (and alias 'atest')
Browse files Browse the repository at this point in the history
Add envvar NYTPROF_AUTHOR_TESTING.  'make test_author' and 'make atest'
will set this envvar true, thereby causing certain unit tests within the
test suite and/or test files to run only when needed by NYTProf
developers.

Accordingly, move 90-pod.t back into t/ from xt/, but have this run only
when NYTPROF_AUTHOR_TESTING is set.

This should have a favorable impact on
#174.
  • Loading branch information
jkeenan committed Apr 30, 2021
1 parent 6b9a3df commit 37816dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ t/50-errno.t
t/60-forkdepth.t
t/70-subname.t
t/80-version.t
t/90-pod.t
t/lib/NYTProfTest.pm
t/nytprof_11-reader.out.txt
t/nytprof_12-data.out.txt
Expand Down Expand Up @@ -251,7 +252,6 @@ xt/61-cputime.t
xt/68-hashline.t
xt/71-moose.t
xt/72-autodie.t
xt/90-pod.t
xt/91-pod_coverage.t
xt/92-file_port.t
xt/test23-strevalxs.p
Expand Down
8 changes: 7 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,15 @@ perltidy:
ctidy_bcpp:
bcpp -f 2 -i 4 -bcl -qb 10 -ylcnc -yb NYTProf.xs
NYTPROF_AUTHOR_TESTING=""
NYTPROF_TEST_SHORT=""
test_short:
NYTPROF_TEST_SHORT=1 make test
NYTPROF_TEST_SHORT=1 NYTPROF_AUTHOR_TESTING=1 make test
test_author:
NYTPROF_AUTHOR_TESTING=1 make test
atest: test_author
}
}
Expand Down
1 change: 1 addition & 0 deletions t/12-data.t
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ is(scalar(@noneval_fileinfos), 1, "got 1 noneval_fileinfo");

{
SKIP: {
skip "NYTPROF_AUTHOR_TESTING only", 3 unless $ENV{NYTPROF_AUTHOR_TESTING};
skip "Bad interaction when trace_level is set", 3
if trace_level();
my $profile;
Expand Down
2 changes: 2 additions & 0 deletions xt/90-pod.t → t/90-pod.t
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!perl -w

use Test::More;
plan skip_all => "NYTPROF_AUTHOR_TESTING only" unless $ENV{NYTPROF_AUTHOR_TESTING};

eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;

Expand Down

0 comments on commit 37816dc

Please sign in to comment.