Skip to content

Instantly share code, notes, and snippets.

@Ruin0x11
Last active October 3, 2019 20:50
Show Gist options
  • Save Ruin0x11/acad502240d2f4412932246db03503bc to your computer and use it in GitHub Desktop.
Save Ruin0x11/acad502240d2f4412932246db03503bc to your computer and use it in GitHub Desktop.
Use VSTest from Emacs
(defcustom vstest-assembly "" "VSTest assembly to use")
(setq vstest-assembly "C:\\path\\to\\assembly.dll")
(defun vstest-console-all ()
(interactive)
(let ((class-name (file-name-sans-extension (buffer-name)))
(default-directory (projectile-project-root))
(assembly vstest-assembly))
(compile (concat "vstest.console " assembly))))
(defun vstest-console-this-buffer ()
(interactive)
(let ((class-name (file-name-sans-extension (buffer-name)))
(default-directory (projectile-project-root))
(assembly vstest-assembly))
(compile (concat "vstest.console " assembly " /TestCaseFilter:FullyQualifiedName~" class-name))))
(defun vstest-console-this-function ()
(interactive)
(let ((class-name (file-name-sans-extension (buffer-name)))
(default-directory (projectile-project-root))
(func-name (which-function))
(assembly vstest-assembly))
(compile (concat "vstest.console " assembly " /TestCaseFilter:\"(FullyQualifiedName~" class-name "&Name=" func-name ")\""))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment