diff options
Diffstat (limited to 'lispref/debugging.texi')
| -rw-r--r-- | lispref/debugging.texi | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lispref/debugging.texi b/lispref/debugging.texi index cc3fc7a9bd9..f0bbc9207cb 100644 --- a/lispref/debugging.texi +++ b/lispref/debugging.texi | |||
| @@ -30,7 +30,6 @@ compiler, you need to know how to examine the compiler's input buffer. | |||
| 30 | * Debugger:: How the Emacs Lisp debugger is implemented. | 30 | * Debugger:: How the Emacs Lisp debugger is implemented. |
| 31 | * Edebug:: A source-level Emacs Lisp debugger. | 31 | * Edebug:: A source-level Emacs Lisp debugger. |
| 32 | * Syntax Errors:: How to find syntax errors. | 32 | * Syntax Errors:: How to find syntax errors. |
| 33 | * Test Coverage:: Ensuring you have tested all branches in your code. | ||
| 34 | * Compilation Errors:: How to find errors that show up in byte compilation. | 33 | * Compilation Errors:: How to find errors that show up in byte compilation. |
| 35 | @end menu | 34 | @end menu |
| 36 | 35 | ||
| @@ -739,42 +738,6 @@ the old indentation actually fits the intended nesting of parentheses, | |||
| 739 | and you have put back those parentheses, @kbd{C-M-q} should not change | 738 | and you have put back those parentheses, @kbd{C-M-q} should not change |
| 740 | anything. | 739 | anything. |
| 741 | 740 | ||
| 742 | @node Test Coverage | ||
| 743 | @section Test Coverage | ||
| 744 | @cindex coverage testing | ||
| 745 | |||
| 746 | @findex testcover-start | ||
| 747 | @findex testcover-mark-all | ||
| 748 | @findex testcover-next-mark | ||
| 749 | You can do coverage testing for a file of Lisp code by first using | ||
| 750 | the command @kbd{M-x testcover-start @key{RET} @var{file} @key{RET}} | ||
| 751 | to instrument it. Then test your code by calling it one or more | ||
| 752 | times. Then use the command @kbd{M-x testcover-mark-all} to display | ||
| 753 | ``splotches'' on the code to show where coverage is insufficient. The | ||
| 754 | command @kbd{M-x testcover-next-mark} will move point forward to the | ||
| 755 | next spot that has a splotch. | ||
| 756 | |||
| 757 | Normally, a red splotch indicates the form was never completely | ||
| 758 | evaluated; a brown splotch means it always evaluated to the same value | ||
| 759 | (meaning there has been little testing of what is done with the | ||
| 760 | result). However, the red splotch is skipped for forms that can't | ||
| 761 | possibly complete their evaluation, such as @code{error}. The brown | ||
| 762 | splotch is skipped for forms that are expected to always evaluate to | ||
| 763 | the same value, such as @code{(setq x 14)}. | ||
| 764 | |||
| 765 | For difficult cases, you can add do-nothing macros to your code to | ||
| 766 | give advice to the test coverage tool. | ||
| 767 | |||
| 768 | @defmac 1value form | ||
| 769 | Evaluate @var{form} and return its value, but inform coverage testing | ||
| 770 | that @var{form}'s value should always be the same. | ||
| 771 | @end defmac | ||
| 772 | |||
| 773 | @defmac noreturn form | ||
| 774 | Evaluate @var{form}, informing coverage testing that @var{form} should | ||
| 775 | never return. If it ever does return, you get a run-time error. | ||
| 776 | @end defmac | ||
| 777 | |||
| 778 | @node Compilation Errors | 741 | @node Compilation Errors |
| 779 | @section Debugging Problems in Compilation | 742 | @section Debugging Problems in Compilation |
| 780 | 743 | ||
| @@ -799,7 +762,3 @@ the error. | |||
| 799 | successfully, then point is located at the end of the form. In this | 762 | successfully, then point is located at the end of the form. In this |
| 800 | case, this technique can't localize the error precisely, but can still | 763 | case, this technique can't localize the error precisely, but can still |
| 801 | show you which function to check. | 764 | show you which function to check. |
| 802 | |||
| 803 | @ignore | ||
| 804 | arch-tag: ddc57378-b0e6-4195-b7b6-43f8777395a7 | ||
| 805 | @end ignore | ||