Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2013-11-10 17:31:51 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-11-10 17:31:51 +0400
commit720ef322d740c456bfd6430d79cffe48cbe04922 (patch)
treee2f17f5fe390798596824d3e2f65ce8533602601 /Build.PL
parent6387d196fab4decc9a9be8f45ea4fba63c973505 (diff)
Some improvements to Build.PL
Diffstat (limited to 'Build.PL')
-rw-r--r--Build.PL21
1 files changed, 11 insertions, 10 deletions
diff --git a/Build.PL b/Build.PL
index 65bea3222..bf0e5bf53 100644
--- a/Build.PL
+++ b/Build.PL
@@ -19,6 +19,7 @@ my %prereqs = qw(
Moo 1.003001
Scalar::Util 0
Storable 0
+ Test::Harness 0
Test::More 0
IO::Scalar 0
Time::HiRes 0
@@ -40,12 +41,12 @@ if ($gui) {
);
}
-my $missing_prereqs = 0;
+my @missing_prereqs = ();
if ($ENV{SLIC3R_NO_AUTO}) {
foreach my $module (sort keys %prereqs) {
my $version = $prereqs{$module};
next if eval "use $module $version; 1";
- $missing_prereqs = 1 if exists $prereqs{$module};
+ push @missing_prereqs = $module if exists $prereqs{$module};
print "Missing prerequisite $module $version\n";
}
foreach my $module (sort keys %recommends) {
@@ -102,7 +103,7 @@ EOF
my $res = system $cpanm, "$module~$version";
if ($res != 0) {
if (exists $prereqs{$module}) {
- $missing_prereqs = 1;
+ push @missing_prereqs, $module;
} else {
printf "Don't worry, this module is optional.\n";
}
@@ -129,15 +130,15 @@ EOF
}
}
-if ($missing_prereqs) {
+if (@missing_prereqs) {
+ printf "The following prerequisites failed to install: %s\n", join(', ', @missing_prereqs);
exit 1;
-} else {
- my $res = 0;
- if (eval "use App::Prove; 1") {
- $res = App::Prove->new->run ? 0 : 1;
- }
- if (!$gui) {
+} elsif (!$gui) {
+ my $res = App::Prove->new->run ? 0 : 1;
+ if ($res == 0) {
print "If you also want to use the GUI you can now run `perl Build.PL --gui` to install the required modules.\n";
+ } else {
+ print "Some tests failed. Please report the failure to the author!\n";
}
exit $res;
}