diff --git a/test/integration/meson.build b/test/integration/meson.build index df95e0ddd02..2743147d2d5 100644 --- a/test/integration/meson.build +++ b/test/integration/meson.build @@ -1,6 +1,7 @@ if get_option('enable_tests') test_conf_data = configuration_data() test_conf_data.set_quoted('RIZIN_BUILD_PATH', rizin_exe.full_path()) + test_conf_data.set_quoted('TEST_BUILD_TYPES_DIR', fs.as_posix(types_build_dir)) test_config_h = configure_file( input: 'test_config.h.in', output: 'test_config.h', diff --git a/test/integration/test_config.h.in b/test/integration/test_config.h.in index 089c3b06230..7bd48758949 100644 --- a/test/integration/test_config.h.in +++ b/test/integration/test_config.h.in @@ -5,5 +5,6 @@ #define _TEST_CONFIG_H_ #define RIZIN_BUILD_PATH @RIZIN_BUILD_PATH@ +#define TEST_BUILD_TYPES_DIR @TEST_BUILD_TYPES_DIR@ #endif /* _TEST_CONFIG_H_ */ diff --git a/test/integration/test_dwarf_integration.c b/test/integration/test_dwarf_integration.c index 029f8295c19..2c87b83b070 100644 --- a/test/integration/test_dwarf_integration.c +++ b/test/integration/test_dwarf_integration.c @@ -5,6 +5,7 @@ #include #include #include +#include "test_config.h" #include "test_types.h" #include "../unit/minunit.h" @@ -144,9 +145,7 @@ static bool test_dwarf_function_parsing_cpp(void) { // TODO fix, how to correctly promote binary info to the RzAnalysis in unit tests? rz_analysis_set_cpu(analysis, "x86"); rz_analysis_set_bits(analysis, 64); - char *types_dir = rz_path_system(RZ_SDB_TYPES); - rz_type_db_init(analysis->typedb, types_dir, "x86", 64, "linux"); - free(types_dir); + rz_type_db_init(analysis->typedb, TEST_BUILD_TYPES_DIR, "x86", 64, "linux"); RzBinOptions opt = { 0 }; rz_bin_options_init(&opt, 0, 0, 0, false); diff --git a/test/unit/test_analysis_var.c b/test/unit/test_analysis_var.c index 96752d4e6e2..37559c09e9c 100644 --- a/test/unit/test_analysis_var.c +++ b/test/unit/test_analysis_var.c @@ -3,6 +3,7 @@ #include #include +#include "test_config.h" #include "minunit.h" static bool sanitize_instr_acc(void *user, const ut64 k, const void *v) { @@ -290,6 +291,7 @@ bool test_rz_analysis_function_var_expr_for_reg_access_at() { RzAnalysis *analysis = rz_analysis_new(); rz_analysis_use(analysis, "x86"); rz_analysis_set_bits(analysis, 64); + rz_type_db_init(analysis->typedb, TEST_BUILD_TYPES_DIR, NULL, 64, NULL); RzAnalysisFunction *fcn = rz_analysis_create_function(analysis, "fcn", 0x100, RZ_ANALYSIS_FCN_TYPE_FCN); fcn->bp_off = 8;