Skip to content

Commit

Permalink
t/007.mode-parse.t no longer uses the compile server (revert to 6aef8d8
Browse files Browse the repository at this point in the history
…, and add cherry-pick support from 5effa40)
  • Loading branch information
kazuho committed Apr 10, 2014
1 parent 9288c86 commit c4c1324
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions t/007.mode-parse.t
Expand Up @@ -2,34 +2,15 @@
use strict;
use warnings;
use Test::More;
use File::Temp qw(tempdir);

use tool::Util;


my @files = glob 't/run/*.jsx';

plan tests => 4 * scalar @files;

{
local $ENV{JSX_HOME} = tempdir(".jsx.mode-parse-XXXXXXXX", CLEANUP => 1);

require tool::RunCompilationServer;
require "tool/jsx.pl"; # App::jsx
plan tests => 2 * scalar @files;

my $port = do {
open my $fh, "<", "$ENV{JSX_HOME}/port" or die $!;
<$fh>;
};

foreach my $file(@files) {
local $TODO = "todo" if $file =~ / \.todo\. /xms;

my $res = App::jsx::request($port, "--mode", "parse", $file);

ok !$res->{invalid_response}, "--mode parse $file";
is $res->{statusCode}, 0, "statusCode for $file";
is $res->{stderr}, "", "stderr for $file";
ok $res->{stdout}, "stdout for $file"
}
foreach my $file(@files) {
local $TODO = "todo" if $file =~ / \.todo\. /xms;
my $json = `bin/jsx --mode parse $file`;
is $?, 0, "bin/jsx --mode parse $file";
ok $json;
}

0 comments on commit c4c1324

Please sign in to comment.