2021-06-05 22:41:37 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Bloom\BuildScripts;
|
|
|
|
|
|
|
|
|
|
require_once __DIR__ . "/TargetDescriptionFiles/Factory.php";
|
|
|
|
|
|
2021-06-05 22:43:03 +01:00
|
|
|
print "Loading AVR8 target description files.\n";
|
2021-06-05 22:41:37 +01:00
|
|
|
$avr8Tdfs = TargetDescriptionFiles\Factory::loadAvr8Tdfs();
|
|
|
|
|
$failedValidationCount = 0;
|
|
|
|
|
|
|
|
|
|
foreach ($avr8Tdfs as $targetDescriptionFile) {
|
|
|
|
|
$validationFailures = $targetDescriptionFile->validate();
|
|
|
|
|
|
|
|
|
|
if (!empty($validationFailures)) {
|
|
|
|
|
$failedValidationCount++;
|
|
|
|
|
|
|
|
|
|
print "\033[31m";
|
|
|
|
|
print "Validation for " . $targetDescriptionFile->filePath . " failed.\n";
|
2023-05-28 02:17:20 +01:00
|
|
|
print count($validationFailures) . " error(s) found:\n";
|
2021-06-05 22:41:37 +01:00
|
|
|
print implode("\n", $validationFailures);
|
|
|
|
|
print "\n\n";
|
|
|
|
|
print "\033[0m";
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
print "\033[32m";
|
|
|
|
|
print "Validation for " . $targetDescriptionFile->filePath . " passed.\n";
|
|
|
|
|
print "\033[0m";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print "\n\n";
|
|
|
|
|
print "Validated " . count($avr8Tdfs) . " TDFs. ";
|
|
|
|
|
print (($failedValidationCount > 0) ? "\033[31m" : "\033[32m");
|
2023-05-28 02:17:20 +01:00
|
|
|
print $failedValidationCount . " failure(s)." . "\033[0m" . "\n";
|
2021-06-05 22:41:37 +01:00
|
|
|
echo "Done\n";
|