1trees = static_library('trees', files('trees.S'), c_args: '-D__ASSEMBLY__', 2 include_directories: libfdt_inc) 3 4dumptrees = executable('dumptrees', files('dumptrees.c'), 5 link_with: trees, dependencies: libfdt_dep) 6 7dumptrees_dtb = custom_target( 8 'dumptrees', 9 command: [dumptrees, meson.current_build_dir()], 10 output: [ 11 'test_tree1.dtb', 12 'bad_node_char.dtb', 13 'bad_node_format.dtb', 14 'bad_prop_char.dtb', 15 'ovf_size_strings.dtb', 16 'truncated_property.dtb', 17 'truncated_string.dtb', 18 'truncated_memrsv.dtb', 19 ] 20) 21 22testutil_dep = declare_dependency(sources: ['testutils.c'], link_with: trees) 23 24tests = [ 25 'add_subnode_with_nops', 26 'addr_size_cells', 27 'addr_size_cells2', 28 'appendprop1', 29 'appendprop2', 30 'appendprop_addrrange', 31 'boot-cpuid', 32 'char_literal', 33 'check_full', 34 'check_header', 35 'check_path', 36 'del_node', 37 'del_property', 38 'dtb_reverse', 39 'dtbs_equal_ordered', 40 'dtbs_equal_unordered', 41 'extra-terminating-null', 42 'find_property', 43 'fs_tree1', 44 'get_alias', 45 'get_mem_rsv', 46 'get_name', 47 'get_path', 48 'get_phandle', 49 'get_prop_offset', 50 'getprop', 51 'incbin', 52 'integer-expressions', 53 'mangle-layout', 54 'move_and_save', 55 'node_check_compatible', 56 'node_offset_by_compatible', 57 'node_offset_by_phandle', 58 'node_offset_by_prop_value', 59 'nop_node', 60 'nop_property', 61 'nopulate', 62 'notfound', 63 'open_pack', 64 'overlay', 65 'overlay_bad_fixup', 66 'parent_offset', 67 'path-references', 68 'path_offset', 69 'path_offset_aliases', 70 'phandle_format', 71 'property_iterate', 72 'propname_escapes', 73 'references', 74 'root_node', 75 'rw_oom', 76 'rw_tree1', 77 'set_name', 78 'setprop', 79 'setprop_inplace', 80 'sized_cells', 81 'string_escapes', 82 'stringlist', 83 'subnode_iterate', 84 'subnode_offset', 85 'supernode_atdepth_offset', 86 'sw_states', 87 'sw_tree1', 88 'utilfdt_test', 89] 90 91tests += [ 92 'truncated_memrsv', 93 'truncated_property', 94 'truncated_string', 95] 96 97dl = cc.find_library('dl', required: false) 98if dl.found() 99 tests += [ 100 'asm_tree_dump', 101 'value-labels', 102 ] 103endif 104 105foreach t: tests 106 executable(t, files(t + '.c'), dependencies: [testutil_dep, util_dep, libfdt_dep, dl]) 107endforeach 108 109run_tests = find_program('run_tests.sh') 110 111env = [] 112if not py.found() 113 env += 'NO_PYTHON=1' 114else 115 env += [ 116 'PYTHON=' + py.path(), 117 'PYTHONPATH=' + meson.source_root() / 'pylibfdt', 118 ] 119endif 120if not yaml.found() 121 env += 'NO_YAML=1' 122endif 123 124test( 125 'run-test', 126 run_tests, 127 workdir: meson.current_build_dir(), 128 depends: dumptrees_dtb, 129 env: env, 130 timeout: 1800, # mostly for valgrind 131) 132