Speed up the GenerateExportHeader unit test (#14453).

Instead of running many small tests with many cmake projects, simply
compare the generated export header against a reference.
Merge topic 'GenerateExportHeader-tests' into next

ba21786 Speed up the GenerateExportHeader unit test (#14453).