-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.pl
More file actions
executable file
·36 lines (30 loc) · 960 Bytes
/
test.pl
File metadata and controls
executable file
·36 lines (30 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl
use strict;
use warnings;
use RRDs;
use lib qw(Modules);
use SourceFile;
$|++;
sub createProperRRDFilename {
my $sourcefile = SourceFile->new(filepath => "foo.c");
$sourcefile->generateRRDFilename();
$sourcefile->{'rrdfile'} =~ /^data\/foo_c.rrd$/ || die "createProperRRDFilename fail";
$sourcefile = SourceFile->new(filepath => "/foo/bar/baz.c");
$sourcefile->generateRRDFilename();
$sourcefile->{'rrdfile'} =~ /^data\/_foo_bar_baz_c.rrd$/ || die "createProperRRDFilename fail";
}
sub createRRDFile {
`rm -f data/foo_c.rrd`;
my $sourcefile = SourceFile->new(filepath => "foo.c");
$sourcefile->createRRD();
die "rrd not created" unless(-f "data/foo_c.rrd");
my $s = SourceFile->new(filepath => "foo.c");
$s->createRRD();
}
sub testUpdate {
my $sourcefile = SourceFile->new(filepath => "foo.c");
$sourcefile->update(1, 2);
}
createProperRRDFilename();
createRRDFile();
testUpdate();