--- El vie 12-sep-08, Christoph Otto <[EMAIL PROTECTED]> escribió: De:: Christoph Otto <[EMAIL PROTECTED]> Asunto: Re: [perl #44457] [TODO] make sure files match test files for DYNPMCs and DYNOPs etc A: [EMAIL PROTECTED], [EMAIL PROTECTED] Fecha: viernes, 12 septiembre, 2008, 6:56 am
[EMAIL PROTECTED] via RT wrote: > > --- El mié 10-sep-08, Rafael Sanchez <[EMAIL PROTECTED]> escribió: > De:: Rafael Sanchez <[EMAIL PROTECTED]> > Asunto: Re: [perl #44457] [TODO] make sure files match test files for DYNPMCs and DYNOPs etc > A: "Christoph Otto via RT" <[EMAIL PROTECTED]> > Cc: perl6-internals@perl.org > Fecha: miércoles, 10 septiembre, 2008, 6:26 pm > On Mon Aug 06 06:08:54 2007, pcoch wrote: >> In the file t/distro/test_file_coverage.t there is the todo item: >> >> # TODO: DYNPMC, DYNOPS, etc >> >> This is in the context of making sure that the files match the test >> files. This needs to be implemented. > > Is this as simple as writing a test to make sure every 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 Hi Christoph, Actually all information you gave me is new to me, here in Mexico programmers(in companiies I've worked), don't use any testing software, In my last job we couldn't install subversion in a linux server(don't ask me why, "they had installed a windows server"), and in some gobernment offices is not possible to install free software on windows. I'm going to install parrot again, making all tests indicated in parrot wiki, and read all tests pods and install all test software. And in some days, I expect to send you my first patch. Sincerely, Igor __________________________________________________ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.yahoo.com.mx/