|
10 | 10 | class Build : NukeBuild
|
11 | 11 | {
|
12 | 12 | public static int Main() => Execute<Build>(x => x.AuditAllIdsFiles);
|
13 |
| - |
| 13 | + |
14 | 14 | [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
|
15 | 15 | private readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
|
16 | 16 |
|
@@ -184,15 +184,53 @@ class Build : NukeBuild
|
184 | 184 | var inputFolder = RootDirectory / "Documentation" / "testcases";
|
185 | 185 | var arguments = $"audit \"{inputFolder}\" --omitContentAuditPattern \"[\\\\|/]invalid-\" -x \"{schemaFile}\"";
|
186 | 186 | IdsTool(arguments, workingDirectory: IdsToolPath);
|
187 |
| - }); |
| 187 | + }); |
188 | 188 |
|
189 |
| - /// <summary> |
190 |
| - /// Perform all quality assurance of published IDS files; this is the one invoked by default |
191 |
| - /// </summary> |
192 |
| - Target AuditAllIdsFiles => _ => _ |
| 189 | + /// <summary> |
| 190 | + /// Audits the validity of Documentation/testcases folder in the repository, using ids-tool. |
| 191 | + /// The tool is deployed by the annotated <see cref="IdsTool"/>. |
| 192 | + /// The schema is loaded from the repository to ensure internal coherence. |
| 193 | + /// </summary> |
| 194 | + Target TestAccurateInvalid => _ => _ |
| 195 | + .AssuredAfterFailure() |
| 196 | + .Executes(() => |
| 197 | + { |
| 198 | + // we are omitting tests on the content of the Documentation/testcases folder, |
| 199 | + // because they include IDSs that intentionally contain errors |
| 200 | + // |
| 201 | + // todo: once stable, this could be improved to omit contents based on failure patter name |
| 202 | + // todo: once stable, constrained on expected auditing failures on the "fail-" cases should be added |
| 203 | + var schemaFile = RootDirectory / "Development" / "ids.xsd"; |
| 204 | + var inputFolder = RootDirectory / "Documentation" / "testcases"; |
| 205 | + |
| 206 | + DirectoryInfo d = new DirectoryInfo(inputFolder); |
| 207 | + foreach (var invalidFile in d.GetFiles("invalid-*.ids", SearchOption.AllDirectories)) |
| 208 | + { |
| 209 | + Console.WriteLine(invalidFile.FullName); |
| 210 | + var arguments = $"audit \"{invalidFile}\" -x \"{schemaFile}\""; |
| 211 | + try |
| 212 | + { |
| 213 | + var t = IdsTool(arguments, workingDirectory: IdsToolPath); |
| 214 | + } |
| 215 | + catch (ProcessException ex) |
| 216 | + { |
| 217 | + if (ex.ExitCode != 16) |
| 218 | + throw new Exception("Unexpected exit code"); |
| 219 | + |
| 220 | + } |
| 221 | + } |
| 222 | + |
| 223 | + |
| 224 | + }); |
| 225 | + |
| 226 | + /// <summary> |
| 227 | + /// Perform all quality assurance of published IDS files; this is the one invoked by default |
| 228 | + /// </summary> |
| 229 | + Target AuditAllIdsFiles => _ => _ |
193 | 230 | .AssuredAfterFailure()
|
194 | 231 | .DependsOn(AuditDocTestCases)
|
195 | 232 | .DependsOn(AuditDevelopment)
|
| 233 | + .DependsOn(TestAccurateInvalid) |
196 | 234 | .Executes(() =>
|
197 | 235 | {
|
198 | 236 | Console.WriteLine("This is an utility target that launches all available IDS auditing targets.");
|
|
0 commit comments