commit 99b47ad5f06cf685e085b1f695a5bf179e377a0f
parent 51cfe05f13e23af9a6d7e0a774bfa784912bd5cb
Author: Kyle Milz <kyle@0x30.net>
Date: Fri, 29 Jul 2016 23:16:06 -0600
t: check more runtime variables
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Test/Viewer.pm b/Test/Viewer.pm
@@ -35,14 +35,14 @@ sub accept {
# Protocol defined in lib/runtime.c function send_static().
#
my $buf = read_all($client, 1 + 4 + 4 + 12);
- ($self->{ver}, $self->{num_tus}, $self->{lines_total}, $self->{pid}, $self->{ppid}, $self->{pgrp})
- = unpack("CL5", $buf);
+ ($self->{ver}, $self->{num_tus}, $self->{lines_total}, $self->{pid},
+ $self->{ppid}, $self->{pgrp}) = unpack("CL5", $buf);
my $progname_sz = unpack("S", read_all($client, 2));
- my $progname = read_all($client, $progname_sz);
+ $self->{progname} = read_all($client, $progname_sz);
my $cwd_sz = unpack("S", read_all($client, 2));
- my $cwd = read_all($client, $cwd_sz);
+ $self->{cwd} = read_all($client, $cwd_sz);
# Always sanity check these.
cmp_ok( $self->{pid}, ">", 1, "pid lower bound check" );
diff --git a/t/rt_sanity.t b/t/rt_sanity.t
@@ -1,7 +1,7 @@
use strict;
-use Data::Dumper;
-use Test::More tests => 58;
+use Cwd;
+use Test::More tests => 60;
use Test::Differences;
use Test::Project;
@@ -62,6 +62,8 @@ $project->run(45);
$viewer->accept();
is( $viewer->{num_tus}, 3, "translation unit count" );
+is( $viewer->{progname}, "program", "program name" );
+is( $viewer->{cwd}, getcwd, "current working dir" );
# Check static data.
my @known_good = [