Add opus_compare source to repo, call it from Haskell for CI tests #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the source code C file for
opus_compare, and calls into itsmain()function from Haskell as part of the test suite. This is intended to be a replacement for the test suite's dependency on theopus-toolspackage which provides the officialopus_compareexecutable.We employ some hacky workarounds to make this work, the most significant being that we use a wrapper C file around
opus_compare.c, which includes the original source, but removesfprintfs to keep the test suite output clean and rewritesmainto be a different symbol to prevent clashes with Haskell's main. These workarounds enable us to keepopus_compare.cidentical to upstream, simplifying any updates or modifications.The test suite has been rewritten to use this Haskell-C-FFI version of opus_compare.
The CI now also downloads a copy of the Opus test vectors, which are necessary to run the test suite.