# New Ticket Created by James Keenan # Please include the string: [perl #41774] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41774 >
I got errors in 5 different tests running 'make test' this morning on a tree freshly updated from trunk. An excerpt from 'make test' output is attached. Set aside the failure in t/perl/Parrot_Distribution.t; that's well known. Here's the output of 'prove -v' on the other 4 files: [parrot] 526 $ prove -v t/codingstd/cuddled_else.t \ > t/codingstd/trailing_space.t \ > t/pmc/metaclass.t \ > t/pmc/string.t t/codingstd/cuddled_else......1..1 not ok 1 - cuddled else # Failed test (t/codingstd/cuddled_else.t at line 58) # cuddled else found in 2 files: # /Users/jimk/work/parrot/src/pmc/metaclass.pmc: 406 # /Users/jimk/work/parrot/src/pmc/object.pmc: 107 132 # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/codingstd/trailing_space....1..1 not ok 1 - No trailing spaces or tabs # Failed test (t/codingstd/trailing_space.t at line 64) # Trailing space or tab char found in 1 files: # /Users/jimk/work/parrot/src/pmc/metaclass.pmc # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/pmc/metaclass...............1..8 ok 1 - new not ok 2 - Class PMC has ten attributes # Failed test (t/pmc/metaclass.t at line 49) # got: 'Method 'keys' not found # current instr.: 'test' pc 18 (/Users/jimk/work/parrot/t/pmc/ metaclass_2.pir:4) # ' # expected: 'ok 1 - Class PMC has ten attributes # ' # './parrot "/Users/jimk/work/parrot/t/pmc/metaclass_2.pir"' failed with exit code 1 ok 3 - Class have "I am a class" flag set not ok 4 - name # Failed test (t/pmc/metaclass.t at line 85) # got: 'not ok 1 - name() with no args returns class name # ok 2 - name() with args sets class name # ' # expected: 'ok 1 - name() with no args returns class name # ok 2 - name() with args sets class name # ' ok 5 - new ok 6 - attributes not ok 7 - parents # Failed test (t/pmc/metaclass.t at line 155) # got: 'not ok 1 - parents() returns a ResizableStringArray # ' # expected: 'ok 1 - parents() returns a ResizableStringArray # ' not ok 8 - roles # Failed test (t/pmc/metaclass.t at line 177) # got: 'not ok 1 - roles() returns a ResizableStringArray # ' # expected: 'ok 1 - roles() returns a ResizableStringArray # ' # Looks like you failed 4 tests of 8. dubious Test returned status 4 (wstat 1024, 0x400) DIED. FAILED tests 2, 4, 7-8 Failed 4/8 tests, 50.00% okay t/pmc/string..................1..47 ok 1 - Set/get strings ok 2 - Setting integers ok 3 - Setting numbers ok 4 - ensure that concat ppp copies strings ok 5 - ensure that concat pps copies strings ok 6 - Setting string references ok 7 - Assigning string copies ok 8 - repeat ok 9 - n_repeat ok 10 - repeat_int ok 11 - n_repeat_int ok 12 - if(String) ok 13 - concat ok 14 - n_concat ok 15 - cmp ok 16 - cmp with Integer ok 17 - substr not ok 18 - Out-of-bounds substr, +ve offset # Failed test (t/pmc/string.t at line 623) # 'Cannot take substr outside string # current instr.: '(null)' pc 6 (/Users/jimk/work/parrot/t/pmc/ string_18.pasm:3) # ' # doesn't match '/^Cannot take substr outside string$/ # ' # './parrot "/Users/jimk/work/parrot/t/pmc/string_18.pasm"' failed with exit code 1 not ok 19 - Out-of-bounds substr, -ve offset # Failed test (t/pmc/string.t at line 632) # 'Cannot take substr outside string # current instr.: '(null)' pc 6 (/Users/jimk/work/parrot/t/pmc/ string_19.pasm:3) # ' # doesn't match '/^Cannot take substr outside string$/ # ' # './parrot "/Users/jimk/work/parrot/t/pmc/string_19.pasm"' failed with exit code 1 ok 20 - bands NULL string ok 21 - bands 2 ok 22 - bands 3 ok 23 - bors NULL string ok 24 - bors 2 ok 25 - bors 3 ok 26 - bxors NULL string ok 27 - bxors 2 ok 28 - bxors 3 ok 29 - bnots NULL string ok 30 - eq_str ok 31 - ne_str ok 32 - set const and chop ok 33 - check whether interface is done ok 34 - Clone ok 35 - set P[x], i ok 36 - set P[x], s ok 37 - String."replace" ok 38 - set I0, P0 - string_to_int ok 39 - String."trans" ok 40 - reverse P0 - reverse string ok 41 - is_integer - check integer ok 42 - new_from_string ok 43 - get_string returns COW string ok 44 - to_int 1 ok 45 - to_int 2 ok 46 - to_int 3 ok 47 - elements gives length of string # Looks like you failed 2 tests of 47. dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 18-19 Failed 2/47 tests, 95.74% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------ ------- t/codingstd/cuddled_else.t 1 256 1 1 1 t/codingstd/trailing_space.t 1 256 1 1 1 t/pmc/metaclass.t 4 1024 8 4 2 4 7-8 t/pmc/string.t 2 512 47 2 18-19 Failed 4/4 test scripts. 8/57 subtests failed. Files=4, Tests=57, 26 wallclock secs ( 9.17 cusr + 3.68 csys = 12.85 CPU) Failed 4/4 test programs. 8/57 subtests failed. The files that came in with my most recent 'svn update' were: [parrot] 518 $ svn update U src/pmc/object.pmc U src/pmc/metaclass.pmc U lib/Parrot/Pmc2c/PMETHODs.pm Two of these three files showed up in 'make test' associated with failures. We can fix the cuddled else and trailing space problems in src/pmc/ metaclass.pmc with the attached patch: metaclass.pmc.patch.txt. We can fix the cuddled else problem in src/pmc/object.pmc with the attached patch: object.pmc.patch.txt Since these are essentially typographic corrections, I will apply them directly to trunk. However, my guess is that conceptual problems in the two files are causing the test failures in t/pmc/ metaclass.t and t/pmc/string.t. I don't know how to fix those, so I leave them to others. Thank you very much. kid51
t/pmc/metaclass.......................... # Failed test (t/pmc/metaclass.t at line 49) # got: 'Method 'keys' not found # current instr.: 'test' pc 18 (/Users/jimk/work/parrot/t/pmc/metaclass_2.pir:4) # ' # expected: 'ok 1 - Class PMC has ten attributes # ' # './parrot -D40 --gc-debug "/Users/jimk/work/parrot/t/pmc/metaclass_2.pir"' failed with exit code 1 # Failed test (t/pmc/metaclass.t at line 85) # got: 'not ok 1 - name() with no args returns class name # ok 2 - name() with args sets class name # ' # expected: 'ok 1 - name() with no args returns class name # ok 2 - name() with args sets class name # ' # Failed test (t/pmc/metaclass.t at line 155) # got: 'not ok 1 - parents() returns a ResizableStringArray # ' # expected: 'ok 1 - parents() returns a ResizableStringArray # ' # Failed test (t/pmc/metaclass.t at line 177) # got: 'not ok 1 - roles() returns a ResizableStringArray # ' # expected: 'ok 1 - roles() returns a ResizableStringArray # ' # Looks like you failed 4 tests of 8. dubious Test returned status 4 (wstat 1024, 0x400) DIED. FAILED tests 2, 4, 7-8 Failed 4/8 tests, 50.00% okay [snip] t/pmc/string............................. # Failed test (t/pmc/string.t at line 623) # 'Cannot take substr outside string # current instr.: '(null)' pc 6 (/Users/jimk/work/parrot/t/pmc/string_18.pasm:3) # ' # doesn't match '/^Cannot take substr outside string$/ # ' # './parrot -D40 --gc-debug "/Users/jimk/work/parrot/t/pmc/string_18.pasm"' failed with exit code 1 # Failed test (t/pmc/string.t at line 632) # 'Cannot take substr outside string # current instr.: '(null)' pc 6 (/Users/jimk/work/parrot/t/pmc/string_19.pasm:3) # ' # doesn't match '/^Cannot take substr outside string$/ # ' # './parrot -D40 --gc-debug "/Users/jimk/work/parrot/t/pmc/string_19.pasm"' failed with exit code 1 # Looks like you failed 2 tests of 47. dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 18-19 Failed 2/47 tests, 95.74% okay [snip] t/perl/Parrot_Distribution............... # Failed test (t/perl/Parrot_Distribution.t at line 103) # Looks like you failed 1 test of 34. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 34 Failed 1/34 tests, 97.06% okay [snip] /codingstd/cuddled_else................. # Failed test (t/codingstd/cuddled_else.t at line 58) # cuddled else found in 2 files: # /Users/jimk/work/parrot/src/pmc/metaclass.pmc: 406 # /Users/jimk/work/parrot/src/pmc/object.pmc: 107 132 # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/codingstd/line_endings.................skipped all skipped: SVN::Client not installed t/codingstd/tabs.........................ok t/codingstd/trailing_space............... # Failed test (t/codingstd/trailing_space.t at line 64) # Trailing space or tab char found in 1 files: # /Users/jimk/work/parrot/src/pmc/metaclass.pmc # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/codingstd/cuddled_else.t 1 256 1 1 1 t/codingstd/trailing_space.t 1 256 1 1 1 t/perl/Parrot_Distribution.t 1 256 34 1 34 t/pmc/metaclass.t 4 1024 8 4 2 4 7-8 t/pmc/string.t 2 512 47 2 18-19 (1 subtest UNEXPECTEDLY SUCCEEDED), 11 tests and 602 subtests skipped. Failed 5/268 test scripts. 9/6604 subtests failed. Files=268, Tests=6604, 1194 wallclock secs (501.32 cusr + 244.25 csys = 745.57 CPU) Failed 5/268 test programs. 9/6604 subtests failed. make: *** [test] Error 1
Index: src/pmc/metaclass.pmc =================================================================== --- src/pmc/metaclass.pmc (revision 17421) +++ src/pmc/metaclass.pmc (working copy) @@ -51,7 +51,7 @@ int j; for (j = 0; j < elements; j++) { /* Append to class name. */ - fq_class = string_append(interp, fq_class, + fq_class = string_append(interp, fq_class, VTABLE_get_string_keyed_int(interp, fq_name, j)); fq_class = string_append(interp, fq_class, seperator); } @@ -97,7 +97,7 @@ /* Get attribute name and append it to the key. */ (STRING *attrib_name) = PMINVOKE(interp, cur_attrib, "name"); full_key = string_append(interp, full_key, attrib_name); - + /* Insert into hash, along with index. */ VTABLE_set_integer_keyed_str(interp, table, full_key, cur_index); cur_index++; @@ -395,7 +395,7 @@ */ PMETHOD void _get_attrib_index(STRING *name) { Parrot_MetaClass *class = PARROT_METACLASS(SELF); - + /* If we can't find the attribute, we hand back -1. */ int index = -1; @@ -403,7 +403,8 @@ if (VTABLE_exists_keyed_str(interp, class->attrib_cache, name)) { /* Yay! We got a cache hit! */ index = VTABLE_get_integer_keyed_str(interp, class->attrib_cache, name); - } else { + } + else { /* No hit. We need to walk up the list of parents to try and find the * attribute. */ int num_classes = VTABLE_elements(interp, class->all_parents);
Index: src/pmc/object.pmc =================================================================== --- src/pmc/object.pmc (revision 17421) +++ src/pmc/object.pmc (working copy) @@ -104,7 +104,8 @@ if (index == -1) { real_exception(interp, NULL, ATTRIB_NOT_FOUND, "No such attribute '%S'", name); return PMCNULL; - } else { + } + else { return VTABLE_get_pmc_keyed_int(interp, obj->attrib_store, index); } } @@ -129,7 +130,8 @@ /* If lookup failed, exception. */ if (index == -1) { real_exception(interp, NULL, ATTRIB_NOT_FOUND, "No such attribute '%S'", name); - } else { + } + else { VTABLE_set_pmc_keyed_int(interp, obj->attrib_store, index, value); } }