commit ff16e7da57762403824b26d0bf9bb00c20e9d705
parent ad394ab9d7ed71344b9fde5bef45687f35d19a89
Author: Kyle Milz <kyle@0x30.net>
Date: Sun, 26 Jun 2016 22:25:41 -0600
Test: add 2 more interfaces to Package
Diffstat:
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/Test/Package.pm b/Test/Package.pm
@@ -76,6 +76,18 @@ sub parse_output {
return @pkgs;
}
+sub get_file_size {
+ my ($self, $file) = @_;
+ return ((stat "$self->{srcdir}/$file")[7]);
+}
+
+sub clean {
+ my ($self, $clean_cmd) = @_;
+
+ $self->{clean_cmd} = $clean_cmd;
+ $self->time_system($clean_cmd);
+}
+
sub configure {
my ($self, $config_cmd) = @_;
diff --git a/tt/vim.t b/tt/vim.t
@@ -41,14 +41,14 @@ $scalar_vanilla[0] = $package->configure("make config");
# Vanilla compile.
$scalar_vanilla[1] = $package->compile("make -j8 all");
-$scalar_vanilla[2] = ((stat "$srcdir/vim")[7]);
-$scalar_vanilla[3] = ((stat "$srcdir/xxd/xxd")[7]);
+$scalar_vanilla[2] = $package->get_file_size("/vim");
+$scalar_vanilla[3] = $package->get_file_size("/xxd/xxd");
# Vanilla test.
$scalar_vanilla[4] = time_expect("make", "-C", "$srcdir/testdir");
# Clean up before rebuild.
-system("make -C $srcdir distclean");
+$package->clean("make distclean");
# Instrumented configure.
$scalar_citrun[0] = $package->inst_configure();
@@ -56,8 +56,8 @@ $scalar_citrun[0] = $package->inst_configure();
# Instrumented compile.
$scalar_citrun[1] = $package->inst_compile();
-$scalar_citrun[2] = ((stat "$srcdir/vim")[7]);
-$scalar_citrun[3] = ((stat "$srcdir/xxd/xxd")[7]);
+$scalar_citrun[2] = $package->get_file_size("/vim");
+$scalar_citrun[3] = $package->get_file_size("/xxd/xxd");
# Instrumented test.
$scalar_citrun[4] = time_expect("make", "-C", "$srcdir/testdir");