Skip to content

Commit

Permalink
Remove XXX builtin support for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Feb 4, 2013
1 parent 3219694 commit f46237f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 35 deletions.
37 changes: 7 additions & 30 deletions lib/TestML.pm
Expand Up @@ -3,11 +3,13 @@
# author: Ingy döt Net <ingy@cpan.org>
# abstract: A Generic Software Testing Meta Language
# license: perl
# copyright: 2009, 2010, 2011, 2012
# copyright: 2009, 2010, 2011, 2012, 2013
# see:
# - http://www.testml.org/
# - irc://irc.freenode.net#testml

# TODO comment this code.

use 5.006001;
use strict;
use warnings;
Expand All @@ -18,25 +20,14 @@ use Pegex 0.21 ();

package TestML;

# XXX Dynamically load runtime class?
use TestML::Runtime;

our $VERSION = '0.28';

use constant XXX_skip => 1;
our $DumpModule = 'YAML::XS';
sub WWW { require XXX; local $XXX::DumpModule = $DumpModule; XXX::WWW(@_) }
sub XXX { require XXX; local $XXX::DumpModule = $DumpModule; XXX::XXX(@_) }
sub YYY { require XXX; local $XXX::DumpModule = $DumpModule; XXX::YYY(@_) }
sub ZZZ { require XXX; local $XXX::DumpModule = $DumpModule; XXX::ZZZ(@_) }

sub str { TestML::Str->new(value => $_[0]) }
sub num { TestML::Num->new(value => $_[0]) }
sub bool { TestML::Bool->new(value => $_[0]) }
sub list { TestML::List->new(value => $_[0]) }

my $skipped;
sub import {
my $run;
my $run; # $runtime?
my $bridge = '';
my $testml;
$skipped = 0;
Expand Down Expand Up @@ -86,6 +77,7 @@ sub import {
}
}

# XXX should be moved to Runtime::TAP
sub skip_all {
return if $skipped;
my $reason = shift;
Expand All @@ -101,30 +93,15 @@ sub import {
return if $skipped;
if ($run) {
eval "require $run; 1" or die $@;
$bridge ||= 'main';
$run->new(
testml => ($testml || \ *main::DATA),
bridge => $bridge,
bridge => ($bridge || 'main'),
)->run();
}
elsif ($testml or $bridge) {
die "-testml or -bridge option used without -run option\n";
}
}

no strict 'refs';
my $p = caller;
*{$p.'::str'} = \&str;
*{$p.'::num'} = \&num;
*{$p.'::bool'} = \&bool;
*{$p.'::list'} = \&list;

if (not defined &{$p.'::XXX'}) {
*{$p.'::WWW'} = \&WWW;
*{$p.'::XXX'} = \&XXX;
*{$p.'::YYY'} = \&YYY;
*{$p.'::ZZZ'} = \&ZZZ;
}
}

1;
Expand Down
13 changes: 13 additions & 0 deletions lib/TestML/Library.pm
@@ -0,0 +1,13 @@
use strict; use warnings;
package TestML::Library;

use Exporter 'import';

our @EXPORT = qw( str num bool list );

sub str { TestML::Str->new(value => $_[0]) }
sub num { TestML::Num->new(value => $_[0]) }
sub bool { TestML::Bool->new(value => $_[0]) }
sub list { TestML::List->new(value => $_[0]) }

1;
4 changes: 3 additions & 1 deletion lib/TestML/Library/Standard.pm
@@ -1,5 +1,7 @@
# TODO - This should be an object class ($self, TestML::Mo, etc)

package TestML::Library::Standard;
use TestML;
use TestML::Library;

sub Point {
my $context = shift;
Expand Down
1 change: 1 addition & 0 deletions lib/TestML/Runtime.pm
@@ -1,6 +1,7 @@
package TestML::Runtime;
use TestML::Mo;

# TODO TestML should require the compiler and create the runtime object with it
use TestML::Compiler;

# Since there is only ever one test runtime, it makes things a LOT cleaner to
Expand Down
4 changes: 0 additions & 4 deletions t/xxx.t

This file was deleted.

0 comments on commit f46237f

Please sign in to comment.