From e2d7d22ae7e69d30272f366034977ed5165911dd Mon Sep 17 00:00:00 2001 From: Petri Latvala Date: Tue, 23 Oct 2018 15:20:24 +0300 Subject: runner: Unit tests for json generation Test the results.json generation with a top-down approach: With a directory of test run intermediary logs, check that the resulting json would match a reference json file. Signed-off-by: Petri Latvala Cc: Arkadiusz Hiler Reviewed-by: Arkadiusz Hiler --- runner/meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'runner/meson.build') diff --git a/runner/meson.build b/runner/meson.build index 6c4b4862..de6e6f1c 100644 --- a/runner/meson.build +++ b/runner/meson.build @@ -10,6 +10,7 @@ runner_sources = [ 'runner.c' ] resume_sources = [ 'resume.c' ] results_sources = [ 'results.c' ] runner_test_sources = [ 'runner_tests.c' ] +runner_json_test_sources = [ 'runner_json_tests.c' ] if _build_runner and jsonc.found() subdir('testdata') @@ -46,6 +47,13 @@ if _build_runner and jsonc.found() dependencies : igt_deps) test('runner', runner_test) + runner_json_test = executable('runner_json_test', runner_json_test_sources, + c_args : '-DJSON_TESTS_DIRECTORY="@0@"'.format(join_paths(meson.current_source_dir(), 'json_tests_data')), + link_with : runnerlib, + install : false, + dependencies : [igt_deps, jsonc]) + test('runner_json', runner_json_test) + build_info += 'Build test runner: Yes' else build_info += 'Build test runner: No' -- cgit v1.2.3