Commit ecf0cfed authored by Steve Fink's avatar Steve Fink
Browse files

Bug 1597005 - Fix test that requires not looking through base class typedef r=jimb

Differential Revision: https://phabricator.services.mozilla.com/D54231

--HG--
extra : moz-landing-system : lando
parent 7f1530d5
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -25,12 +25,21 @@ UNIFIED_SOURCES += [
    'tests/test-JSString.cpp',
    'tests/test-JSSymbol.cpp',
    'tests/test-jsval.cpp',
    'tests/test-prettyprinters.cpp',
    'tests/test-Root.cpp',
    'tests/test-unwind.cpp',
    'tests/typedef-printers.cpp',
]

SOURCES += [
    'tests/test-prettyprinters.cpp'
]

if CONFIG['CC_TYPE'] != 'clang-cl':
    # Test expects to see pre-typedef names of base classes, but the compiler will
    # normally omit those from the debuginfo. The current clang-cl does not support
    # this option.
    SOURCES['tests/test-prettyprinters.cpp'].flags += ['-fno-eliminate-unused-debug-types']

DEFINES['EXPORT_JS_API'] = True

LOCAL_INCLUDES += [
+14 −2
Original line number Diff line number Diff line
@@ -20,8 +20,20 @@ assert_eq(implemented_type_names('c'), ['C'])
assert_eq(implemented_type_names('c_'), ['C_', 'C'])
assert_eq(implemented_type_names('e'), ['E', 'C', 'D'])
assert_eq(implemented_type_names('e_'), ['E_', 'E', 'C', 'D'])

# Some compilers strip trivial typedefs in the debuginfo from classes' base
# classes. Sometimes this can be fixed with -fno-eliminate-unused-debug-types,
# but not always. Allow this test to pass if the typedefs are stripped.
#
# It would probably be better to figure out how to make the compiler emit them,
# since I think this test is here for a reason.
if gdb.lookup_type('F').fields()[0].name == 'C_':
    # We have the typedef info.
    assert_eq(implemented_type_names('f'), ['F', 'C_', 'D_', 'C', 'D'])
    assert_eq(implemented_type_names('h'), ['H', 'F', 'G', 'C_', 'D_', 'C', 'D'])
else:
    assert_eq(implemented_type_names('f'), ['F', 'C', 'D'])
    assert_eq(implemented_type_names('h'), ['H', 'F', 'G', 'C', 'D'])

# Check that our pretty-printers aren't interfering with printing other types.
assert_pretty('10', '10')