libpldm: Migrate to subproject
Organize files in libpldm to make it a subproject
In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organisation
of the source code to make it work as a subproject.
There are no .c/.h files changes in this commit, only meson
changes and re-organising the code structure.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I20a71c0c972b1fd81fb359d604433618799102c6
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..1955487
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,43 @@
+gtest_dep = dependency('gtest', main: true, disabler: true, required: false)
+gmock_dep = dependency('gmock', disabler: true, required: false)
+if not gtest_dep.found() or not gmock_dep.found()
+ gtest_proj = import('cmake').subproject('googletest', required: true)
+ gtest_dep = declare_dependency(
+ dependencies: [
+ dependency('threads'),
+ gtest_proj.dependency('gtest'),
+ gtest_proj.dependency('gtest_main'),
+ ]
+ )
+ gmock_dep = gtest_proj.dependency('gmock')
+endif
+
+
+tests = [
+ 'libpldm_base_test',
+ 'libpldm_platform_test',
+ 'libpldm_bios_test',
+ 'libpldm_bios_table_test',
+ 'libpldm_fru_test',
+ 'libpldm_utils_test',
+ 'libpldm_pdr_test',
+ 'libpldm_firmware_update_test'
+]
+
+if get_option('oem-ibm').enabled()
+ tests += [
+ 'oem/ibm/libpldm_fileio_test',
+ 'oem/ibm/libpldm_host_test',
+ ]
+endif
+
+foreach t : tests
+ test(t, executable(t.underscorify(), t + '.cpp',
+ implicit_include_directories: false,
+ dependencies: [
+ libpldm_dep,
+ gtest_dep,
+ gmock_dep]),
+ workdir: meson.current_source_dir())
+endforeach
+