Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[t] create utility module for parrot tests
~ add function for createing cross-platform tempfiles ~ convert tests to use it git-svn-id: https://svn.parrot.org/parrot/trunk@32058 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
- Loading branch information
Showing
8 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright (C) 2008, The Perl Foundation. | ||
# $Id$ | ||
|
||
=head1 NAME | ||
Parrot::Test::Util - utilities for Parrot tests | ||
=head1 SYNOPSIS | ||
use Parrot::Test::Util 'create_tempfile'; | ||
my ($FOO, $temp_pir) = create_tempfile( SUFFIX => '.pir', UNLINK => 1 ); | ||
=head1 DESCRIPTION | ||
This module provides basic utilities for Parrot test scripts. So far, there's | ||
only one utility, C<create_tempfile>, which must be requested for import. | ||
=head1 AUTHOR | ||
Written by Jerry Gay. | ||
=cut | ||
|
||
package Parrot::Test::Util; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
use File::Temp 'tempfile'; | ||
use Exporter; | ||
|
||
our @ISA = qw( Exporter ); | ||
our @EXPORT_OK = qw( create_tempfile ); | ||
|
||
|
||
sub create_tempfile { | ||
my ($filehandle, $filename) = &tempfile; | ||
$filename =~ s/\\/\//g; | ||
return ( $filehandle, $filename ); | ||
} | ||
|
||
|
||
1; | ||
|
||
# Local Variables: | ||
# mode: cperl | ||
# cperl-indent-level: 4 | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters