aboutsummaryrefslogtreecommitdiff
path: root/doom.d
diff options
context:
space:
mode:
authorAChavali <aryadevchavali1@gmail.com>2020-01-17 02:32:01 +0000
committerAChavali <aryadevchavali1@gmail.com>2020-01-17 02:32:01 +0000
commitafdd948e272409ea7b1102802282ecb1c0f57bd4 (patch)
tree74043e03e3e825ef4d3f8253103425cd5a99bf2b /doom.d
parenta124a76ffea5a269e176eda60f19ba0b60c1dcdd (diff)
downloaddotfiles-afdd948e272409ea7b1102802282ecb1c0f57bd4.tar.gz
dotfiles-afdd948e272409ea7b1102802282ecb1c0f57bd4.tar.bz2
dotfiles-afdd948e272409ea7b1102802282ecb1c0f57bd4.zip
+omnisharp--unit-test-emit-results
I have to see the test output from my tests!
Diffstat (limited to 'doom.d')
-rw-r--r--doom.d/modules/config.org52
1 files changed, 52 insertions, 0 deletions
diff --git a/doom.d/modules/config.org b/doom.d/modules/config.org
index afe952c..e1f5de6 100644
--- a/doom.d/modules/config.org
+++ b/doom.d/modules/config.org
@@ -222,6 +222,58 @@ Emacs doesn't have the full range of styles that I want, so lemme just do it mys
(counsel-etags-forward-line linenum)
(omnisharp-unit-test-at-point))))
:caller 'oreodave/csharp/get-unit-tests-in-project)))
+ (defun omnisharp--unit-test-emit-results (passed results)
+ "Emits unit test results as returned by the server to the unit test result buffer.
+PASSED is t if all of the results have passed. RESULTS is a vector of status data for
+each of the unit tests ran."
+ ; we want to clean output buffer for result if things have passed otherwise
+ ; compilation & test run output is to be cleared and results shown only for brevity
+
+ (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)))
+
+ (if error-stack-trace
+ (omnisharp--unit-test-message error-stack-trace))
+
+ (unless (= (seq-length stdout) 0)
+ (omnisharp--unit-test-message "Standard output:")
+ (seq-doseq (stdout-line stdout)
+ (omnisharp--unit-test-message stdout-line)))
+
+ (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)
(add-hook! 'csharp-mode-hook
'(lambda()