Skip to content
Snippets Groups Projects
Commit 39a15150 authored by gloas's avatar gloas
Browse files

Ajout : opac3-run-phpunit-stop-on-failure

      	opac3-run-phpunit-stop-on-error

ps : modifier les shortcuts
parent 98f04c30
Branches
Tags
No related merge requests found
......@@ -38,7 +38,6 @@
(defvar opac3-phpunit-config "~/dev/afi/afi-opac3/tests/phpunit.xml" "phpunit.xml path")
(setq opac3-phpunit-command "phpunit")
(setq opac3-mode-hook '(opac3-php-mode))
(defun opac3-php-mode()
......@@ -81,7 +80,7 @@
(defun opac3-compile-phpunit (&optional params &optional debug &optional testdox)
(save-buffer)
(let
((command-filter (if params (concat " --filter " params) " "))
((command-filter (if params (concat " --filter " params) " "))
(debug-mode (if debug "XDEBUG_CONFIG=1 " ""))
(testdox-option (if testdox " --testdox " "")))
......@@ -112,6 +111,22 @@
(opac3-compile-phpunit nil debug-mode)
)
(defun opac3-run-phpunit-stop-on-error(debug-mode)
"Run all phpunit tests until an error occured"
(interactive "P")
(setq opac3-phpunit-command
(concat debug-mode "phpunit -c " opac3-phpunit-config " --stop-on-error"))
(compile opac3-phpunit-command)
)
(defun opac3-run-phpunit-stop-on-failure(debug-mode)
"Run all phpunit tests until a failure occured"
(interactive "P")
(setq opac3-phpunit-command
(concat debug-mode "phpunit -c " opac3-phpunit-config " --stop-on-failure"))
(compile opac3-phpunit-command)
)
(defun opac3-run-phpunit-filtered-file(debug-mode)
"Run phpunit on this file / class"
......@@ -157,6 +172,10 @@
(file-name-nondirectory (buffer-file-name (current-buffer)))
)
(defun opac3-cur-dir ()
"Return the directory of the current buffer"
(file-name-directory (buffer-file-name (current-buffer)))
)
(defun opac3-find-tests()
......@@ -373,6 +392,8 @@
("\C-crm" . opac3-run-phpunit-filtered-custom)
("\C-crl" . opac3-run-last-phpunit-command)
("\C-crp" . opac3-run-phpunit)
("\C-cse" . opac3-run-phpunit-stop-on-error)
("\C-csf" . opac3-run-phpunit-stop-on-failure)
("\C-crd" . opac3-debug-phpunit-function)
("\C-ce" . opac3-eval-region)
("\C-cf" . opac3-strftime)
......@@ -399,3 +420,18 @@
(selection-face . ac-etags-selection-face)
(requires . 3))
"Source for etags.")
(defun magit-status-cur-dir()
(interactive)
(message (concat "Current direcotry= " (opac3-cur-dir)))
;;(magit-repo-dirs ((opac3-cur-dir)))
;;(magit-status)
;;(setq opac3-magit-status-cur-dir
;;(concat "magit diff --stat " (opac3-cur-dir)))
;;(compile opac3-magit-status-cur-dir)
;; ('magit diff --stat -- opac3-cur-dir)
)
(global-set-key (kbd "C-c ms") 'magit-status-cur-dir)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment