aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xGeneralStateTests/schema/run.sh2
-rwxr-xr-xGeneralStateTests/schema/validate.js34
2 files changed, 9 insertions, 27 deletions
diff --git a/GeneralStateTests/schema/run.sh b/GeneralStateTests/schema/run.sh
index a2a0f2db8..45cfbf363 100755
--- a/GeneralStateTests/schema/run.sh
+++ b/GeneralStateTests/schema/run.sh
@@ -1 +1 @@
-echo -e "$(find .. -name '*.json')" | node validate.js
+echo -e "$(find .. -name '*.json' ! -path '../schema/*.json')" | node validate.js
diff --git a/GeneralStateTests/schema/validate.js b/GeneralStateTests/schema/validate.js
index 6f2feef9b..af3e3b495 100755
--- a/GeneralStateTests/schema/validate.js
+++ b/GeneralStateTests/schema/validate.js
@@ -15,15 +15,13 @@ var rl = readline.createInterface({
});
rl.on('line', function(line){
- fs.readFile('simple-schema.json', function(err, data) {
+ fs.readFile('schema.json', function(err, data) {
if (err) {
throw err;
}
-
schema = JSON.parse(data);
-
fs.readFile(line, function(err, data) {
if (err) {
throw err;
@@ -32,35 +30,19 @@ rl.on('line', function(line){
try {
testCode = JSON.parse(data);
} catch(e) {
- debugger;
+ console.log(e);
}
try {
var x = validate(testCode, schema);
+
+ if (x.errors.length > 0) {
+ console.log(line+':\n');
+ console.log(x.errors+'\n')
+ }
} catch(e) {
- console.log(line);
+ console.log(e);
}
-
});
});
});
-
-/*
-fs.readFile('simple-schema.json', function(err, data) {
- if (err) {
- throw err;
- }
-
- schema = JSON.parse(data);
- fs.readFile('example.json', function(err, data) {
- if (err) {
- throw err;
- }
-
- testCode = JSON.parse(data);
- var x = validate(testCode, schema);
- console.log(x);
- debugger;
- });
-});
-*/