Changeset 14744
- Timestamp:
- Apr 28, 2011, 12:52:41 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/doc/src/using.xml (modified) (38 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/doc/src/using.xml
r14694 r14744 2811 2811 <para> 2812 2812 Because the code coverage information is associated with compiled 2813 functions, load-time toplevel expressions do not get reported2814 on.You can work around this by creating a function and calling2813 functions, code coverage information is not available for load-time toplevel 2814 expressions. You can work around this by creating a function and calling 2815 2815 it. I.e. instead of 2816 2816 <programlisting> … … 2827 2827 </programlisting> 2828 2828 Then you can see the coverage information in the definition of 2829 init-this-and-that.2829 <literal>init-this-and-that</literal>. 2830 2830 </para> 2831 2831 </sect2> … … 2863 2863 <refnamediv> 2864 2864 <refname>REPORT-COVERAGE</refname> 2865 <refpurpose>Generate code coverage report</refpurpose>2865 <refpurpose>Generate a code coverage report</refpurpose> 2866 2866 <refclass>Function</refclass> 2867 2867 </refnamediv> 2868 2868 2869 2869 <refsynopsisdiv> 2870 <synopsis><function>report-coverage</function> &key;2870 <synopsis><function>report-coverage</function> output-file &key; 2871 2871 (external-format :default) (statistics t) (html t) 2872 2872 </synopsis> … … 2875 2875 <refsect1><title>Arguments and Values</title> 2876 2876 <variablelist> 2877 <varlistentry> 2878 <term>output-file</term> 2879 <listitem> 2880 <para> 2881 Pathname for the output index file. 2882 </para> 2883 </listitem> 2884 </varlistentry> 2885 2877 2886 <varlistentry> 2878 2887 <term>html</term> 2879 2888 <listitem> 2880 2889 <para> 2881 If non-nil, this will generate an HTML report, consisting of 2882 an index file and one html file for each instrumented source 2883 file that has been loaded in the current session. The 2884 individual source file reports are stored in the same 2885 directory as the index file. 2890 If non-nil (the default), this will generate an HTML report, consisting of 2891 an index file in <varname>output-file</varname> and, in the same directory, 2892 one html file for each instrumented source file that has been loaded in the 2893 current session. 2886 2894 </para> 2887 2895 </listitem> … … 2899 2907 <listitem> 2900 2908 <para> 2901 If :statistics is non-nil, a comma-separated file is also2909 If non-nil (the default), a comma-separated file is also 2902 2910 generated with the summary of statistics. You can specify a 2903 2911 filename for the statistics argument, otherwise 2904 "statistics.csv" is created in the output directory. See2905 documentation of ccl:coverage-statistics below for a2912 "statistics.csv" is created in the directory of <varname>output-file</varname>. 2913 See documentation of coverage-statistics below for a 2906 2914 description of the values in the statistics file. 2907 2915 </para> … … 2916 2924 do 2917 2925 <programlisting> 2918 ( CCL:REPORT-COVERAGE "/my/dir/coverage/report.html")2926 (REPORT-COVERAGE "/my/dir/coverage/report.html") 2919 2927 </programlisting> 2920 2928 and this would generate <filename>report.html</filename>, … … 2933 2941 2934 2942 <refnamediv> 2935 <refname> reset-coverage</refname>2943 <refname>RESET-COVERAGE</refname> 2936 2944 <refpurpose> 2937 2945 Resets all coverage data back to the "Not Executed" state … … 2940 2948 </refnamediv> 2941 2949 2942 <refsect1><title> Summary</title>2950 <refsect1><title>Description</title> 2943 2951 <para> 2944 2952 Resets all coverage data back to the "Not Executed" state … … 2953 2961 2954 2962 <refnamediv> 2955 <refname> clear-coverage</refname>2963 <refname>CLEAR-COVERAGE</refname> 2956 2964 <refpurpose> 2957 2965 Forget about all instrumented files that have been loaded. … … 2960 2968 </refnamediv> 2961 2969 2962 <refsect1><title> Summary</title>2970 <refsect1><title>Description</title> 2963 2971 <para> 2964 2972 Gets rid of the information about which instrumented files have … … 2976 2984 2977 2985 <refnamediv> 2978 <refname> save-coverage-in-file</refname>2986 <refname>SAVE-COVERAGE-IN-FILE</refname> 2979 2987 <refpurpose> 2980 2988 Save all coverage into to a file so you can restore it later. … … 2988 2996 </refsynopsisdiv> 2989 2997 2990 <refsect1><title> Summary</title>2998 <refsect1><title>Description</title> 2991 2999 <para> 2992 3000 Saves all coverage info in a file, so you can restore the … … 3004 3012 3005 3013 <refnamediv> 3006 <refname> restore-coverage-from-file</refname>3014 <refname>RESTORE-COVERAGE-FROM-FILE</refname> 3007 3015 <refpurpose> 3008 3016 Load coverage state from a file. … … 3016 3024 </refsynopsisdiv> 3017 3025 3018 <refsect1><title> Summary</title>3026 <refsect1><title>Description</title> 3019 3027 <para> 3020 3028 Restores the coverage data previously saved with 3021 CCL:SAVE-COVERAGE-IN-FILE, for the set of instrumented fasls3029 ccl:save-coverage-in-file, for the set of instrumented fasls 3022 3030 that were loaded both at save and restore time. I.e. coverage 3023 3031 info is only restored for files that have been loaded in this … … 3025 3033 "foo.lx86fsl" and then saved the coverage info, in this session 3026 3034 you must load the same "foo.lx86fsl" before calling 3027 ccl:restore-coverage-from-file in order to retrieve the stored3035 restore-coverage-from-file in order to retrieve the stored 3028 3036 coverage info for "foo". Equivalent to (ccl:restore-coverage 3029 3037 (ccl:read-coverage-from-file pathname)). … … 3038 3046 3039 3047 <refnamediv> 3040 <refname> save-coverage</refname>3048 <refname>SAVE-COVERAGE</refname> 3041 3049 <refpurpose> 3042 3050 Returns a snapshot of the current coverage data. … … 3045 3053 </refnamediv> 3046 3054 3047 <refsect1><title> Summary</title>3055 <refsect1><title>Description</title> 3048 3056 <para> 3049 3057 Returns a snapshot of the current coverage data. A snapshot is a … … 3074 3082 </refsynopsisdiv> 3075 3083 3076 <refsect1><title> Summary</title>3084 <refsect1><title>Description</title> 3077 3085 <para> 3078 3086 Reinstalls a coverage snapshot as the current coverage state. … … 3080 3088 </refsect1> 3081 3089 </refentry> 3090 3091 <refentry id="f_combine-coverage"> 3092 <indexterm zone="f_combine-coverage"> 3093 <primary>combine-coverage</primary> 3094 </indexterm> 3095 3096 <refnamediv> 3097 <refname>COMBINE-COVERAGE</refname> 3098 <refpurpose> 3099 Combines multiple coverage snapshots into one. 3100 </refpurpose> 3101 <refclass>Function</refclass> 3102 </refnamediv> 3103 3104 <refsynopsisdiv> 3105 <synopsis><function>combine-coverage</function> snapshots 3106 </synopsis> 3107 </refsynopsisdiv> 3108 3109 <refsect1><title>Description</title> 3110 <para> 3111 Takes a list of coverage snapshots and returns a new coverage snapshot 3112 representing a union of all the coverage data. 3113 </para> 3114 </refsect1> 3115 </refentry> 3116 3082 3117 3083 3118 <refentry id="f_write-coverage-to-file"> … … 3099 3134 </refsynopsisdiv> 3100 3135 3101 <refsect1><title> Summary</title>3136 <refsect1><title>Description</title> 3102 3137 <para> 3103 3138 Saves the coverage snapshot in a file. The snapshot can be … … 3128 3163 </refsynopsisdiv> 3129 3164 3130 <refsect1><title> Summary</title>3165 <refsect1><title>Description</title> 3131 3166 <para> 3132 3167 Returns the snapshot saved in pathname. Doesn't affect the … … 3147 3182 <refname>COVERAGE-STATISTICS</refname> 3148 3183 <refpurpose> 3149 Returns a sequence of c overage-statistics objects, one per source file.3184 Returns a sequence of ccl:coverage-statistics objects, one per source file. 3150 3185 </refpurpose> 3151 3186 <refclass>Function</refclass> … … 3157 3192 </refsynopsisdiv> 3158 3193 3159 <refsect1><title> Summary</title>3194 <refsect1><title>Description</title> 3160 3195 <para> 3161 3196 Returns a sequence ccl:coverage-statistics objects, one for each … … 3165 3200 <variablelist> 3166 3201 <varlistentry> 3167 <term><function>c cl:coverage-source-file</function></term>3202 <term><function>coverage-source-file</function></term> 3168 3203 <listitem> 3169 3204 <para> … … 3173 3208 </varlistentry> 3174 3209 <varlistentry> 3175 <term><function>c cl:coverage-expressions-total</function></term>3210 <term><function>coverage-expressions-total</function></term> 3176 3211 <listitem> 3177 3212 <para> … … 3181 3216 </varlistentry> 3182 3217 <varlistentry> 3183 <term><function>c cl:coverage-expressions-entered</function></term>3218 <term><function>coverage-expressions-entered</function></term> 3184 3219 <listitem> 3185 3220 <para> … … 3190 3225 </varlistentry> 3191 3226 <varlistentry> 3192 <term><function>c cl:coverage-expressions-covered</function></term>3227 <term><function>coverage-expressions-covered</function></term> 3193 3228 <listitem> 3194 3229 <para> … … 3198 3233 </varlistentry> 3199 3234 <varlistentry> 3200 <term><function>c cl:coverage-unreached-branches</function></term>3235 <term><function>coverage-unreached-branches</function></term> 3201 3236 <listitem> 3202 3237 <para> … … 3206 3241 </varlistentry> 3207 3242 <varlistentry> 3208 <term><function>c cl:coverage-code-forms-total</function></term>3243 <term><function>coverage-code-forms-total</function></term> 3209 3244 <listitem> 3210 3245 <para> … … 3216 3251 </varlistentry> 3217 3252 <varlistentry> 3218 <term><function>c cl:coverage-code-forms-covered</function></term>3253 <term><function>coverage-code-forms-covered</function></term> 3219 3254 <listitem> 3220 3255 <para> … … 3224 3259 </varlistentry> 3225 3260 <varlistentry> 3226 <term><function>c cl:coverage-functions-total</function></term>3261 <term><function>coverage-functions-total</function></term> 3227 3262 <listitem> 3228 3263 <para> … … 3232 3267 </varlistentry> 3233 3268 <varlistentry> 3234 <term><function>c cl:coverage-functions-fully-covered</function></term>3269 <term><function>coverage-functions-fully-covered</function></term> 3235 3270 <listitem> 3236 3271 <para> … … 3240 3275 </varlistentry> 3241 3276 <varlistentry> 3242 <term><function>c cl:coverage-functions-partly-covered</function></term>3277 <term><function>coverage-functions-partly-covered</function></term> 3243 3278 <listitem> 3244 3279 <para> … … 3248 3283 </varlistentry> 3249 3284 <varlistentry> 3250 <term><function>c cl:coverage-functions-not-entered</function></term>3285 <term><function>coverage-functions-not-entered</function></term> 3251 3286 <listitem> 3252 3287 <para> … … 3268 3303 <refname>*COMPILE-CODE-COVERAGE*</refname> 3269 3304 <refpurpose> 3270 When true, instrument functions for code coverage.3305 When true, instrument functions being compiled to collect code coverage information. 3271 3306 </refpurpose> 3272 3307 <refclass>Variable</refclass> … … 3278 3313 </refsynopsisdiv> 3279 3314 3280 <refsect1><title> Summary</title>3315 <refsect1><title>Description</title> 3281 3316 <para> 3282 3317 This variable controls whether functions are instrumented for … … 3305 3340 </refsynopsisdiv> 3306 3341 3307 <refsect1><title> Summary</title>3342 <refsect1><title>Description</title> 3308 3343 <para> 3309 3344 This macro arranges so that body doesn't record internal details … … 3316 3351 3317 3352 </sect2> 3353 3354 <sect2 id="code-coverage-interpreting-code-coloring"><title>Interpreting Code Coloring</title> 3355 <para> 3356 3357 The output of ccl:report-coverage consists of formatted source code, with coverage indicated by 3358 coloring. Four colors are used: dark green for forms that compiled to code in which every single 3359 instruction was executed, light green for forms that have been entered but weren't totally covered, red 3360 for forms that were never entered, and the page background color for toplevel forms that weren't 3361 instrumented. 3362 3363 </para> 3364 <para> 3365 The source coloring is applied from outside in. So for example if you have 3366 3367 <programlisting> 3368 (outer-form ... (inner-form ...) ...) 3369 </programlisting> 3370 3371 first the whole outer form is painted with whatever color expresses the outer form coverage, and then the 3372 inner form color is replaced with whatever color expresses the inner form coverage. One consequence of 3373 this approach is that every part of the outer form that is not specifically inside some executable inner 3374 form will have the outer form's coverage color. If the syntax of outer form involves some non-executable 3375 forms, or forms that do not have coverage info of their own for whatever reason, then they will just 3376 inherit the color of the outer form, because it doesn't get replaced with a color of its own. 3377 </para> 3378 3379 <para> 3380 One case in which this approach can be confusing is in the case of symbols. As noted in the Limitations 3381 section, coverage information is not recorded for variables; hence the coloring of a variable does not 3382 convey information about whether the variable was evaluated or not -- that information is not available, 3383 and the variable just inherits the color of the form that contains it. 3384 </para> 3385 3386 3387 </sect2> 3318 3388 </sect1> 3389 3319 3390 <sect1 id="other-extensions"><title>Other Extensions</title> 3320 3391 <refentry id="v_quit">
Note:
See TracChangeset
for help on using the changeset viewer.
