From 8cc9ffad5ddb84b375b02c41287f6356cef47757 Mon Sep 17 00:00:00 2001 From: Mark Probst Date: Mon, 12 Feb 2018 14:59:23 -0800 Subject: [PATCH] Allow languages to skip "misc" JSON inputs --- test/fixtures.ts | 5 ++++- test/languages.ts | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/fixtures.ts b/test/fixtures.ts index 4ad85b37..ad981c8d 100644 --- a/test/fixtures.ts +++ b/test/fixtures.ts @@ -268,7 +268,9 @@ class JSONFixture extends LanguageFixture { testsInDir("test/inputs/json/samples", "json") ); - const miscSamples = testsInDir("test/inputs/json/misc", "json"); + const miscSamples = this.language.skipMiscJSON + ? [] + : testsInDir("test/inputs/json/misc", "json"); let { priority, others } = samplesFromSources( sources, @@ -337,6 +339,7 @@ class JSONSchemaJSONFixture extends JSONFixture { "31189.json", // same here "ed095.json" // same here on Travis ], + skipMiscJSON: false, skipSchema: [], rendererOptions: {}, quickTestRendererOptions: [] diff --git a/test/languages.ts b/test/languages.ts index 071d36e6..aedc5842 100644 --- a/test/languages.ts +++ b/test/languages.ts @@ -13,6 +13,7 @@ export interface Language { output: string; topLevel: string; skipJSON: string[]; + skipMiscJSON: boolean; skipSchema: string[]; rendererOptions: RendererOptions; quickTestRendererOptions: RendererOptions[]; @@ -33,6 +34,7 @@ export const CSharpLanguage: Language = { skipJSON: [ "31189.json" // JSON.NET doesn't accept year 0000 as 1BC, though it should ], + skipMiscJSON: false, skipSchema: [], rendererOptions: {}, quickTestRendererOptions: [ @@ -59,6 +61,7 @@ export const JavaLanguage: Language = { "simple-identifiers.json", "nst-test-suite.json" ], + skipMiscJSON: false, skipSchema: ["keyword-unions.schema"], // generates classes with names that are case-insensitively equal rendererOptions: {}, quickTestRendererOptions: [] @@ -80,6 +83,7 @@ export const GoLanguage: Language = { "blns-object.json", "nst-test-suite.json" ], + skipMiscJSON: false, skipSchema: [], rendererOptions: {}, quickTestRendererOptions: [] @@ -104,6 +108,7 @@ export const CPlusPlusLanguage: Language = { // takes too long to compile "combinations.json" ], + skipMiscJSON: false, skipSchema: [], rendererOptions: {}, quickTestRendererOptions: [{ unions: "indirection" }] @@ -132,6 +137,7 @@ export const ElmLanguage: Language = { "nst-test-suite.json", "keywords.json" // stack overflow ], + skipMiscJSON: false, skipSchema: [ "union-list.schema", // recursion "list.schema", // recursion @@ -161,6 +167,7 @@ export const SwiftLanguage: Language = { // Doesn't seem to work on Linux, works on MacOS "nst-test-suite.json" ], + skipMiscJSON: false, skipSchema: [], rendererOptions: {}, quickTestRendererOptions: [ @@ -194,6 +201,7 @@ export const ObjectiveCLanguage: Language = { // Compile error "nst-test-suite.json" ], + skipMiscJSON: false, skipSchema: [], rendererOptions: { functions: "true" }, quickTestRendererOptions: [] @@ -213,6 +221,7 @@ export const TypeScriptLanguage: Language = { output: "TopLevel.ts", topLevel: "TopLevel", skipJSON: [], + skipMiscJSON: false, skipSchema: ["keyword-unions.schema"], // can't handle "constructor" property rendererOptions: { "explicit-unions": "yes" }, quickTestRendererOptions: []