diff --git a/.dir-locals.el b/.dir-locals.el index 21bd0aa64..90a4125fe 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -6,4 +6,14 @@ (c++-mode . ((c-default-style . "gnu") (indent-tab-mode . t) (tab-width . 8) - (fill-column . 70)))) + (fill-column . 70))) + ("tests" . ((nil . ((eval . (defun spot/execute-test () + "execute the current file through ../run" + (interactive) + (shell-command (concat "cd ..; ./run " + (buffer-file-name) + " &")))))) + (sh-mode . ((eval . (local-set-key + (kbd "C-c C-c") #'spot/execute-test)))) + (python-mode . ((eval . (local-set-key (kbd "C-c C-c") + #'spot/execute-test))))))) diff --git a/HACKING b/HACKING index 047aa5da8..d160585fd 100644 --- a/HACKING +++ b/HACKING @@ -109,6 +109,7 @@ another "magic touch": touch doc/org-stamp + Silent Building with automake ----------------------------- @@ -120,6 +121,30 @@ annoying. To reduce this verbosity, just run: make V=0 + +Executing a single test +----------------------- + +All tests in subdirectories of tests/ are executed through the +tests/run script. That run script defines PATH and other environment +variables necessary so that Shell and Python scripts will use the +version of Spot under development. For instance to execute +tests/core/acc.test, do: + + % cd tests + % ./run core/acc.test + +A test run this way automatically executes in verbose mode. Any +temporary file generated by the script can be found in +tests/core/acc.dir/. + +Alternatively, if you use emacs, the .dir-locals.el configuration at +the top of the project redefines the C-c C-c key for all shell and +python scripts under the tests/ directory. So if you are working on +tests/core/acc.test under emacs, hitting C-c C-c should be all you +need to execute it. + + Debugging Libtool executables -----------------------------