Skip to Content
Perl 6 and Parrot Essentials, 2nd Edition
book

Perl 6 and Parrot Essentials, 2nd Edition

by Allison Randal, Dan Sugalski, Leopold Tötsch
June 2004
Intermediate to advanced
298 pages
12h 19m
English
O'Reilly Media, Inc.
Content preview from Perl 6 and Parrot Essentials, 2nd Edition

Writing Tests

As we mentioned earlier, contributions to the Parrot project are welcome. Contributing tests is a good place to start. You don’t have to understand the code behind a PASM opcode (or IMCC instruction) to test it, you only have to understand what it’s supposed to do. If you’re working on some code and it doesn’t do what the documentation advertises, you can isolate the problem in a test or series of tests and send them to the bug tracking system. There’s a good chance the problem will be fixed before the next release. Writing tests makes it a lot easier for the developer to know when they’ve solved your problem—it’s solved when your tests pass. It also prevents that problem from appearing again, because it’s checked every time anyone runs make test. As you move along, you’ll want to write tests for every bug you fix or new feature you add.

The Perl 5 testing framework is at the core of Parrot tests, particularly Test::Builder. Parrot’s Parrot::Test module is an interface to Test::Builder and implements the extra features needed for testing Parrot, like the fact that PASM code has to be compiled to bytecode before it runs.

The main Parrot tests are in the top-level t/ directory of the Parrot source tree. t/op contains tests for basic opcodes and t/pmc has tests for PMCs. The names of the test files indicate the functionality tested, like integer.t, number.t, and string.t. Part of the make test target is the command perl t/harness, which runs all the .t files in the subdirectories ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Perl 6 Essentials

Perl 6 Essentials

Allison Randal, Dan Sugalski, Leopold Tötsch
Perl in a Nutshell, 2nd Edition

Perl in a Nutshell, 2nd Edition

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley

Publisher Resources

ISBN: 059600737XErrata Page