tests: unittest: Add hook function for handle hal backend library
The hal-api-common uses the dlopen/dlsym/dlclose to load/unload
the shared library of hal backend and find symbol from hal backend library.
For testing hal-api-common functions when building time, re-implement
dlopen/dlsym/dlclose for hooking.By implementing the hooking functions,
be able to verify the internal logic of hal-api-common functions.
Following fucntions are re-implemented for hooking:
- void *dlopen(const char *filename, int flags)
- int dlclose(void *handle)
- void *dlsym(void *handle, const char *symbol)
- int access(const char *pathname, int mode)
And hal-backend-[module] (e.g., tbm/tdm/audio/camera/devcie/power etc)
have to contain the their own hal_backend structure to implement
the h/w device-dependent hal backend. Instead of adding the each hal_backend
structure for all hal modules, use the common 'hal_backend_module_data'
regardless of hal module name.
Change-Id: Icbcba49a654f9ed1a287233c9cc0e3efcca508df
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>