tests/GDBDebuggerTestCase.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 20 Oct 2018 07:48:11 +0100
changeset 152 fab425b52c21
parent 95 f417138e9c48
child 208 b0d2028189fa
permissions -rw-r--r--
Refactor `GDBProcess` hierarchy to improve portability Spawning and managing an OS process is tightly bound to the underlaying platform (both, smalltalk-wise and OS-wise). To improve portability and clarity of the code, rename `GDBUnixProcess` and `GDBWindowsProcess` to `GDBStXUnixProcess` and `GDBStxWindowsProcess`. This commit also includes a new abstract superclass (a `GDBLocalProcess`) for all specialisation spawning and managing a GDB process running on the same host as `jv:libgdbs` code.

"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
"{ Package: 'jv:libgdbs/tests' }"

"{ NameSpace: Smalltalk }"

TestCase subclass:#GDBDebuggerTestCase
	instanceVariableNames:'debugger'
	classVariableNames:'DebuggerSetupBlock'
	poolDictionaries:''
	category:'GDB-Core-Tests'
!

!GDBDebuggerTestCase class methodsFor:'documentation'!

copyright
"
jv:libgdbs - GNU Debugger Interface Library
Copyright (C) 2015-now Jan Vrany

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License. 

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
"
! !

!GDBDebuggerTestCase class methodsFor:'accessing'!

resources
    ^ Array with: GDBDebuggeesResource

    "Created: / 28-02-2015 / 00:45:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBDebuggerTestCase class methodsFor:'queries'!

isAbstract
    "Return if this class is an abstract class.
     True is returned here for myself only; false for subclasses.
     Abstract subclasses must redefine again."

    ^ self == GDBDebuggerTestCase.
! !

!GDBDebuggerTestCase methodsFor:'running'!

setUp
    super setUp.
    debugger := DebuggerSetupBlock notNil ifTrue:[ DebuggerSetupBlock value ] ifFalse:[ GDBDebugger new ].
    self assert:(debugger isKindOf: GDBDebugger).
    self assert: debugger isConnected.

    "Created: / 18-10-2018 / 10:34:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 19-10-2018 / 09:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

tearDown
    (debugger notNil and:[ debugger isConnected ]) ifTrue:[ 
        debugger send: 'quit' andWait: false.
    ].
    super tearDown.

    "Created: / 19-01-2018 / 09:18:42 / jv"
    "Modified: / 18-10-2018 / 10:34:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!GDBDebuggerTestCase class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !