# TestSwiftBackwardsCompatibilitySimple.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2018 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
# ------------------------------------------------------------------------------
import lldb
from lldbsuite.test.decorators import *
import lldbsuite.test.lldbtest as lldbtest
import lldbsuite.test.lldbutil as lldbutil
import os
import swift
import unittest2


class TestSwiftBackwardsCompatibilitySimple(lldbtest.TestBase):

    mydir = lldbtest.TestBase.compute_mydir(__file__)

    @swiftTest
    @skipIf(compiler="swiftc", compiler_version=['<', '5.0'])
    def test_simple(self):
        if 'SWIFTC' in os.environ:
            compiler = os.environ['SWIFTC']
        else:
            compiler = swift.getSwiftCompiler()
        version = self.getCompilerVersion(compiler)
        if version < '5.0':
            self.skipTest('Swift compiler predates stable ABI')
        self.build()
        self.expect("log enable lldb types break")
        lldbutil.run_to_source_breakpoint(self, "break here",
                                          lldb.SBFileSpec('main.swift'))
        # FIXME: Removing the next line breaks subsequent expressions
        #        when the swiftmodules can't be loaded.
        self.expect("fr v")
        self.expect("fr v number", substrs=['23'])
        self.expect("fr v array", substrs=['1', '2', '3'])
        self.expect("fr v string", substrs=['"hello"'])
        self.expect("fr v tuple", substrs=['42', '"abc"'])
        # FIXME: This doesn't work.
        #self.expect("fr v generic", substrs=['-1'])

if __name__ == '__main__':
    import atexit
    lldb.SBDebugger.Initialize()
    atexit.register(lldb.SBDebugger.Terminate)
    unittest2.main()

@@ -1172,59 +1172,8 @@
 d()%0A
-        self.expect(%22log enable lldb types break%22)%0A
     

Remove the log enabling from april; we're not debugging that bot now. This should have used a teardownhook to disable the logs after they were enabled.