1e5c31af7Sopenharmony_ci// Copyright 2023-2024 The Khronos Group Inc. 2e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0 3e5c31af7Sopenharmony_ci 4e5c31af7Sopenharmony_ci= Spec Build Tests 5e5c31af7Sopenharmony_ci 6e5c31af7Sopenharmony_ciThis directory contains test source and expectation files for the `testBuild` 7e5c31af7Sopenharmony_ciscript. The test specification files are: 8e5c31af7Sopenharmony_ci 9e5c31af7Sopenharmony_ci * `testspec.adoc` 10e5c31af7Sopenharmony_ci * `chapters/*.adoc` 11e5c31af7Sopenharmony_ci * `chapters/commonvalidity/*.adoc` 12e5c31af7Sopenharmony_ci * `appendices/*.adoc` 13e5c31af7Sopenharmony_ci * `images/*.svg` 14e5c31af7Sopenharmony_ci 15e5c31af7Sopenharmony_ciThe expectation files are: 16e5c31af7Sopenharmony_ci 17e5c31af7Sopenharmony_ci * `expectations/*.html` 18e5c31af7Sopenharmony_ci * `expectations/validusage.json` 19e5c31af7Sopenharmony_ci 20e5c31af7Sopenharmony_ciThe `testBuild` script builds the test specficiation (`testspec.adoc`) in an 21e5c31af7Sopenharmony_ciarray of configurations, such as Core (latest), Core 1.0, with all extensions, 22e5c31af7Sopenharmony_ciwith a specific extension etc. Additionally, it extracts the VUs into 23e5c31af7Sopenharmony_civalidusage.json. 24e5c31af7Sopenharmony_ci 25e5c31af7Sopenharmony_ciEach build by `testBuild` is done in a separate directory under `gen-<build>`. 26e5c31af7Sopenharmony_ciIn all cases except `gen-validusage`, the output is 27e5c31af7Sopenharmony_ci`gen-<build>/out/html/vkspec.html`. In the case of `gen-validusage`, the output 28e5c31af7Sopenharmony_ciis `gen-validusage/out/validition/validusage.json`. 29e5c31af7Sopenharmony_ci 30e5c31af7Sopenharmony_ciThe primary reason for these tests is ensuring correctness of asciidoc 31e5c31af7Sopenharmony_ciextensions implemented in this repository. The `testBuild` script first builds 32e5c31af7Sopenharmony_ciall configurations, then verifies the results against the expectations. 33e5c31af7Sopenharmony_ci 34e5c31af7Sopenharmony_ciIf a build itself regresses (and fails), the script will stop so the issue can 35e5c31af7Sopenharmony_cibe addressed after looking at the logs of the failing build. If the builds 36e5c31af7Sopenharmony_cisucceed but the output does not match the expectations, the diff is output for 37e5c31af7Sopenharmony_ciinvestigation. 38e5c31af7Sopenharmony_ci 39e5c31af7Sopenharmony_ciIn some cases, the diff is small enough to be verified. Otherwise, each output 40e5c31af7Sopenharmony_ciin `gen-<build>/` needs to be manually reviewed to ensure the results are still 41e5c31af7Sopenharmony_cicorrect; for example because the html is styled differently and the differences 42e5c31af7Sopenharmony_ciare as expected. 43e5c31af7Sopenharmony_ci 44e5c31af7Sopenharmony_ciIf the mismatch between the output and expectations is expected, and the output 45e5c31af7Sopenharmony_ciis verified to be correct, update the expectations with: 46e5c31af7Sopenharmony_ci 47e5c31af7Sopenharmony_ci---- 48e5c31af7Sopenharmony_ci$ ./update-expectations 49e5c31af7Sopenharmony_ci---- 50