• Stars
    star
    180
  • Rank 213,043 (Top 5 %)
  • Language Raku
  • License
    Artistic License 2.0
  • Created about 14 years ago
  • Updated 14 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🦋 Raku test suite

The Official Raku Test Suite

The purpose of the test suite is to validate implementations that wish to be known as a conforming Raku.

Contents

Introduction

Please consider this test suite to be the bleeding edge of Raku development. New tests, tests for proposed new features, etc., will live on this 'master' branch. Once a specification is cut, a branch will be created for that version of the spec, e.g., 6.c for Christmas language release. If errata becomes available, it will be kept in -errata branch for that specific language version, e.g. 6.c-errata for 6.c.

As they develop, different implementations will certainly be in different states of readiness with respect to the test suite, so in order for the various implementations to track their progress independently, we've established a mechanism for fudging the tests in a kind of failsoft fashion. To pass a test officially, an implementation must be able to run a test file unmodified, but an implementation may (temporarily) skip tests or mark them as "todo" via the fudging mechanism, which is implemented via the fudge preprocessor. Individual implementations are not allowed to modify the actual test code, but may insert line comments before each actual test (or block of tests) that changes how those tests are to be treated for this platform. The fudge preprocessor pays attention only to the comments that belong to the current implementation and ignores all the rest. If your implementation is named "rakudo" then your special comment lines look like:

#?rakudo: [NUM] VERB ARGS

(The colon is optional.)

The optional NUM says how many statements or blocks to apply the verb to. (If not supplied, a value of 1 is assumed). A statement is arbitrarily defined as one or more lines starting with a test call and ending in a semicolon (with an optional comment).

VERBs include:

skip "reason"	# skip test entirely
eval "reason"	# eval the test because it doesn't parse yet
try "reason"	# try the test because it throws exception
todo "reason"	# mark "todo" because "not ok" is expected
emit code		# insert code (such as "skip-rest();") inline

All fudged tests return an exit code of 1 by default, so the test harness will mark it as "dubious" even if all the tests supposedly pass.

You may also negate the test:

#!rakudo [NUM] VERB ARGS

This will apply the verb on any system that isn't rakudo.

Sometimes environment variables distinguish syntactic or semantic variants, so you may apply a verb depending on the presence or absence of such a setting:

#?MYSPECIALVAR [NUM] VERB ARGS
#!MYSPECIALVAR [NUM] VERB ARGS

The environment variable must be uppercase.

There is also the following directive which modifies the test count of the next construct:

#?DOES count

The count may be an expression as long as any variables referenced in the expression are in scope at the location fudge eventually inserts a "skip()" call.

When applied to a subsequent sub definition, fudge registers the sub name as doing that many tests when called. Note, however, that any skipping is done at the point of the call, not within the subroutine, so the count may not refer to any parameter of the sub.

When you run the fudge preprocessor, if it decides the test needs fudging, it returns the new fudged filename; otherwise it returns the original filename. (Generally you don't run fudge directly, but your test harness runs the fudgeall program for you; see below.) If there is already a fudged program in the directory that is newer than the unfudged version, fudge just returns the fudged version without regenerating it. If the fudged version is older, it removes it and then decides anew whether to regenerate it based on the internal fudge comments.

The fudgeall program may be called to process all the needed fudging for a particular implementation:

$ fudgeall rakudo */*.t */*/*.t

Program fudgeall will use the fudge program to translate any fudged files to a new file where the extension is not *.t but instead is *.rakudo to indicate the implementation dependency. It also returns the fudged list of filenames to run, where unfudged tests are just passed through unchanged as *.t. Each test comes through as either fudged or not, but never both. The test harness then runs the selected test files as it normally would (it shouldn't care whether they are named *.t or *.rakudo).

In cases where the current working directory makes a difference, the tests assume that the working directory is the root of the test suite, so that the relative path to itself is t/spec/S\d\d-$section/$filename.

To fudge and run prove on a specific file:

./fudgeandrun S05-metasyntax/angle-brackets.t

fudgeandrun does not assume any particular implementation but guesses by running perl6 to look at special variables like $*PERL. See fudgeandrun usage to specify a different implementation and other options.

Test Utilities

This repository contains Test::Util module with helper routines you can use when writing tests. See POD documentation included at the end of the module's source code. To include the module, in your test file, you need to add use lib line to your test file.

use lib $?FILE.IO.parent(2).add: 'packages/Test-Helpers';
use Test::Util;
use Test;

Depending on the location of your test file, the number inside .parent(2) may need to be adjusted to go up the correct number of times from the test files's location to the root of the repository.

Appendices

The APPENDICES directory contains advisory tests implentations may optionally choose to follow. See the README included in that directory for more information.

APPENDICES are not included in released versions of the specification.

Environmental Variables

  • ROAST_TIMING_SCALE

Some tests rely on a process to complete in a certain amount of time. If you're running on a slowish computer, try setting ROAST_TIMING_SCALE to a larger value that will be used as a multiplier for the time to wait. We don't wait for too long a time by default so as to make the roast run faster. Defaults to 1.

Contributing

See CONTRIBUTING.md

More Repositories

1

nqp

NQP
Raku
341
star
2

examples

Many examples of Raku code
Raku
296
star
3

doc

🦋 Raku documentation
Raku
287
star
4

book

Using Raku – an unfinished book about Raku
Makefile
284
star
5

ecosystem

Raku ecosystem – modules and more
Perl
139
star
6

old-design-docs

Raku language design documents
Raku
124
star
7

raku.org

Source code for https://raku.org/
HTML
70
star
8

problem-solving

🦋 Problem Solving, a repo for handling problems that require review, deliberation and possibly debate
70
star
9

raku-mode

Emacs major mode for Raku
Emacs Lisp
61
star
10

mu

Universal Raku repository (formerly called "pugs repository")
Perl
60
star
11

docker

Docker files for Rakudo Star
Dockerfile
34
star
12

advent

Contains all data relating to the annual Raku Advent event held 1-25 December
Raku
28
star
13

App-Rakubrew

Raku environment manager
Perl
26
star
14

user-experience

Identifying issues in and improving the Raku user experience
25
star
15

atom-language

Atom/Github Raku Syntax Highlighting Support 🦋
Raku
24
star
16

whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
Raku
18
star
17

evalbot

IRC bot for executing Raku code
Perl
17
star
18

marketing

Marketing resources for Raku language
JavaScript
15
star
19

z

Helper script for Rakudo core development
Raku
14
star
20

CCR

The Raku Programming Language Collect, Conserve and Remaster Project
HTML
14
star
21

features

Overview of implementation status of different features in Raku compilers
HTML
13
star
22

ake

A Raku make-a-like inspired by rake
Raku
12
star
23

Documentable

Documentation API: caching, parsing, indexing and generating documentation
Raku
11
star
24

Blin

🥞 Project Blin – Toasting Reinvented
Raku
10
star
25

Raku-Steering-Council

RSC Papers
Raku
9
star
26

intellij-ide-plugin

Source dump of the former Comma IDE.
Java
8
star
27

tap-harness6

A TAP harness for Raku
Raku
8
star
28

rakubrew.org

rakubrew.org website
Raku
8
star
29

doc-website

Tooling to build/run the documentation website
CSS
7
star
30

flycheck-raku

Raku support for Flycheck
Emacs Lisp
7
star
31

setup-raku

JavaScript
7
star
32

rakudoc

A tool for reading Raku documentation
Raku
6
star
33

6.d-prep

All The Things to prepare for 6.d language release
5
star
34

ecosystem-unbitrot

Which modules are not installable?
Perl 6
5
star
35

RakudoCIBot

🤖 🦋 I am the friendly Rakudo CI bot. Bzzt! ⚡ Beep beep boop.
Raku
5
star
36

github-workflow-examples

A collection of workflow files for Raku code testing on github
5
star
37

IRC-logs

Repository of Raku IRC channel logs over the years (2005-now)
5
star
38

nqp-configure

Configuration and build modules for NQP
Perl
4
star
39

toolchain-bikeshed

(ARCHIVE) Discussion area for the Raku toolchain
4
star
40

REA

Raku Programming Language Ecosystem Archive
4
star
41

pugs-perl-modules

Perl modules from the old Pugs repository
Perl
3
star
42

museum-items

Collection repo for Raku museum items
3
star
43

flymake-rakudo

Raku(do) support for Flymake
Emacs Lisp
3
star
44

geth

GitHub Push Updates to IRC Bot
Raku
2
star
45

rakudo-star

A user-friendly distribution of the Raku programming language.
Shell
2
star
46

hacktoberfest

Centralized repository for hacktoberfest issued in the Rakuverse
2
star
47

old-issue-tracker

Tickets from RT
2
star
48

survey

Results from Raku Surveys
HTML
2
star
49

vscode-dev-container

VSCode dev container
Shell
2
star
50

please-turn-off-the-autowatch-feature

A friendly reminder that by default github will autosubscribe you to all repos of this org
2
star
51

L10N

The home of supported localizations of the Raku Programming Language
Raku
2
star
52

synopsebot

synopsebot IRC bot
Perl 6
1
star
53

RakuDoc-GAMMA

Community review of the RakuDoc standard
HTML
1
star
54

Documentable-backup

Raku documentation CLI and API
Perl 6
1
star