Skip to content

Commit e9db93a

Browse files
Make repeat after dape session call dape session again
1 parent 5747bbe commit e9db93a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

test-cockpit.el

+9-2
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,9 @@ session, the main dispatch dialog is invoked."
397397
(interactive
398398
(list (transient-args 'test-cockpit-prefix)))
399399
(if-let (last-cmd (oref (test-cockpit--real-engine-or-error) last-command))
400-
(test-cockpit--run-test last-cmd)
400+
(if (eq last-cmd 'test-cockpit--last-command-was-dape)
401+
(test-cockpit-dape-debug-repeat-test)
402+
(test-cockpit--run-test last-cmd))
401403
(test-cockpit-dispatch)))
402404

403405
;;;###autoload
@@ -467,9 +469,14 @@ in order to call the last test action with modified ARGS."
467469
(interactive)
468470
(if-let
469471
((config (test-cockpit--dape-debug-last-test)))
470-
(dape config)
472+
(test-cockpit--launch-dape config)
471473
(user-error "No recent test-action has been performed or no Dape support for backend")))
472474

475+
(defun test-cockpit--launch-dape (config)
476+
"Launch the dape debug session and memorize that last test was a dape session."
477+
(dape config)
478+
(oset (test-cockpit--retrieve-engine) last-command 'test-cockpit--last-command-was-dape))
479+
473480
(defun test-cockpit--projectile-build (&optional last-cmd)
474481
"Launch a projectile driven build process.
475482
If last executed command LAST-CMD is given the command is

test/test-cockpit.el-test.el

+8
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@
405405
(test-cockpit-dape-debug-repeat-test)))
406406

407407

408+
(ert-deftest test-dape-debug-repeat-test--repeat ()
409+
(tc--register-dape-project "dape")
410+
(mocker-let ((projectile-project-type () ((:output 'dape-project-type)))
411+
(dape (config) ((:input '(dape-foo-config) :output 'success :occur 2))))
412+
(test-cockpit-dape-debug-repeat-test)
413+
(test-cockpit-repeat-test)))
414+
415+
408416
(ert-deftest test-main-suffix--all-nil ()
409417
(tc--register-foo-project "foo")
410418
(mocker-let ((projectile-project-type () ((:output 'foo-project-type)))

0 commit comments

Comments
 (0)