Skip to content

Commit

Permalink
add simple tests to make sure profilers can be invoked
Browse files Browse the repository at this point in the history
(and have an actual effect)
  • Loading branch information
timo committed Jul 27, 2020
1 parent 9071653 commit d7aa7e6
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions t/09-moar/01-profilers.t
@@ -0,0 +1,39 @@
use lib <t/packages/>;
use Test;
use Test::Helpers;

plan 12;

my $tempdir = make-temp-dir;

my $htmlpath = $tempdir.child("profile.html").absolute;

is-run "", "can launch with profiling requested", compiler-args => ["--profile=$htmlpath"],
err => / "profiler output" .*? "$htmlpath" /;

ok $htmlpath.IO.f, "profiler html output file exists on disk";
ok (try $htmlpath.IO.s > 128), "profiler html output file isn't tiny";

my $jsonpath = $tempdir.child("profile.json").absolute;

is-run "", "can launch with profiling requested", compiler-args => ["--profile=$jsonpath"],
err => / "profiler output" .*? "$jsonpath" /;

ok $jsonpath.IO.f, "profiler json output file exists on disk";
ok (try $jsonpath.IO.s) > 128, "profiler json output file isn't tiny";

my $sqlpath = $tempdir.child("profile.sql").absolute;

is-run "", "can launch with profiling requested", compiler-args => ["--profile=$sqlpath"],
err => / "profiler output" .*? "$sqlpath" /;

ok $sqlpath.IO.f, "profiler sql output file exists on disk";
ok (try $sqlpath.IO.s) > 128, "profiler sql output file isn't tiny";

my $heappath = $tempdir.child("profile.mvmheap").absolute;

is-run "", "can launch with profiling requested", compiler-args => ["--profile=$heappath"],
err => / "snapshot" .*? "$heappath" /;

ok $heappath.IO.f, "profiler heap output file exists on disk";
ok (try $heappath.IO.s) > 128, "profiler heap output file isn't tiny";

0 comments on commit d7aa7e6

Please sign in to comment.