mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
spa: auto-generate the cpp compilation test
Replace the manually maintained header list with a Python script that finds all header files and includes them in order. This adds another 25 or so previously headers to the C++ compilation tests.
This commit is contained in:
parent
fb75367975
commit
db989d851d
3 changed files with 30 additions and 82 deletions
24
spa/tests/gen-cpp-test.py
Executable file
24
spa/tests/gen-cpp-test.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Generates a simple .cpp file including all of the SPA headers.
|
||||
#
|
||||
# Usage: gen-cpp-test.py path/to/pipewire.git/spa/include/spa
|
||||
|
||||
template = """
|
||||
@@INCLUDES@@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
basedir = Path(sys.argv[1])
|
||||
includes = [
|
||||
"#include <{}>".format(f.relative_to(basedir.parent)) for f in sorted(basedir.rglob("*.h"))
|
||||
]
|
||||
|
||||
print(template.replace("@@INCLUDES@@", "\n".join(includes)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue