On Sun, 15 Apr 2007 05:49:06 -0700 Bernhard Schmalhofer (via RT) <[EMAIL PROTECTED]> wrote: > languages/dotnet/src/builtins.pir is a generated file, so > editor hints are not very useful there. > > So t/codingstd/pir_code_coda.t should not check builtins.pir.
Here's a patch with 2 parts: 1. Make the test script ignore autogenerated files. (Based on the common idiom that autogenerated files start with a "# THIS IS A GENERATED FILE! DO NOT EDIT!" comment.) Also, ignore files which don't actually exist.[1] (Assuming they will be autogenerated, but we haven't done a "make languages" yet or whatever... haven't gotten to that stage of the build process yet.) 2. Remove the autogenerated file from source control; it looked like it had been added and given some editor tagging to satisfy the test in the meantime. This means the file shows up in "svn st" or "svk st" as modified, after a "make languages", which annoyed me enough to make this patch. [1]: I had to add the file existence check mentioned in part 1, because the test seemed to interpret a nonexistent file as if it were an empty file (it didn't die() like I thought it would after reading the test source). I don't know what that's about. [EMAIL PROTECTED] ~/parrot $ ls -l languages/dotnet/src/builtins.pir ls: cannot access languages/dotnet/src/builtins.pir: No such file or directory [EMAIL PROTECTED] ~/parrot $ prove t/codingstd/pir_code_coda.t t/codingstd/pir_code_coda.... # Failed test (t/codingstd/pir_code_coda.t at line 81) # PIR code coda missing in 1 files: # /home/paranoid/parrot/languages/dotnet/src/builtins.pir # Looks like you failed 1 test of 2. t/codingstd/pir_code_coda....dubious Test returned status 1 (wstat 256, 0x100) Mark
=== t/codingstd/pir_code_coda.t ================================================================== --- t/codingstd/pir_code_coda.t (revision 20197) +++ t/codingstd/pir_code_coda.t (local) @@ -54,6 +54,7 @@ # otherwise, use the relevant Parrot:: path method my $path = @ARGV ? $file : $file->path; + next unless -f $path; # slurp in the file open( my $fh, '<', $path ) or die "Cannot open '$path' for reading: $!\n"; @@ -62,6 +63,9 @@ $buf = <$fh>; } + # skip autogenerated files (based on the first line of the file) + next if(index($buf, "# THIS IS A GENERATED FILE! DO NOT EDIT!") == 0); + # append to the no_coda array if the code doesn't match push @no_coda => "$path\n" unless $buf =~ m{\Q$coda\E\n*\z}; === languages/dotnet/src/builtins.pir ================================================================== --- languages/dotnet/src/builtins.pir (revision 20197) +++ languages/dotnet/src/builtins.pir (local) @@ -1,69 +0,0 @@ -# THIS IS A GENERATED FILE! DO NOT EDIT! - -.HLL '_dotnet', '' - -.sub internal_method_body - .param pmc class - .param pmc meth - .local string class_name, method_name, body - - # Get class and method names. - class_name = class.get_fullname() - method_name = meth -if class_name == "System.Object" goto CLASS_System_Object -goto FAIL -CLASS_System_Object: -if method_name == "GetType" goto UNIMPLEMENTED -if method_name == "InternalGetHashCode" goto BODY_System_Object___InternalGetHashCode -if method_name == "MemberwiseClone" goto BODY_System_Object___MemberwiseClone -if method_name == "obj_address" goto BODY_System_Object___obj_address -goto FAIL -FAIL: - $P0 = new .Exception - $P0["_message"] = "No body supplied for built-in method" - throw $P0 -BODY_System_Object___InternalGetHashCode: -body = <<"___BUILTIN_CODE___" - .param pmc obj - $I0 = obj.__hash(42) - .return($I0) - - -___BUILTIN_CODE___ -goto END -BODY_System_Object___MemberwiseClone: -body = <<"___BUILTIN_CODE___" - .local pmc cpy - cpy = clone self - .return(cpy) - - -___BUILTIN_CODE___ -goto END -BODY_System_Object___obj_address: -body = <<"___BUILTIN_CODE___" - $I0 = net_pmc_addr self - .return($I0) -___BUILTIN_CODE___ -goto END - # Generic unimplemented internal method body (throws exception). -UNIMPLEMENTED: - body = <<"PIR" -$P0 = new .Exception -$P0["_message"] = "System.NotImplementedException" -$P1 = new "System.NotImplementedException" -$P0["obj"] = $P1 -throw $P0 -PIR - - # Return. -END: - .return(body) -.end - - -# Local Variables: -# mode: pir -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: Property changes on: languages/dotnet/src/builtins.pir ___________________________________________________________________ Name: svn:eol-style -native Name: svn:keywords -Author Date Id Revision