@@ -9,7 +9,7 @@ as a conforming Perl 6 implementation.
9
9
10
10
- [ Environment Variables] ( #environment-variables )
11
11
12
- - [ Contributing] ( #contributing )
12
+ - [ Contributing] ( CONTRIBUTING.md )
13
13
14
14
## Introduction
15
15
@@ -122,146 +122,4 @@ too long a time by default so as to make the roast run faster. Defaults to `1`.
122
122
123
123
## Contributing
124
124
125
- A person who wants to contribute a test to the project should read
126
- this Github guide to
127
- issues and [ pull requests] ( http://help.github.com/categories/collaborating-with-issues-and-pull-requests )
128
- (PRs) which describes in great detail the work flow for forks and
129
- submitting PRs to a project.
130
-
131
- Follow the same general steps for project ` github.com/perl6/roast ` :
132
-
133
- - fork project ` roast `
134
- - clone your fork of ` roast ` to a local directory
135
- - set the origin and upstream remotes
136
- - checkout a branch to work on your issue or proposal
137
- - see [ below] ( #working-the-issue ) for details
138
- - when through, ensure all desired commits are finished
139
- - push the issue branch to your origin (your fork of ` roast ` on github)
140
- - go to your github account for project ` roast ` and submit the PR
141
-
142
- ### Working the issue
143
-
144
- #### Normal tests
145
-
146
- New tests for existing features are usually accomplished by adding
147
- the test(s) to an existing test file. Then that file's ` plan ` count is
148
- updated. The new test(s) are tested locally by executing
149
-
150
- ``` perl6
151
- $ perl6 <test file(s) >
152
- ```
153
-
154
- When all is well, the commits are finalized, the branch is pushed
155
- to the user's fork on Github, and there the PR is initiated.
156
-
157
- If a new test file has been created, one additional step has to be
158
- taken: the new test file has to be added to
159
- ` github.com/rakudo/rakudo/t/spectest.data ` and a PR for project
160
- ` github.com/rakudo/rakudo ` can be submitted for that. However, it is
161
- easier just to ask for help adding the new test file on IRC channel
162
- ` #perl6 ` .
163
-
164
- #### Fudged tests
165
-
166
- Let's say you want to propose a new feature, method ` printf ` for
167
- IO::Handle, for ` rakudo ` and, being a believer in test-driven
168
- development, are submittng some test for something that can't yet be
169
- tested. Thus we will need to create the test but we will ` fudge ` it so
170
- it will be ignored.
171
-
172
- We create a new test file named appropriately, say, ` S16-io/printf.t ` ,
173
- the contents of which are:
174
-
175
- ``` perl6
176
- use v6 ;
177
- use Test ;
178
- plan 1 ;
179
-
180
- my $ f = ' ./.printf-tmpfil' ;
181
- my $ fh = open $ f , : w;
182
- $ fh . printf (" Hi\n " );
183
- $ fh . close ;
184
- my $ res = slurp $ f ;
185
- is $ res , " Hi\n " , " printf() works with zero args" ;
186
- unlink $ f ;
187
- ```
188
-
189
- We know the test doesn't work yet:
190
-
191
- ``` perl6
192
- $ perl6 S16-io/ printf . t
193
- 1 .. 1
194
- No such method 'printf ' for invocant of type ' IO::Handle'
195
- in block <unit > at . /S16-io /printf . t line 9
196
-
197
- # Looks like you planned 1 test, but ran 0
198
- ```
199
-
200
- so we add the fudge to it to get the new contents:
201
-
202
- ``` perl6
203
- use v6 ;
204
- use Test ;
205
- plan 1 ;
206
-
207
- # ?rakudo skip 'RT #999999 not yet implemented'
208
- {
209
- my $ f = ' ./.printf-tmpfil' ;
210
- my $ fh = open $ f , : w;
211
- $ fh . printf (" Hi\n " );
212
- $ fh . close ;
213
- my $ res = slurp $ f ;
214
- is $ res , " Hi\n " , " printf() works with zero args" ;
215
- unlink $ f ;
216
- }
217
- ```
218
-
219
- Notice we put the test in a block. All tests in that block
220
- are affected by the fudge line preceding it.
221
-
222
- We want to test the fudged file before we submit the PR so we have to
223
- manually create the fudged test file:
224
-
225
- ``` perl6
226
- $ fudge rakudo S16-io/ printf . t
227
- S16-io/ printf . rakudo
228
- ```
229
-
230
- which, as we see by the return from the command, produces file
231
- ` S16-io/printf.rakudo ` whose contents are
232
-
233
-
234
- ``` perl6
235
- use v6 ;
236
- use Test ;
237
- plan 1 ;
238
-
239
- # ?rakudo skip 'RT #999999 not yet implemented'
240
- skip (' RT #999999 not yet implemented' , 1 );# {
241
- # my $f = './.printf-tmpfil';
242
- # my $fh = open $f, :w;
243
- # $fh.printf("Hi\n");
244
- # $fh.close;
245
- # my $res = slurp $f;
246
- # is $res, "Hi\n", "printf() works with zero args";
247
- # unlink $f;
248
- # }
249
-
250
- say " # FUDGED!" ;
251
- exit (1 );
252
- ```
253
-
254
- We can then test it:
255
-
256
- ``` perl6
257
- $ perl6 S16-io/ printf . rakudo
258
- 1 .. 1
259
- ok 1 - \# SKIP RT \#999999 not yet implemented
260
- # FUDGED!
261
- ```
262
-
263
- Success! Now we can commit the new test file, but ** NOT** the generated fudge
264
- test file&mdash ; that will be generated automatically by the test
265
- harness during the regular testing on the servers. As
266
- described earlier, the new test file will have to be added to the spectest.data
267
- file, either via a PR or a request to someone on IRC to add it.
125
+ See [ CONTRIBUTING.md] ( CONTRIBUTING.md )
0 commit comments