[PATCH v6 0/4] test: restore cfgfile lib tests
Stephen Hemminger
stephen at networkplumber.org
Tue Aug 13 17:57:51 CEST 2024
The cfgfile tests did not get built since conversion to meson
and they used an awkward way to manage the test data.
This patchset converts the tests to use a helper to take
text file and make it into a C header. Then use the C header
to generate temporary files as needed.
v6 - rearrange patch order for easier review
Stephen Hemminger (4):
buildtools: add helper to convert text file to header
test: remove unused resource API
test: rearrange test_cfgfiles cases
test: restore cfgfile tests
app/meson.build | 3 +-
app/test/meson.build | 8 +-
app/test/resource.c | 276 ------------------
app/test/resource.h | 106 -------
app/test/test_cfgfile.c | 213 ++++++++------
app/test/test_cfgfiles/{etc => }/empty.ini | 0
.../{etc => }/empty_key_value.ini | 0
.../{etc => }/invalid_section.ini | 0
.../test_cfgfiles/{etc => }/line_too_long.ini | 0
app/test/test_cfgfiles/meson.build | 19 ++
.../{etc => }/missing_section.ini | 0
.../{etc => }/realloc_sections.ini | 0
app/test/test_cfgfiles/{etc => }/sample1.ini | 0
app/test/test_cfgfiles/{etc => }/sample2.ini | 0
app/test/test_resource.c | 104 -------
buildtools/gen-header.py | 36 +++
buildtools/meson.build | 2 +-
17 files changed, 194 insertions(+), 573 deletions(-)
delete mode 100644 app/test/resource.c
delete mode 100644 app/test/resource.h
rename app/test/test_cfgfiles/{etc => }/empty.ini (100%)
rename app/test/test_cfgfiles/{etc => }/empty_key_value.ini (100%)
rename app/test/test_cfgfiles/{etc => }/invalid_section.ini (100%)
rename app/test/test_cfgfiles/{etc => }/line_too_long.ini (100%)
create mode 100644 app/test/test_cfgfiles/meson.build
rename app/test/test_cfgfiles/{etc => }/missing_section.ini (100%)
rename app/test/test_cfgfiles/{etc => }/realloc_sections.ini (100%)
rename app/test/test_cfgfiles/{etc => }/sample1.ini (100%)
rename app/test/test_cfgfiles/{etc => }/sample2.ini (100%)
delete mode 100644 app/test/test_resource.c
create mode 100644 buildtools/gen-header.py
--
2.43.0
More information about the dev
mailing list