citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 9c62f2fb2b3e58e713e837ccb56d24596471adac
parent 02214fd3cc27d8b45e01a4078b0d3c7fb880e0e3
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Tue, 29 Mar 2016 21:51:59 -0600

tests: don't send program output to stderr

Diffstat:
MSCV/Project.pm | 4++--
Mt/fibonacci.t | 8++++----
Mt/hello_world.t | 4++--
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/SCV/Project.pm b/SCV/Project.pm @@ -4,7 +4,7 @@ use strict; use Cwd; use File::Temp qw( tempdir ); use Test; -use IPC::Open3; +use IPC::Open2; sub new { my ($class) = @_; @@ -93,7 +93,7 @@ sub run { $ENV{DYLD_LIBRARY_PATH} = "lib"; my $tmp_dir = $self->{tmp_dir}; - $self->{pid} = open3(undef, \*CHLD_OUT, undef, "$tmp_dir/$self->{prog_name}", @args); + $self->{pid} = open2(\*CHLD_OUT, undef, "$tmp_dir/$self->{prog_name}", @args); } sub kill { diff --git a/t/fibonacci.t b/t/fibonacci.t @@ -29,13 +29,13 @@ main(int argc, char *argv[]) long long n; if (argc != 2) { - fprintf(stderr, "usage: %s <N>", argv[0]); + printf("usage: %s <N>", argv[0]); return 1; } n = atoi(argv[1]); - fprintf(stderr, "result: %lli", fibonacci(n)); + printf("result: %lli", fibonacci(n)); return 0; } @@ -64,13 +64,13 @@ main(int argc, char *argv[]) long long n; if ((++_scv_lines[20], argc != 2)) { - (++_scv_lines[21], fprintf(stderr, "usage: %s <N>", argv[0])); + (++_scv_lines[21], printf("usage: %s <N>", argv[0])); return (++_scv_lines[22], 1); } n = (++_scv_lines[25], atoi(argv[1])); - (++_scv_lines[27], fprintf(stderr, "result: %lli", (++_scv_lines[27], fibonacci(n)))); + (++_scv_lines[27], printf("result: %lli", (++_scv_lines[27], fibonacci(n)))); return (++_scv_lines[29], 0); } diff --git a/t/hello_world.t b/t/hello_world.t @@ -14,7 +14,7 @@ $project->add_src(<<EOF); int main(void) { - fprintf(stderr, "hello, world!"); + printf("hello, world!"); return 0; } EOF @@ -27,7 +27,7 @@ my $inst_src_good = <<EOF; int main(void) {libscv_init(); - (++_scv_lines[6], fprintf(stderr, "hello, world!")); + (++_scv_lines[6], printf("hello, world!")); return (++_scv_lines[7], 0); } EOF