diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2024-02-14 19:56:58 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2024-03-02 12:14:59 +0100 |
| commit | 5b4b6d2319fa8594d4c8dd3078a72b45ec0505b8 (patch) | |
| tree | 0144d04420f4b6fb950c7f00ddaaebd905198f93 /.emacs | |
| parent | 40775ea8dc96d7e930626b7daf9f9cb199b77528 (diff) | |
| download | dotfiles-5b4b6d2319fa8594d4c8dd3078a72b45ec0505b8.tar.xz | |
Add helper to run Emacs testcase
It's probably more idiomatic to run a testcase you are developing in
your own session, using 'M-x ert' commands? I figure starting a fresh
Emacs cannot hurt.
Diffstat (limited to '.emacs')
| -rw-r--r-- | .emacs | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -474,6 +474,29 @@ (lambda () (ibuffer-switch-to-saved-filter-groups "my/ibuffer-groups"))) +;;; Development helpers. +(defun my/emacs-run-testcase () + (interactive) + (require 'which-func) + (let* ((emacs-root (project-root (project-current))) + (testfile (file-name-sans-extension + (file-relative-name + buffer-file-name (file-name-concat + emacs-root "test")))) + (cores (string-to-number + (shell-command-to-string "nproc --all"))) + (options + `(("SELECTOR" . ,(which-function)) + ("TEST_BACKTRACE_LINE_LENGTH" . nil))) + (options-list + (seq-map + (lambda (opt) (format "%s=%s" (car opt) (cdr opt))) + options)) + (compile-command + (format "make -j%s && make -C test %s %s" + cores testfile (string-join options-list " ")))) + (call-interactively 'project-compile))) + ;;; Helper functions and miscellaneous settings. ;;;; French quick toggle. |
