Skip to content

Commit

Permalink
test: restore cfgfile tests
Browse files Browse the repository at this point in the history
These tests were not built since the conversion to meson.
Instead of using embedded resource functions, put data in include
file and generate temporary file before the test.

The changes to app/test/meson.build are to handle auto-generated
files (resources) differently. Don't scan these files to look
for test input.

Using common unit test macro allows for simpler management
of more tests.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
shemminger authored and tmonjalo committed Nov 19, 2024
1 parent 58bf7cb commit be22019
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 84 deletions.
3 changes: 2 additions & 1 deletion app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ foreach app:apps
build = true
reason = '<unknown reason>' # set if build == false to explain
sources = []
resources = []
includes = []
cflags = default_cflags
ldflags = default_ldflags
Expand Down Expand Up @@ -115,7 +116,7 @@ foreach app:apps
endif

exec = executable('dpdk-' + name,
sources,
[ sources, resources ],
c_args: cflags,
link_args: ldflags,
link_whole: link_libs,
Expand Down
6 changes: 5 additions & 1 deletion app/test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ source_file_deps = {
'test_bitratestats.c': ['metrics', 'bitratestats', 'ethdev'] + sample_packet_forward_deps,
'test_bpf.c': ['bpf', 'net'],
'test_byteorder.c': [],
# 'test_cfgfile.c': ['cfgfile'],
'test_cfgfile.c': ['cfgfile'],
'test_cksum.c': ['net'],
'test_cksum_perf.c': ['net'],
'test_cmdline.c': [],
Expand Down Expand Up @@ -265,3 +265,7 @@ if not is_windows
build_by_default: true,
install: false)
endif

subdir('test_cfgfiles')

resources += test_cfgfile_h
Loading

0 comments on commit be22019

Please sign in to comment.