Add new field checks (#9)
* Add new field checks * Release->Testcase in testcase checks * Update regions to be lower case * Add title ids to all testcases * Add question-mark entries for empty CPU/GPU/OS combinations
This commit is contained in:
parent
64122135d9
commit
41e5446619
|
@ -5,24 +5,25 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000054600"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-11-17"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000055000"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2011-11-17"
|
||||
|
||||
[[ releases ]]
|
||||
title = "000400000004e800"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2012-04-25"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000054600"
|
||||
compatibility = "1"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "Clector"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
||||
|
|
|
@ -6,10 +6,11 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000086300"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-06-09"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000086300"
|
||||
compatibility = "3"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,10 +6,11 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000A0500"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-02-04"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000000A0500"
|
||||
compatibility = "2"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -5,24 +5,25 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000010BE00"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2014-01-11"
|
||||
|
||||
[[ releases ]]
|
||||
title = "000400000010BF00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2014-05-02"
|
||||
|
||||
[[ releases ]]
|
||||
title = "000400000010C000"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2014-05-16"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000010BF00"
|
||||
compatibility = "1"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "Clector"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -6,14 +6,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000EC300"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-11-22"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000000EC300"
|
||||
compatibility = "1"
|
||||
date = "2017-06-03"
|
||||
version = "HEAD-e46ec64"
|
||||
author = "Leo121"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -6,15 +6,16 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000125500"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2015-02-13"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000125600"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2015-02-13"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000125500"
|
||||
compatibility = "1"
|
||||
date = "2017-06-03"
|
||||
version = "HEAD-a7ddec8"
|
||||
|
|
|
@ -5,10 +5,11 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000033500"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-06-19"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000033500"
|
||||
compatibility = "0"
|
||||
date = "2017-06-03"
|
||||
version = "HEAD-a7ddec8"
|
||||
|
|
|
@ -6,14 +6,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000030800"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-12-04"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000030800"
|
||||
compatibility = "3"
|
||||
date = "2017-06-03"
|
||||
version = "HEAD-a7ddec8"
|
||||
author = "TheKoopaKingdom"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -4,10 +4,11 @@ github_issues = [2660]
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000188C00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2017-03-06"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000188C00"
|
||||
compatibility = "5"
|
||||
date = "2017-06-03"
|
||||
version = "HEAD-a7ddec8"
|
||||
|
|
|
@ -6,14 +6,15 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000126300"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2015-02-13"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000126300"
|
||||
compatibility = "3"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-bae3799"
|
||||
author = "Desmond"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,19 +5,20 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000e9200"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2012-09-06"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000064200"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2011-06-27"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000000e9200"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,19 +5,20 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000cbc00"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2013-01-24"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000084600"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2011-12-28"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000000cbc00"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,19 +5,20 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000102900"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2013-12-14"
|
||||
|
||||
[[ releases ]]
|
||||
title = "00040000000EEA00"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2013-06-12"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000102900"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,19 +5,20 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000127300"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-10-03"
|
||||
|
||||
[[ releases ]]
|
||||
title = "000400000010F000"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2013-11-20"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000127300"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,14 +5,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000149800"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2014-11-13"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000149800"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,14 +5,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000016ef00"
|
||||
region = "EUR"
|
||||
region = "usa"
|
||||
release_date = "2015-06-30"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000016ef00"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -5,14 +5,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000001adb00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2016-12-15"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000001adb00"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "SonofUgly"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -6,12 +6,12 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000ba800"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-03-24"
|
||||
|
||||
[[ releases ]]
|
||||
title = "00040000000ba900"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2013-05-17"
|
||||
|
||||
[[ testcases ]]
|
||||
|
|
|
@ -6,15 +6,16 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000011C400"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2014-11-21"
|
||||
|
||||
[[ releases ]]
|
||||
title = "000400000011C500"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2014-11-21"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000011C400"
|
||||
compatibility = "1"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,15 +6,16 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000164800"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2016-11-18"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000175E00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2016-11-18"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000164800"
|
||||
compatibility = "1"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,12 +6,12 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000174600"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2016-02-20"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000174400"
|
||||
region = "EUR"
|
||||
region = "eur"
|
||||
release_date = "2016-02-20"
|
||||
|
||||
[[ testcases ]]
|
||||
|
|
|
@ -6,15 +6,16 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000055D00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-10-12"
|
||||
|
||||
[[ releases ]]
|
||||
title = "0004000000055E00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2013-10-12"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000055D00"
|
||||
compatibility = "3"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,15 +6,16 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000197500"
|
||||
region = "JPN"
|
||||
region = "jpn"
|
||||
release_date = "2016-12-08"
|
||||
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000197500"
|
||||
compatibility = "5"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "Clector"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -6,10 +6,11 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000049000"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-07-14"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000049000"
|
||||
compatibility = "1"
|
||||
date = "2017-06-04"
|
||||
version = "HEAD-8f0a23b"
|
||||
|
|
|
@ -5,14 +5,15 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000019F500"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2017-02-28"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000019F500"
|
||||
compatibility = "0"
|
||||
date = "2017-06-05"
|
||||
version = "HEAD-8f0a23b"
|
||||
author = "soukoba"
|
||||
cpu = ""
|
||||
gpu = ""
|
||||
os = ""
|
||||
cpu = "?"
|
||||
gpu = "?"
|
||||
os = "?"
|
|
@ -6,10 +6,11 @@ needs_shared_font = false
|
|||
|
||||
[[ releases ]]
|
||||
title = "0004000000054000"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-11-13"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "0004000000054000"
|
||||
compatibility = "2"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,10 +6,11 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "00040000000EDF00"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2014-10-03"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "00040000000EDF00"
|
||||
compatibility = "1"
|
||||
date = "2017-05-31"
|
||||
version = "HEAD-4857eb4"
|
||||
|
|
|
@ -6,10 +6,11 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000006F100"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2012-07-05"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000006F100"
|
||||
compatibility = "1"
|
||||
date = "2017-06-04"
|
||||
version = "HEAD-8f0a23b"
|
||||
|
|
|
@ -6,10 +6,11 @@ needs_shared_font = true
|
|||
|
||||
[[ releases ]]
|
||||
title = "000400000007e700"
|
||||
region = "USA"
|
||||
region = "usa"
|
||||
release_date = "2011-12-22"
|
||||
|
||||
[[ testcases ]]
|
||||
title = "000400000007e700"
|
||||
compatibility = "1"
|
||||
date = "2017-06-04"
|
||||
version = "HEAD-8f0a23b"
|
||||
|
|
|
@ -35,10 +35,24 @@ function validateImage(path, config) {
|
|||
}
|
||||
|
||||
let dimensions = sizeOf(path);
|
||||
if (dimensions.width !== config.width || dimensions.height !== config.height) {
|
||||
validationError(`Image \"${path}\"'s dimensions are ${dimensions.width} x ${dimensions.height} ` +
|
||||
`instead of the required ${config.width} x ${config.height}.`);
|
||||
let sizesString = "";
|
||||
|
||||
for (sizeIndex in config.sizes) {
|
||||
const size = config.sizes[sizeIndex];
|
||||
|
||||
if (dimensions.width === size.width && dimensions.height === size.height) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Really beautiful multi-size printing. Work of art.
|
||||
if (sizesString.length !== 0) {
|
||||
sizesString += ", ";
|
||||
}
|
||||
sizesString += `${size.width} x ${size.height}`;
|
||||
}
|
||||
|
||||
validationError(`Image \"${path}\"'s dimensions are ${dimensions.width} x ${dimensions.height} ` +
|
||||
`instead of the any of the following: ${sizesString}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,6 +161,22 @@ function validateTOML(path) {
|
|||
});
|
||||
}
|
||||
|
||||
if (tomlDoc["gametypes"] !== undefined) {
|
||||
validateContents(tomlDoc, "gametypes", field => {
|
||||
if (config.gametypes.indexOf(field) === -1) {
|
||||
validationError(`Could not find gametype \"${field}\"!`);
|
||||
}
|
||||
|
||||
if (field === "vc") {
|
||||
validateContents(tomlDoc, "vc_system", field => {
|
||||
if (config.vc-systems.indexOf(field) === -1) {
|
||||
validationError(`Could not find VC console \"${field}\"!`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let section;
|
||||
let i;
|
||||
|
||||
|
@ -183,6 +213,14 @@ function validateTOML(path) {
|
|||
for (i = 0; i < section.length; i++) {
|
||||
const testcase = section[i];
|
||||
|
||||
validateContents(testcase, "title", field => {
|
||||
if (field.length !== 16) {
|
||||
validationError(`Testcase #${i + 1}: Game title ID has an invalid length`);
|
||||
} else if (!field.match(/([a-zA-Z0-9]){16}/)) {
|
||||
validationError(`Testcase #${i + 1}: Game title ID is not a hexadecimal ID`);
|
||||
}
|
||||
});
|
||||
|
||||
validateNotEmpty(testcase, "compatibility");
|
||||
if (testcase["compatibility"] !== undefined) {
|
||||
let compat = parseInt(testcase["compatibility"]);
|
||||
|
@ -201,7 +239,9 @@ function validateTOML(path) {
|
|||
});
|
||||
validateNotEmpty(testcase, "author");
|
||||
|
||||
// TODO: CPU/GPU/OS fields
|
||||
validateNotEmpty(testcase, "cpu");
|
||||
validateNotEmpty(testcase, "gpu");
|
||||
validateNotEmpty(testcase, "os");
|
||||
}
|
||||
} else {
|
||||
validationError("No testcases.")
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
"directory": "..",
|
||||
"regions": ["JPN", "USA", "EUR", "AUS", "CHN", "KOR", "TWN", "ALL"],
|
||||
"boxart": { "filename": "boxart.png", "width": 328, "height": 300, "type": "image/png"},
|
||||
"icon": { "filename": "icon.png", "width": 48, "height": 48, "type": "image/png"},
|
||||
"screenshots": { "dirname": "screenshots", "width": 400, "height": 480, "type": "image/png"},
|
||||
"regions": ["jpn", "usa", "eur", "aus", "chn", "kor", "twn", "all"],
|
||||
"gametypes": ["vc", "dsi", "eshop"],
|
||||
"vc-systems": ["nes", "snes", "gb", "gbc", "gba", "gg"],
|
||||
"boxart": { "filename": "boxart.png", "sizes": [{"width": 328, "height": 300}, {"width": 500, "height": 300}], "type": "image/png"},
|
||||
"icon": { "filename": "icon.png", "sizes": [{"width": 48, "height": 48}], "type": "image/png"},
|
||||
"screenshots": { "dirname": "screenshots", "sizes": [{"width": 400, "height": 480}], "type": "image/png"},
|
||||
"saves": { "dirname": "savefiles"},
|
||||
"data": { "filename": "game.dat" }
|
||||
}
|
||||
|
|
Reference in New Issue