my
$javaVersion
= `java -version 2>&1` ||
'missing'
;
chomp
(
$javaVersion
);
my
$missingMessage
=
"Missing JVM, ergo you cannot test JERL (Download a JVM and make it available)"
;
my
$diagMessage
=
""
;
SKIP: {
skip
$missingMessage
, 1
unless
$javaVersion
;
isnt (
$javaVersion
,
'missing'
,
'Tested that JVM is *NOT* Missing'
);
}
TROUBLESHOOT: {
if
(
$javaVersion
eq
'missing'
) {
$diagMessage
.=
'Java was NOT available to the commandline. Consider adding Java to your path.'
;
}
my
@checks
= (
'java'
,
'ver'
,
'jdk'
);
foreach
my
$checkForThis
(
@checks
) {
if
(
$javaVersion
!~ m/
$checkForThis
/ig) {
$diagMessage
.=
'[Could not find "$checkForThis" in version]'
;
}
}
}
diag(
"---------------------------------------- [ Test for JVM ... ]"
);
diag(
"-- Found Java Version: $javaVersion "
);
diag(
"-- $diagMessage "
);
diag(
"---------------------------------------- [ ... Test for JVM ]"
);