Difference between revisions of "User:Socke/Testable Begin"
(removed empty lines at empty parameters) |
(→About: section added) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly> | + | <includeonly><div class="compileable {{#if: {{{preset|}}} |preset-{{{preset}}} }} {{#if: {{{os|}}} |os-{{{os}}} }} {{#if: {{{packages|}}} |packages-{{{packages}}} }}"></includeonly> |
− | <div class="compileable | + | <noinclude>=About= |
− | </ | + | This template is used to mark a Wiki Page as testable Free Pascal Source. The test is a simple compile test. The test utility is Wiki Example Tester, it is hostet on Github: https://github.com/SAmeis/Wiki-Example-Tester |
− | < | + | |
− | Template parameters | + | You can imagine that not working examples are a very harsh stopping for beginners. So this aims to improve the quality of the source code example in this Wiki. With this tool it should be possible to get a list of not compiling source codes, which then can be fixed. |
+ | =Usage= | ||
+ | Create an own Wiki page for each testable code. Each page should look like | ||
+ | <pre>{{User:Socke/Testable_Begin}} | ||
+ | <syntaxhighlight> | ||
+ | program myprogram; | ||
+ | |||
+ | begin | ||
+ | // your code | ||
+ | end; | ||
+ | </syntaxhighlight> | ||
+ | {{User:Socke/Testable_End}} | ||
+ | </pre> | ||
+ | |||
+ | The whole template has to be in one line; the template name has to use the underscored template name—<span style="line-height:110%;font-family:Monospace;background-color:#CEF6CE;"><nowiki>{{User:Socke/Testable_Begin}}</nowiki></span> is okay, <span style="line-height:110%;font-family:Monospace;background-color:#F5A9A9;"><nowiki>{{User:Socke/Testable Begin}}</nowiki></span> is not. You may not specify each parameter on a new line (unless you optimize the regular expressions which are used to parse this). | ||
+ | {|class="wikitable" | ||
+ | !Valid example !! Invalid example | ||
+ | |- | ||
+ | | <pre>{{User:Socke/Testable_Begin|os=Linux|preset=MyPresetConfig|packages=LCL}}</pre> | ||
+ | || <pre>{{User:Socke/Testable_Begin | ||
+ | |os=Linux | ||
+ | |preset=MyPresetConfig | ||
+ | |packages=LCL | ||
+ | }}</pre> | ||
+ | |} | ||
+ | |||
+ | =Template parameters= | ||
+ | You can specify some paramters to this template which are recognized by the testing utility (but not used in any means). | ||
{|class="wikitable" | {|class="wikitable" | ||
! Parameter !! Description | ! Parameter !! Description | ||
Line 11: | Line 38: | ||
| ''os'' || Operating system (e.g. ''WinXP, MaxOSX10.6, Debian7, etc.'') | | ''os'' || Operating system (e.g. ''WinXP, MaxOSX10.6, Debian7, etc.'') | ||
|- | |- | ||
− | | ''packages'' || Required Lazarus Packages in build environment | + | | ''packages'' || Required Lazarus Packages in build environment; Package names are separated by comma e.g. ''PascalIO,LCL,LCLBase''. There must not be any spaces in this value. |
− | |} | + | |}</noinclude> |
− | </noinclude> |
Latest revision as of 00:01, 21 September 2014
About
This template is used to mark a Wiki Page as testable Free Pascal Source. The test is a simple compile test. The test utility is Wiki Example Tester, it is hostet on Github: https://github.com/SAmeis/Wiki-Example-Tester
You can imagine that not working examples are a very harsh stopping for beginners. So this aims to improve the quality of the source code example in this Wiki. With this tool it should be possible to get a list of not compiling source codes, which then can be fixed.
Usage
Create an own Wiki page for each testable code. Each page should look like
{{User:Socke/Testable_Begin}} <syntaxhighlight> program myprogram; begin // your code end; </syntaxhighlight> {{User:Socke/Testable_End}}
The whole template has to be in one line; the template name has to use the underscored template name—{{User:Socke/Testable_Begin}} is okay, {{User:Socke/Testable Begin}} is not. You may not specify each parameter on a new line (unless you optimize the regular expressions which are used to parse this).
Valid example | Invalid example |
---|---|
{{User:Socke/Testable_Begin|os=Linux|preset=MyPresetConfig|packages=LCL}} |
{{User:Socke/Testable_Begin |os=Linux |preset=MyPresetConfig |packages=LCL }} |
Template parameters
You can specify some paramters to this template which are recognized by the testing utility (but not used in any means).
Parameter | Description |
---|---|
preset | Predefined set of FPC/Lazarus configuration (e.g. Raspberry) |
os | Operating system (e.g. WinXP, MaxOSX10.6, Debian7, etc.) |
packages | Required Lazarus Packages in build environment; Package names are separated by comma e.g. PascalIO,LCL,LCLBase. There must not be any spaces in this value. |