citrun

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

commit 378f04a79287ac74ee159ed8b896e5db76894120
parent 18a6a949b0860b740f9ce88e38dda83e2dfed244
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Fri, 25 Mar 2016 14:02:11 -0600

t: fix fallout from last commit

Diffstat:
Mt/fibonacci.t | 4+++-
Mt/for.t | 4+++-
Mt/hello_world.t | 4+++-
Mt/if.t | 4+++-
Mt/return.t | 4+++-
Mt/runtime_sanity.t | 19++++++++++++-------
Mt/switch.t | 4+++-
Mt/while.t | 4+++-
8 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/t/fibonacci.t b/t/fibonacci.t @@ -51,7 +51,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -62,6 +63,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 31, + .inst_sites = 19, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/for.t b/t/for.t @@ -32,7 +32,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -43,6 +44,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 12, + .inst_sites = 2, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/hello_world.t b/t/hello_world.t @@ -29,7 +29,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -40,6 +41,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 9, + .inst_sites = 7, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/if.t b/t/if.t @@ -39,7 +39,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -50,6 +51,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 21, + .inst_sites = 9, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/return.t b/t/return.t @@ -32,7 +32,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -43,6 +44,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 12, + .inst_sites = 5, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/runtime_sanity.t b/t/runtime_sanity.t @@ -2,7 +2,7 @@ use strict; use Data::Dumper; use SCV::Project; use SCV::Viewer; -use Test::More tests => 45; +use Test::More tests => 48; use Test::Differences; my $viewer = SCV::Viewer->new(); @@ -68,12 +68,17 @@ my $runtime_metadata = $viewer->get_metadata(); my $tus = $runtime_metadata->{tus}; my ($source_0, $source_1, $source_2) = @$tus; -like ($source_0->{filename}, qr/.*source_0.c/, "runtime filename check 0") ; -is ($source_0->{lines}, 20, "runtime line count check 0"); -like ($source_1->{filename}, qr/.*source_1.c/, "runtime filename check 1") ; -is ($source_1->{lines}, 11, "runtime line count check 1"); -like ($source_2->{filename}, qr/.*source_2.c/, "runtime filename check 2") ; -is ($source_2->{lines}, 9, "runtime line count check 2"); +like( $source_0->{filename}, qr/.*source_0.c/, "runtime filename check 0" ); +is( $source_0->{lines}, 20, "runtime line count check 0" ); +is( $source_0->{inst_sites}, 7, "instrumented site count 0" ); + +like( $source_1->{filename}, qr/.*source_1.c/, "runtime filename check 1" ); +is( $source_1->{lines}, 11, "runtime line count check 1" ); +is( $source_1->{inst_sites}, 7, "instrumented site count 1" ); + +like( $source_2->{filename}, qr/.*source_2.c/, "runtime filename check 2" ); +is( $source_2->{lines}, 9, "runtime line count check 2" ); +is( $source_2->{inst_sites}, 6, "instrumented site count 2" ); # Request and check execution data my $data = $viewer->get_execution_data($tus); diff --git a/t/switch.t b/t/switch.t @@ -35,7 +35,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -46,6 +47,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 15, + .inst_sites = 2, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, }; diff --git a/t/while.t b/t/while.t @@ -33,7 +33,8 @@ my $inst_src_good = <<EOF; #include <stdint.h> struct _scv_node { uint64_t *lines_ptr; - uint64_t size; + uint32_t size; + uint32_t inst_sites; const char *file_name; struct _scv_node *next; }; @@ -44,6 +45,7 @@ struct _scv_node _scv_node1; struct _scv_node _scv_node0 = { .lines_ptr = _scv_lines, .size = 13, + .inst_sites = 2, .file_name = "$tmp_dir/source_0.c", .next = &_scv_node1, };