i dunno about party bus with just guys....

On Tue, Sep 9, 2008 at 2:02 PM, Andrei Hantu <[EMAIL PROTECTED]> wrote:

> ill have a chat with mutto
> i think party bus will be awesome
> tho everyone needs to get badly pissed
>
> On Tue, Sep 9, 2008 at 1:56 PM, Malvin Busono <[EMAIL PROTECTED]>wrote:
>
>> yeah who's organising this btw?
>> it shouldn't be doof
>>
>>
>> On Tue, Sep 9, 2008 at 1:54 PM, Elliot Hinde <[EMAIL PROTECTED]> wrote:
>>
>>>  no idea. ievery src/dynpmc/*.pmc
and                             src/dynoplibs/*.ops has a matching
t/dynpmc/*.t and t/dynoplibs/*.t ?  If so, this would be an ideal task
for one of our recent volunteers, since the code would be pure Perl.

Also, the test will fail without an exception for src/dynpmc/rotest.pmc.
I don't know if a test should be written for this PMC or not.

I'm working in the script.

Igor

I have a working script(with testing variables only).

I have to filter de input (there are other types of files), and improbe the 
reporting part.

I don't know if I forgeting something.

Igor

The script is:

#!/usr/bin/perl -w

# Copyright (C) 2007-2008, The Perl Foundation.
# $Id: Match.pl 2008-09-10  igor $

=head1 NAME

Match.pl
=head1 DESCRIPTION

Reports if doesn't mach a pmc file with a test file, there is not test file

=cut

sub find_files {
    my ($base_dir,$dirpmc,$dirtest) = @_;
    opendir(DIRPMC, $base_dir.$dirpmc);
    opendir(DIRTEST,$base_dir.$dirtest);

    my @filespmc = grep { $_ ne '.' and $_ ne '..' } readdir DIRPMC;
    my @filest   = grep { $_ ne '.' and $_ ne '..' } readdir DIRTEST;

    my @pmc_values = @{strip_ext([EMAIL PROTECTED])};
    my @t_values = @{strip_ext([EMAIL PROTECTED])};

    my %hash_t = map { $_ => $_ } @t_values;

    for (0 .. $#pmc_values) {
        if ( exists $hash_t{ $pmc_values[$_] } ) {
            print "element exist     ".$pmc_values[$_]."\n";
        } else {
            print "element do not exist  ".$pmc_values[$_]."\n";
        }
    }

}

sub strip_ext {
    my @ref_t = @{$_[0]};
    my @arr_stripped = ();
    for (my $i=0;$i<$#ref_t+1; $i++) {
        if ($ref_t[$i] =~ m/(\w+)[.]\w+/) {  #Obtain names of files without 
extension
            $arr_stripped[$i] = $1;
        } else {
            print "error";
        }
    }
    return [EMAIL PROTECTED];
}

my $base_dir = "/home/raf/parrot/";
my $dirpmc   = "src/dynpmc/";
my $dirtest  = "t/dynpmc/";

#find_files($base_dir,$dirpmc,$dirtest);

Hi Igor,
First, thank you for taking the time to write this script.

Unfortunately, the test needs to be added to t/distro/test_file_coverage.t in Parrot. This ensures that it is run every time Parrot's test suite is run via make test. It should be fairly easy to copy and modify the existing code in t/distro/test_file_coverage.t to make it match dynpmc and dynops source code to test files, but I'll be glad to help if you run into any issues.

While you're working on the test, you can run it directly as a Perl script or with prove. Note that you have to run perl Configure.pl before this test will work.

To learn how to contribute, I highly recommend the documentation in docs/project, especially cage_cleaners_guide.pod and committer_guide.pod. When modifying existing tests, it's best to work against svn trunk and update often. This avoids conflicts and makes it easy to generate patches.

Once you have t/distro/test_file_coverage.t updated and working, create a diff:
svn diff >dynpmc_dynops_test_coverage.patch
and attach that to a reply to this thread. You should also generally run make codingstd_tests before submitting a patch, but I'll remember if you don't. ;)

Again, thank you for contributing. I hope at least some of this information is new to you.
Christoph


Reply via email to