I am posting this here because I know all the good folks at the ARB pay close attention to the forums; I have finally gotten around to releasing the suite of Perl and Bourne shell scripts that I created to assist in the extraction and testing of the examples in Appendix A.
I know that there are other solutions out there, but this suite includes means to extract, test/report, and maintain examples in a larger context.https://github.com/estrabd/openmp-spec-code-extract
My idea was that a master of all examples be in a single text file; each example is delimited and has a language appropriate comment block containing useful meta-data. There is a tool that will split this single file into separate files and has the ability to do certain things based on the meta-data. Additionally, the meta-data would allow the testing framework to determine if this was a snippet or full program, if this was supposed to be a valid example, a counter example (either should fail to compile, be compilable but non-conforming, etc), or whatever. All of that is a lot less developed than part of the code that actually extracts the code snippets from the PDF. Lastly, the testing script is just a basic one that attempts to allow one to test using a variety of compilers; there's a post processing script that can take the output of various test runs and display (in an HTML table matrix) what examples compiled/failed for what compilers - and links to any errors encountered.
Regarding testing, I wanted to point out that there is something called the "Test Anything Protocol" (TAP) that would be useful in this context; my scripts don't report in this format, but could. Furthermore, there is a "libtap" in github that allows one to do fairly standard testing using a TAP harness. It might be useful thing to standardize all tests, validation suites, and benchmarks on. Cray's Chapel language distribution also comes with what I believe to be a very nice testing framework. For one, it stays away from using anything derived from Expect (i.e., DejaGnu) and has a way to extend examples with meta-data and results with which you may validate the output of an executed program.
With releasing this, my intention is that if it proves useful, that it be forked into a new project on Github. I will certainly entertain pull requests, but since I (unfortunately) am not doing anything with OpenMP these days, I might not have the time or motivation to maintain the project. I am happy to lend my Perl and shell scripting knowledge, if that could be of any help.