New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tool for checking if '# pure' files still contain fudging #118
Comments
From @moritzAttached patch adds a script to tools/ that walks through a test particle++ for suggesting it. It's only tested under linux so far, so please also test on MacOS and Cheers, -- |
From @moritzpurity_inspector.patchIndex: MANIFEST
===================================================================
--- MANIFEST (revision 28098)
+++ MANIFEST (working copy)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jun 4 20:37:00 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Jun 5 15:13:47 2008 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -1961,6 +1961,7 @@
languages/perl6/t/harness [perl6]
languages/perl6/t/pmc/mutable.t [perl6]
languages/perl6/t/spectest_regression.data [perl6]
+languages/perl6/tools/fudge_purity_inspector.pl [perl6]
languages/perl6/tools/update_passing_test_data.pl [perl6]
languages/pheme/MAINTAINER [pheme]
languages/pheme/MANIFEST [pheme]
Index: languages/perl6/tools/fudge_purity_inspector.pl
===================================================================
--- languages/perl6/tools/fudge_purity_inspector.pl (revision 0)
+++ languages/perl6/tools/fudge_purity_inspector.pl (revision 0)
@@ -0,0 +1,39 @@
+#! perl -w
+# Copyright (C) 2008, The Perl Foundation.
+# $Id$
+use strict;
+use warnings;
+
+my $input_file = shift @ARGV || 't/spectest_regression.data';
+my $impl = 'rakudo';
+
+open my $fh, '<', $input_file
+ or die "Can't open '$input_file' for reading: $!";
+
+print "The following files, if any, contain fudge directives,\n";
+print "although they are marked as pure:\n";
+
+while (<$fh>){
+ chomp;
+ next if m/^#/ || m/^\s*$/;
+ my ($file, $comment) = split m/\s*#\s*/;
+ if ($comment && $comment eq 'pure'){
+ check_file_and_warn($file);
+ }
+}
+
+sub check_file_and_warn {
+ my $filename = shift;
+ $filename = "t/spec/$filename";
+# warn "checking file <$filename>\n";
+ open my $fh, '<', $filename
+ or die "Can't opne file '$filename' for reading: $!";
+ my $re = qr{^\s*#\?$impl};
+ while (<$fh>) {
+ if (m/$re/){
+ print $filename, "\n";
+ last;
+ }
+ }
+ close $fh;
+}
Property changes on: languages/perl6/tools/fudge_purity_inspector.pl
___________________________________________________________________
Name: svn:mime-type
+ text/plain; charset=UTF-8
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
|
@particle - Status changed from 'new' to 'open' |
From @particlethanks, applied as r28105. |
@particle - Status changed from 'open' to 'resolved' |
From @cokeOn Thu, Jun 5, 2008 at 11:06 AM, via RT Moritz Lenz
typo: You can avoid that entirely by using "use Fatal qw(open);". Regards. -- |
Migrated from rt.perl.org#55346 (status was 'resolved')
Searchable as RT55346$
The text was updated successfully, but these errors were encountered: