Ticket #703 (closed bug: fixed)

Opened 13 years ago

Last modified 13 years ago

t/tools/pmc2c.t: Two test failures

Reported by: jkeenan Owned by: jkeenan
Priority: major Milestone:
Component: core Version: 1.2.0
Severity: high Keywords: pmc
Cc: Language:
Patch status: applied Platform:

Description

Two failures have emerged in t/tools/pmc2c.t in the past 24 hours.

t/tools/pmc2c....
1..13

# skip

PMC filename pmc2c.t_8.pmc does not match pmclass name a!
not ok 8 - maps

#   Failed test 'maps'
#   at t/tools/pmc2c.t line 49.
#                   '/* ex: set ro ft=c:
#  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
#  *
#  * This file is generated automatically from './t/tools/pmc2c.t_8.pmc'
#  * by tools/build/pmc2c.pl.
#  *
#  * Any changes made here will be lost!
#  *
#  */
# 
# /* HEADERIZER HFILE: none */
# /* HEADERIZER STOP */
# 
# #include "parrot/parrot.h"
# #include "parrot/extend.h"
# #include "parrot/dynext.h"
# #include "pmc_a.h"
# #include "pmc_default.h"
# #include "a.str"
# #include "pmc_continuation.h"
# #line 1 "./t/tools/pmc2c.t_8.pmc"
# #line 22 "./t/tools/pmc2c.t_8.c"
# void    Parrot_a_class_init(PARROT_INTERP, int, int);
# PARROT_EXPORT VTABLE* Parrot_a_update_vtable(VTABLE*);
# PARROT_EXPORT VTABLE* Parrot_a_get_vtable(PARROT_INTERP);
# void    Parrot_a_ro_class_init(PARROT_INTERP, int, int);
# PARROT_EXPORT VTABLE* Parrot_a_ro_update_vtable(VTABLE*);
# PARROT_EXPORT VTABLE* Parrot_a_ro_get_vtable(PARROT_INTERP);
# #include "pmc_default.h"
# 
# PARROT_EXPORT VTABLE *Parrot_a_update_vtable(VTABLE *vt) {
# 
#     return vt;
# }
# 
# 
# PARROT_EXPORT VTABLE *Parrot_a_ro_update_vtable(VTABLE *vt) {
# 
#     return vt;
# }
# 
# PARROT_EXPORT
# VTABLE* Parrot_a_get_vtable(PARROT_INTERP) {
#     VTABLE *vt;
#     vt = Parrot_default_get_vtable(interp);
#     Parrot_a_update_vtable(vt);
# 
#     return vt;
# }
# 
# PARROT_EXPORT
# VTABLE* Parrot_a_ro_get_vtable(PARROT_INTERP) {
#     VTABLE *vt;
#     vt = Parrot_default_ro_get_vtable(interp);
#     Parrot_a_ro_update_vtable(vt);
# 
#     return vt;
# }
# 
# void
# Parrot_a_class_init(PARROT_INTERP, int entry, int pass)
# {
#     static const char attr_defs [] =
#         "";
#     if (pass == 0) {
#         VTABLE *vt_ro;
#         Hash    *isa_hash  = NULL;
#         VTABLE * const vt  = Parrot_a_get_vtable(interp);
#         vt->base_type      = enum_class_a;
#         vt->flags          = 0|VTABLE_HAS_READONLY_FLAG;
#         vt->attribute_defs = attr_defs;
# 
#         vt_ro                 = Parrot_a_ro_get_vtable(interp);
#         vt_ro->base_type      = enum_class_a;
#         vt_ro->flags          = 0|VTABLE_IS_READONLY_FLAG;
#         vt_ro->attribute_defs = attr_defs;
# 
#         vt->whoami       = CONST_STRING_GEN(interp, "a");
#         vt->provides_str = CONST_STRING_GEN(interp, "scalar");
#         vt->isa_hash     = NULL;
#         vt_ro->base_type    = entry;
#         vt_ro->whoami       = vt->whoami;
#         vt_ro->provides_str = vt->provides_str;
#         vt->ro_variant_vtable    = vt_ro;
#         vt_ro->ro_variant_vtable = vt;
#         vt_ro->isa_hash          = isa_hash;
#         interp->vtables[entry] = vt;
#     }
#     else { /* pass */
# 
#         {
#             /* Register this PMC as a HLL mapping */
#             const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
#             if (pmc_id > 0) {
#                 Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
#             }
#         } /* Register */
#         {
#             PMC    *       mro = pmc_new(interp, enum_class_ResizableStringArray);
#             VTABLE * const vt  = interp->vtables[entry];
# 
#             vt->mro = mro;
# 
#             if (vt->ro_variant_vtable)
#                 vt->ro_variant_vtable->mro = mro;
# 
#             VTABLE_push_string(interp, mro, CONST_STRING_GEN(interp, "a"));
#         }
# 
#         /* set up MRO and _namespace */
#         Parrot_create_mro(interp, entry);
#         {
#         }
#     } /* pass */
# } /* Parrot_a_class_init */
# #line 1 "./t/tools/pmc2c.t_8.pmc"
# 
# '
#     doesn't match '(?-xism:\ \ \ \ \ \ \ \ \ \ \ \ const\ INTVAL\ pmc_id\ \=\ Parrot_get_HLL_id\(\ interp\,\ CONST_STRING_GEN\(interp\,\ \"dale\"\)\
# \ \ \ \ \ \ \ \ \ \ \ \ \)\;\
# \ \ \ \ \ \ \ \ \ \ \ \ if\ \(pmc_id\ \>\ 0\)\ \{\
# \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Parrot_register_HLL_type\(\ interp\,\ pmc_id\,\ enum_class_Integer\,\ entry\)\;\
# \ \ \ \ \ \ \ \ \ \ \ \ \})'
PMC filename pmc2c.t_9.pmc does not match pmclass name a!
not ok 9 - maps, more than one.

#   Failed test 'maps, more than one.'
#   at t/tools/pmc2c.t line 49.
#                   '/* ex: set ro ft=c:
#  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
#  *
#  * This file is generated automatically from './t/tools/pmc2c.t_9.pmc'
#  * by tools/build/pmc2c.pl.
#  *
#  * Any changes made here will be lost!
#  *
#  */
# 
# /* HEADERIZER HFILE: none */
# /* HEADERIZER STOP */
# 
# #include "parrot/parrot.h"
# #include "parrot/extend.h"
# #include "parrot/dynext.h"
# #include "pmc_a.h"
# #include "pmc_default.h"
# #include "a.str"
# #include "pmc_continuation.h"
# #line 1 "./t/tools/pmc2c.t_9.pmc"
# #line 22 "./t/tools/pmc2c.t_9.c"
# void    Parrot_a_class_init(PARROT_INTERP, int, int);
# PARROT_EXPORT VTABLE* Parrot_a_update_vtable(VTABLE*);
# PARROT_EXPORT VTABLE* Parrot_a_get_vtable(PARROT_INTERP);
# void    Parrot_a_ro_class_init(PARROT_INTERP, int, int);
# PARROT_EXPORT VTABLE* Parrot_a_ro_update_vtable(VTABLE*);
# PARROT_EXPORT VTABLE* Parrot_a_ro_get_vtable(PARROT_INTERP);
# #include "pmc_default.h"
# 
# PARROT_EXPORT VTABLE *Parrot_a_update_vtable(VTABLE *vt) {
# 
#     return vt;
# }
# 
# 
# PARROT_EXPORT VTABLE *Parrot_a_ro_update_vtable(VTABLE *vt) {
# 
#     return vt;
# }
# 
# PARROT_EXPORT
# VTABLE* Parrot_a_get_vtable(PARROT_INTERP) {
#     VTABLE *vt;
#     vt = Parrot_default_get_vtable(interp);
#     Parrot_a_update_vtable(vt);
# 
#     return vt;
# }
# 
# PARROT_EXPORT
# VTABLE* Parrot_a_ro_get_vtable(PARROT_INTERP) {
#     VTABLE *vt;
#     vt = Parrot_default_ro_get_vtable(interp);
#     Parrot_a_ro_update_vtable(vt);
# 
#     return vt;
# }
# 
# void
# Parrot_a_class_init(PARROT_INTERP, int entry, int pass)
# {
#     static const char attr_defs [] =
#         "";
#     if (pass == 0) {
#         VTABLE *vt_ro;
#         Hash    *isa_hash  = NULL;
#         VTABLE * const vt  = Parrot_a_get_vtable(interp);
#         vt->base_type      = enum_class_a;
#         vt->flags          = 0|VTABLE_HAS_READONLY_FLAG;
#         vt->attribute_defs = attr_defs;
# 
#         vt_ro                 = Parrot_a_ro_get_vtable(interp);
#         vt_ro->base_type      = enum_class_a;
#         vt_ro->flags          = 0|VTABLE_IS_READONLY_FLAG;
#         vt_ro->attribute_defs = attr_defs;
# 
#         vt->whoami       = CONST_STRING_GEN(interp, "a");
#         vt->provides_str = CONST_STRING_GEN(interp, "scalar");
#         vt->isa_hash     = NULL;
#         vt_ro->base_type    = entry;
#         vt_ro->whoami       = vt->whoami;
#         vt_ro->provides_str = vt->provides_str;
#         vt->ro_variant_vtable    = vt_ro;
#         vt_ro->ro_variant_vtable = vt;
#         vt_ro->isa_hash          = isa_hash;
#         interp->vtables[entry] = vt;
#     }
#     else { /* pass */
# 
#         {
#             /* Register this PMC as a HLL mapping */
#             const INTVAL pmc_id = Parrot_get_HLL_id( interp, CONST_STRING_GEN(interp, "dale"));
#             if (pmc_id > 0) {
#                 Parrot_register_HLL_type( interp, pmc_id, enum_class_Float, entry);
#                 Parrot_register_HLL_type( interp, pmc_id, enum_class_Integer, entry);
#             }
#         } /* Register */
#         {
#             PMC    *       mro = pmc_new(interp, enum_class_ResizableStringArray);
#             VTABLE * const vt  = interp->vtables[entry];
# 
#             vt->mro = mro;
# 
#             if (vt->ro_variant_vtable)
#                 vt->ro_variant_vtable->mro = mro;
# 
#             VTABLE_push_string(interp, mro, CONST_STRING_GEN(interp, "a"));
#         }
# 
#         /* set up MRO and _namespace */
#         Parrot_create_mro(interp, entry);
#         {
#         }
#     } /* pass */
# } /* Parrot_a_class_init */
# #line 1 "./t/tools/pmc2c.t_9.pmc"
# 
# '
#     doesn't match '(?-xism:\ \ \ \ \ \ \ \ \ \ \ \ const\ INTVAL\ pmc_id\ \=\ Parrot_get_HLL_id\(\ interp\,\ CONST_STRING_GEN\(interp\,\ \"dale\"\)\
# \ \ \ \ \ \ \ \ \ \ \ \ \)\;\
# \ \ \ \ \ \ \ \ \ \ \ \ if\ \(pmc_id\ \>\ 0\)\ \{\
# \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Parrot_register_HLL_type\(\ interp\,\ pmc_id\,\ enum_class_Float\,\ entry\)\;\
# \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Parrot_register_HLL_type\(\ interp\,\ pmc_id\,\ enum_class_Integer\,\ entry\)\;\
# \ \ \ \ \ \ \ \ \ \ \ \ \})'
PMC filename pmc2c.t_10.pmc does not match pmclass name a!
ok 10 - maps
PMC filename pmc2c.t_11.pmc does not match pmclass name a!
ok 11 - maps
PMC filename pmc2c.t_12.pmc does not match pmclass name a!
ok 12 - line+pod
PMC filename pmc2c.t_13.pmc does not match pmclass name a!
ok 13 - line+pod
# Looks like you failed 2 tests of 13.
 Dubious, test returned 2 (wstat 512, 0x200)
 Failed 2/13 subtests 

Test Summary Report
-------------------
t/tools/pmc2c (Wstat: 512 Tests: 13 Failed: 2)
  Failed tests:  8-9
  Non-zero exit status: 2
Files=1, Tests=13,  4 wallclock secs ( 0.01 usr  0.01 sys +  2.46 cusr  0.26 csys =  2.74 CPU)
Result: FAIL

Am currently bisecting to identify the origin of the error.

Change History

  Changed 13 years ago by jkeenan

My bisection suggests that r39137 is the source of the problem.

  Changed 13 years ago by NotFound

This is the problem:

https://trac.parrot.org/parrot/changeset?old_path=%2Ftrunk%2Flib%2FParrot%2FPmc2c%2FPMCEmitter.pm&old=39137&new_path=%2Ftrunk%2Flib%2FParrot%2FPmc2c%2FPMCEmitter.pm&new=39136

And this is the solution:

https://trac.parrot.org/parrot/changeset/39159/

The real problem IMO is that some tests are so simplistic that you can't change even a cosmetic detail without breaking them.

  Changed 13 years ago by jkeenan

  • status changed from new to assigned
  • owner set to jkeenan

  Changed 13 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed
  • patch set to applied

NotFound's patch fixes the immediate problem. With that test passing, I was able to merge a branch into trunk.

So I'm resolving this ticket. If anyone would like to develop less simplistic tests for this file, please open a new TT and reference this one.

Also, people, please ... If you commit code to trunk that affects files with things like src or pmc in their names or paths, please do yourself and everyone else a favor and, at the very least, run 'make coretest' before you do that commit. We lost multiple hours (on a holiday weekend, at least for those of us in US) dealing with this.

Thank you very much.
kid51

follow-up: ↓ 6   Changed 13 years ago by chromatic

If we lost multiple hours of potential work due to these test failures, let's delete the tests. They're not worth that (and they don't prove anything interesting about the code).

in reply to: ↑ 5   Changed 13 years ago by coke

Replying to chromatic:

If we lost multiple hours of potential work due to these test failures, let's delete the tests. They're not worth that (and they don't prove anything interesting about the code).

+1

Note: See TracTickets for help on using tickets.