aboutsummaryrefslogtreecommitdiff
path: root/doom.d/config.org
diff options
context:
space:
mode:
Diffstat (limited to 'doom.d/config.org')
-rw-r--r--doom.d/config.org53
1 files changed, 51 insertions, 2 deletions
diff --git a/doom.d/config.org b/doom.d/config.org
index f847370..b9fe3ca 100644
--- a/doom.d/config.org
+++ b/doom.d/config.org
@@ -169,12 +169,61 @@ My docsets are stored in .docsets for ease of use
(load-file (concat doom-private-dir "config.el"))
)
#+END_SRC
-
** Languages
*** C#
#+BEGIN_SRC emacs-lisp
(after! csharp-mode
- (defun oreodave/csharp/unit-test ()
+ (defun omnisharp--unit-test-emit-results (passed results)
+ ; Mostly a copy of the actual omnisharp--unit-test-emit-results function
+ ; Just allows stdout to come out regardless of whether test has passed or not
+ (omnisharp--unit-test-message "")
+
+ (seq-doseq (result results)
+ (-let* (((&alist 'MethodName method-name
+ 'Outcome outcome
+ 'ErrorMessage error-message
+ 'ErrorStackTrace error-stack-trace
+ 'StandardOutput stdout
+ 'StanderError stderr) result)
+ (outcome-is-passed (string-equal "passed" outcome)))
+
+ (omnisharp--unit-test-message
+ (format "[%s] %s "
+ (propertize
+ (upcase outcome)
+ 'font-lock-face (if outcome-is-passed
+ '(:foreground "green" :weight bold)
+ '(:foreground "red" :weight bold)))
+ (omnisharp--truncate-symbol-name method-name 76)))
+
+ (unless (= (seq-length stdout) 0)
+ (omnisharp--unit-test-message "Standard output:")
+ (seq-doseq (stdout-line stdout)
+ (omnisharp--unit-test-message stdout-line)))
+
+ (unless outcome-is-passed
+ (omnisharp--unit-test-message error-message)
+
+ (if error-stack-trace
+ (omnisharp--unit-test-message error-stack-trace))
+
+ (unless (= (seq-length stderr) 0)
+ (omnisharp--unit-test-message "Standard error:")
+ (seq-doseq (stderr-line stderr)
+ (omnisharp--unit-test-message stderr-line)))
+ )))
+
+ (omnisharp--unit-test-message "")
+
+ (if (eq passed :json-false)
+ (omnisharp--unit-test-message
+ (propertize "*** UNIT TEST RUN HAS FAILED ***"
+ 'font-lock-face '(:foreground "red" :weight bold)))
+ (omnisharp--unit-test-message
+ (propertize "*** UNIT TEST RUN HAS SUCCEEDED ***"
+ 'font-lock-face '(:foreground "green" :weight bold)))
+ )
+ nil)
(interactive)
(omnisharp--cs-inspect-buffer
(lambda (elements)