-
Notifications
You must be signed in to change notification settings - Fork 0
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 'Made modify_files more robust, added module struc…
…ture, added doc' (#1) from cpan into master Reviewed-on: https://gitea.oetiker.ch/OP/perl_coverage_reports/pulls/1
- Loading branch information
Showing
17 changed files
with
282 additions
and
63 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.idea | ||
cover_db | ||
*.iml | ||
_Deparsed_XSubs.pm | ||
_Deparsed_XSubs.pm | ||
examples/cover_db | ||
*.tar | ||
Makefile.old |
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,2 @@ | ||
Tobias Bossert <tobib at cpan.org> | ||
Tobias Oetiker <tobi at oetiker.ch> |
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,3 @@ | ||
0.1.0 2021-23-23 Tobias Bossert (tobib at cpan.org) | ||
|
||
- initial release |
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,6 @@ | ||
Devel::Deanonymize | ||
|
||
Copyright (c) 2020 Tobias Bossert and the other people listed in the | ||
AUTHORS file. | ||
|
||
All rights reserved. |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Tobias Bossert, OETIKER+PARTNER AG Switzerland | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,14 @@ | ||
AUTHORS | ||
CHANGES | ||
COPYRIGHT | ||
examples/lib/Fancy/Module.pm | ||
examples/my_program.pl | ||
examples/runit.sh | ||
examples/t/number_test.t | ||
lib/Devel/Deanonymize.pm | ||
LICENSE | ||
Makefile.PL | ||
MANIFEST This list of files | ||
MANIFEST.SKIP | ||
Readme.md | ||
VERSION |
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,18 @@ | ||
.*\.old$ | ||
\.tar\.gz$ | ||
^Makefile$ | ||
^MYMETA\. | ||
^blib | ||
^pm_to_blib | ||
\.idea | ||
\.debian | ||
\.git | ||
_build | ||
\.gitignore | ||
cpanfile | ||
examples/cover_db/ | ||
\.perl-version | ||
configure\.ac | ||
^_Deparsed_XSubs\.pm | ||
.*.bak$ | ||
.*.iml$ |
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 @@ | ||
use v5.20.0; | ||
|
||
use strict; | ||
use warnings; | ||
use ExtUtils::MakeMaker; | ||
use FindBin; | ||
|
||
sub get_version() { | ||
open my $fh, 'VERSION'; | ||
chomp(my $v = <$fh>); | ||
close $fh; | ||
return $v; | ||
} | ||
|
||
my $version = get_version(); | ||
|
||
WriteMakefile( | ||
NAME => 'Devel::Deanonymize', | ||
VERSION => $version, | ||
ABSTRACT => 'A tool do make anonymous sub visible to Devel::Cover', | ||
AUTHOR => 'Tobias Bossert <tobib at cpan.org>', | ||
LICENSE => 'mit', | ||
PREREQ_PM => {}, | ||
BUILD_REQUIRES => {}, | ||
MAKE => 'gmake', | ||
EXE_FILES => [], | ||
META_MERGE => { | ||
requires => { perl => '5.020000' }, | ||
resources => { | ||
license => 'https://opensource.org/licenses/mit', | ||
repository => 'https://github.com/sirtoobii/wg-meta', | ||
bugtracker => 'https://github.com/sirtoobii/wg-meta/issues' | ||
}, | ||
no_index => { directory => [ 't' ] } | ||
}, | ||
test => { TESTS => 't/*.t' } | ||
); | ||
|
||
sub MY::postamble { | ||
my $self = shift; | ||
return <<"EOF"; | ||
VERSION_FILES := \$(shell grep -Rl 'our \$\$VERSION = ' .) | ||
\$(VERSION_FILES): VERSION | ||
\$(PERL) -i -p -e 's/\$VERSION\\s*=\\s*"[\\d|\.]*[A-z]*"/\$VERSION = "\$(VERSION)"/;' \$\@ | ||
EOF | ||
} |
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
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 @@ | ||
0.1.0 |
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,41 @@ | ||
package Fancy::Module; | ||
use strict; | ||
use warnings FATAL => 'all'; | ||
use experimental 'signatures'; | ||
|
||
use base 'Exporter'; | ||
our @EXPORT = qw(is_it_the_number is_the_sum_the_number); | ||
|
||
my $anon = sub($number) { | ||
if ($number != 42) { | ||
return "No, it's not"; | ||
} | ||
}; | ||
|
||
sub is_it_the_number($number) { | ||
if ($number == 42) { | ||
return "It is the number"; | ||
} | ||
else { | ||
&{$anon}($number); | ||
} | ||
} | ||
|
||
sub is_the_sum_the_number($number1, $number2) { | ||
# extra complicated check | ||
if ($number1 > 42 or $number2 > 42) { | ||
return "No, its not"; | ||
} | ||
elsif (($number2 == 42 or $number1 == 42) and ($number1 + $number2 == 0)) { | ||
return "It is the number"; | ||
} | ||
elsif ($number1 + $number2 == 42) { | ||
return "It is the number" | ||
} | ||
else { | ||
&{$anon}($number1 + $number2); | ||
} | ||
|
||
} | ||
|
||
__END__ |
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,19 @@ | ||
#!/usr/bin/perl | ||
use strict; | ||
use warnings FATAL => 'all'; | ||
use Fancy::Module; | ||
|
||
is_it_the_number(21); | ||
is_it_the_number(42); | ||
is_the_sum_the_number(21,21); | ||
is_the_sum_the_number(42,0); | ||
is_the_sum_the_number(0,42); | ||
is_the_sum_the_number(42,42); | ||
is_the_sum_the_number(23,42); | ||
is_the_sum_the_number(42,23); | ||
is_the_sum_the_number(43,43); | ||
is_the_sum_the_number(43,21); | ||
is_the_sum_the_number(21,43); | ||
is_the_sum_the_number(21,21); | ||
|
||
print("done\n"); |
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
#PERL_DIR=/home/tbossert/.plenv/versions/5.32.1/bin | ||
PERL_DIR=/usr/bin/ | ||
|
||
# Delete old coverage Data | ||
#$PERL_DIR/cover -delete | ||
|
||
# Run tests | ||
#HARNESS_PERL_SWITCHES="-MDevel::Cover=-ignore,^t/,Deanonymize -MDevel::Deanonymize=Fancy" $PERL_DIR/prove t/ -I lib/ -I ../lib | ||
#HARNESS_PERL_SWITCHES="-MDevel::Cover=-ignore,^t/,Deanonymize" $PERL_DIR/prove t/ -I lib/ -I ../lib | ||
|
||
|
||
|
||
# Run script | ||
$PERL_DIR/perl -MDevel::Cover=-ignore,^t/,Deanonymize -MDevel::Deanonymize=Fancy -I lib/ -I ../lib my_program.pl | ||
|
||
$PERL_DIR/cover -report html |
File renamed without changes.
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
Oops, something went wrong.