Unverified Commit 20efa6d8 authored by boklm's avatar boklm
Browse files

Use YAML::Syck instead of YAML

YAML::Syck is much faster
parent 6f81e2d5
......@@ -10,7 +10,7 @@ use File::Slurp;
use Template;
use File::Spec;
use JSON;
use YAML;
use YAML::Syck;
use TBBTestSuite::Common qw(exit_error as_array);
use TBBTestSuite::Options qw($options);
use TBBTestSuite::Tests;
......@@ -221,7 +221,7 @@ sub load_report {
return $reports{$report_name} if exists $reports{$report_name};
my $reportfile = "$options->{'reports-dir'}/r/$report_name/report.yml";
return undef unless -f $reportfile;
return $reports{$report_name} = YAML::LoadFile($reportfile);
return $reports{$report_name} = YAML::Syck::LoadFile($reportfile);
}
sub load_reports_for_index {
......@@ -272,7 +272,7 @@ sub save_report_summary {
sub save_report {
my ($report) = @_;
save_report_summary($report);
YAML::DumpFile(report_path($report, 'report.yml'), $report);
YAML::Syck::DumpFile(report_path($report, 'report.yml'), $report);
}
1;
......@@ -2,7 +2,7 @@ package TBBTestSuite::Reports::Receive;
use warnings;
use strict;
use YAML qw(LoadFile);
use YAML::Syck qw(LoadFile);
use File::Path qw(make_path);
use File::Temp;
use File::Copy;
......
......@@ -17,7 +17,7 @@ yum_install() {
perlmodules='
Cwd Data::Dump Digest::SHA File::Path File::Slurp File::Spec File::Temp
FindBin Getopt::Long IO::CaptureOutput IO::Socket::INET Image::Magick
JSON LWP::UserAgent LWP::Protocol::https Template YAML DateTime
JSON LWP::UserAgent LWP::Protocol::https Template YAML::Syck DateTime
Email::Simple Email::Sender File::Type IPC::Run XML::LibXML
'
......@@ -26,7 +26,7 @@ then
apt-get install -y ntp xvfb python-virtualenv
apt-get install -y libdata-dump-perl libdigest-sha-perl libfile-slurp-perl \
libfile-spec-perl libio-captureoutput-perl perlmagick libjson-perl \
libwww-perl libtemplate-perl libyaml-perl libdatetime-perl \
libwww-perl libtemplate-perl libyaml-syck-perl libdatetime-perl \
libemail-sender-perl libemail-simple-perl libfile-type-perl \
libipc-run-perl libxml-libxml-perl
apt-get install -y libgtk2.0-0
......
......@@ -4,7 +4,7 @@ use FindBin;
use lib "$FindBin::Bin";
use Data::Dump qw/dd/;
use File::Path qw(make_path);
use YAML;
use YAML::Syck;
use TBBTestSuite::Common qw(exit_error run_alone rm_pidfile);
use TBBTestSuite::Options qw($options);
use TBBTestSuite::Reports qw(report_dir report_path save_report);
......@@ -60,7 +60,7 @@ sub run_tests {
sub load_report_from_file {
exit_error "--name is not set" unless $options->{name};
my $report = { options => $options };
$report = YAML::LoadFile(report_path($report, 'report.yml'));
$report = YAML::Syck::LoadFile(report_path($report, 'report.yml'));
$report->{options} = { %{$report->{options}}, %$options };
return $report;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment