citrun

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

commit 4513361fe87a53a0e2a2af37a25ada57ab8fc85b
parent 4ed9e8cf3e39630828ece1384e2fe3960951ca37
Author: Kyle Milz <kyle@0x30.net>
Date:   Wed, 10 Aug 2016 01:29:07 -0600

t: remove crufty test

Diffstat:
Dt/rt_counters_increase.t | 60------------------------------------------------------------
1 file changed, 0 insertions(+), 60 deletions(-)

diff --git a/t/rt_counters_increase.t b/t/rt_counters_increase.t @@ -1,60 +0,0 @@ -use strict; -use Test::More tests => 11; -use Test::Project; -use Test::Viewer; - -my $project = Test::Project->new(); -my $viewer = Test::Viewer->new(); - -$project->add_src(<<EOF); -#include <err.h> -#include <stdio.h> -#include <stdlib.h> - -long long -fib(long long n) -{ - if (n == 0) - return 0; - else if (n == 1) - return 1; - return fib(n - 1) + fib(n - 2); -} - -int -main(int argc, char *argv[]) -{ - long long n; - - if (argc != 2) - errx(1, "argc != 2"); - - n = atoi(argv[1]); - - fprintf(stderr, "%lli", fib(n)); - return 0; -} -EOF - -# Compile above inefficient program and let it run for a few seconds. -$project->compile(); -$project->run(45); - -# Accept the runtime connection and check a few things. -$viewer->accept(); -$viewer->cmp_static_data([ [ "source_0.c", 28 ] ]); - -my $data = $viewer->get_dynamic_data(); -ok( keys %$data == 1, "single dynamic data key" ); -my ($exec_lines1) = values %$data; - -# Only lines 8 - 12 in the source code above are executing -for (7..11) { - # Runtime sends execution differences. - cmp_ok( $exec_lines1->[$_], ">", 0, "line $_ executed nonzero times" ); -} - -$project->kill(); -my ($ret, $err) = $project->wait(); -is( $ret, 0, "runtime sanity return code check" ); -is( $err, undef, "runtime sanity program output" );