--- a/tests/GDBDebuggeesResource.st Sun Mar 08 08:44:29 2015 +0000
+++ b/tests/GDBDebuggeesResource.st Sun Mar 08 12:40:03 2015 +0000
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"{ Package: 'jv:libgdbs/tests' }"
"{ NameSpace: Smalltalk }"
@@ -39,5 +41,16 @@
^ binary pathName
"Created: / 28-02-2015 / 00:47:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+binaryPressAnyKey
+ | binary |
+
+ binary := (Smalltalk getPackageDirectoryForPackage: self class package) / 'c' / 'press_any_key'.
+ self assert: binary exists.
+ self assert: binary isExecutable.
+ ^ binary pathName
+
+ "Created: / 08-03-2015 / 07:24:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
--- a/tests/GDBDebuggerTestsR.st Sun Mar 08 08:44:29 2015 +0000
+++ b/tests/GDBDebuggerTestsR.st Sun Mar 08 12:40:03 2015 +0000
@@ -15,7 +15,7 @@
documentation
"
- Tests for GDBDebugger (using test programs)
+ Tests for GDBDebugger (using real test programs)
[author:]
Jan Vrany <jan.vrany@fit.cvut.cz>
@@ -69,8 +69,38 @@
debugger send: 'd'.
debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
+ self assert: thread1 isDead
+
"Created: / 28-02-2015 / 00:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 08-03-2015 / 06:10:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 08-03-2015 / 09:11:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_03
+ | inferior1 thread1 |
+
+ debugger := GDBDebugger new.
+ self assert: debugger isConnected.
+
+ debugger executable: GDBDebuggeesResource current binaryPressAnyKey.
+
+ debugger send: (GDBMI_exec_run new).
+
+ self assert: debugger inferiors size == 1.
+ inferior1 := debugger inferiors anElement.
+ self assert: inferior1 threads size == 1.
+ thread1 := inferior1 threads anElement.
+ self assert: thread1 isRunning.
+
+ debugger send: (GDBMI_exec_interrupt new arguments: #('--all')).
+
+ self assert: thread1 isRunning not.
+
+ debugger inferiorStdin nextPutLine:'X'.
+
+ debugger send: 'c' andWaitFor: GDBThreadGroupExitedEvent.
+
+ "Created: / 08-03-2015 / 07:42:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 08-03-2015 / 09:11:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
test_basic_01
@@ -90,3 +120,10 @@
"Modified (format): / 06-09-2014 / 02:16:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+!GDBDebuggerTestsR class methodsFor:'documentation'!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+! !
+