libpldm: Reorganize source and test files

Primarily this is about moving specification-specific files into
'dsp/' (in the "DMTF Standard Publication" sense[1]) subdirectories of
both src/ and tests/.

[1]: https://www.dmtf.org/sites/default/files/standards/documents/DSP4014_2.14.0.pdf

libpldm is a concrete C implementation of the PLDM family of
specifications. This invokes some accidental complexity[2] such as the
msgbuf APIs and other concerns.

[2]: https://en.wikipedia.org/wiki/No_Silver_Bullet

Separate the essential complexity (everything under the dsp/
subdirectories) from the accidental complexity (almost everything else).

While doing so, I took the opportunity to drop the 'libpldm_' prefix
and '_test' suffix from a variety of tests. The 'libpldm_' prefix is a
hangover from the days when libpldm was a subproject of OpenBMC's pldm
repo. The '_test' suffix feels redundant given the parent directory
path.

Note that we maintain separation of the src/ and tests/. The test suite
is implemented in C++ while libpldm's APIs are declared and defined in
C. The ability to chop all the tests and C++ out of the implementation
by ignoring a subtree seems like a desirable property when vendoring the
library into other projects.

Finally, update the x86_64 GCC ABI dump, as rearranging the source
causes a lot of churn in its definitions.

Change-Id: Icffcc6cf48b3101ecd38168827c0a81cffb8f083
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/tests/libpldm_base_test.cpp b/tests/dsp/base.cpp
similarity index 100%
rename from tests/libpldm_base_test.cpp
rename to tests/dsp/base.cpp
diff --git a/tests/libpldm_bios_test.cpp b/tests/dsp/bios.cpp
similarity index 100%
rename from tests/libpldm_bios_test.cpp
rename to tests/dsp/bios.cpp
diff --git a/tests/libpldm_bios_table_test.cpp b/tests/dsp/bios_table.cpp
similarity index 100%
rename from tests/libpldm_bios_table_test.cpp
rename to tests/dsp/bios_table.cpp
diff --git a/tests/bios_table_iter.c b/tests/dsp/bios_table_iter.c
similarity index 98%
rename from tests/bios_table_iter.c
rename to tests/dsp/bios_table_iter.c
index 1e9840a..5e187b4 100644
--- a/tests/bios_table_iter.c
+++ b/tests/dsp/bios_table_iter.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 
 /* NOLINTNEXTLINE(bugprone-suspicious-include) */
-#include "bios_table.c"
+#include "dsp/bios_table.c"
 
 /* Satisfy the symbol needs of bios_table.c */
 uint32_t crc32(const void* data __attribute__((unused)),
diff --git a/tests/libpldm_firmware_update_test.cpp b/tests/dsp/firmware_update.cpp
similarity index 100%
rename from tests/libpldm_firmware_update_test.cpp
rename to tests/dsp/firmware_update.cpp
diff --git a/tests/libpldm_fru_test.cpp b/tests/dsp/fru.cpp
similarity index 100%
rename from tests/libpldm_fru_test.cpp
rename to tests/dsp/fru.cpp
diff --git a/tests/dsp/meson.build b/tests/dsp/meson.build
new file mode 100644
index 0000000..c457260
--- /dev/null
+++ b/tests/dsp/meson.build
@@ -0,0 +1,15 @@
+tests += [
+  'dsp/base',
+  'dsp/bios_table',
+  'dsp/bios',
+  'dsp/firmware_update',
+  'dsp/fru',
+  'dsp/pdr',
+  'dsp/platform',
+]
+
+test('dsp/bios_table_iter',
+  executable('bios_table_iter',
+             'bios_table_iter.c',
+             implicit_include_directories: false,
+             include_directories: test_include_dirs))
diff --git a/tests/libpldm_pdr_test.cpp b/tests/dsp/pdr.cpp
similarity index 100%
rename from tests/libpldm_pdr_test.cpp
rename to tests/dsp/pdr.cpp
diff --git a/tests/libpldm_platform_test.cpp b/tests/dsp/platform.cpp
similarity index 100%
rename from tests/libpldm_platform_test.cpp
rename to tests/dsp/platform.cpp
diff --git a/tests/meson.build b/tests/meson.build
index 27103ef..0a2e811 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -12,21 +12,17 @@
         gmock_dep = gtest_proj.dependency('gmock')
 endif
 
+test_include_dirs = [ libpldm_include_dir, include_directories('../src') ]
 
 tests = [
   'instance-id',
-  'libpldm_base_test',
-  'libpldm_bios_table_test',
-  'libpldm_bios_test',
-  'libpldm_firmware_update_test',
-  'libpldm_fru_test',
-  'libpldm_pdr_test',
-  'libpldm_platform_test',
-  'libpldm_utils_test',
   'msgbuf',
   'responder',
+  'utils',
 ]
 
+subdir('dsp')
+
 # The 'test' transport APIs will never be marked stable as they are just for
 # testing.
 if get_option('abi').contains('testing')
@@ -41,8 +37,6 @@
   subdir('oem/meta')
 endif
 
-test_include_dirs = [ libpldm_include_dir, include_directories('../src') ]
-
 foreach t : tests
   test(t, executable(t.underscorify(), t + '.cpp',
                      implicit_include_directories: false,
@@ -54,11 +48,6 @@
        workdir: meson.current_source_dir())
 endforeach
 
-test('bios_table_iter', executable('bios_table_iter',
-                                   'bios_table_iter.c',
-                                   implicit_include_directories: false,
-                                   include_directories: test_include_dirs))
-
 test('msgbuf_generic', executable('msgbuf_generic',
                                   'msgbuf_generic.c',
                                   implicit_include_directories: false,
diff --git a/tests/oem/ibm/libpldm_fileio_test.cpp b/tests/oem/ibm/fileio.cpp
similarity index 100%
rename from tests/oem/ibm/libpldm_fileio_test.cpp
rename to tests/oem/ibm/fileio.cpp
diff --git a/tests/oem/ibm/libpldm_host_test.cpp b/tests/oem/ibm/host.cpp
similarity index 100%
rename from tests/oem/ibm/libpldm_host_test.cpp
rename to tests/oem/ibm/host.cpp
diff --git a/tests/oem/ibm/meson.build b/tests/oem/ibm/meson.build
index 94c2011..389f83b 100644
--- a/tests/oem/ibm/meson.build
+++ b/tests/oem/ibm/meson.build
@@ -1,4 +1,4 @@
 tests += [
-  'oem/ibm/libpldm_fileio_test',
-  'oem/ibm/libpldm_host_test',
+  'oem/ibm/fileio',
+  'oem/ibm/host',
 ]
diff --git a/tests/oem/meta/libpldm_fileio_test.cpp b/tests/oem/meta/fileio.cpp
similarity index 100%
rename from tests/oem/meta/libpldm_fileio_test.cpp
rename to tests/oem/meta/fileio.cpp
diff --git a/tests/oem/meta/meson.build b/tests/oem/meta/meson.build
index 16cc794..03c33f5 100644
--- a/tests/oem/meta/meson.build
+++ b/tests/oem/meta/meson.build
@@ -1,3 +1,3 @@
 tests += [
-  'oem/meta/libpldm_fileio_test',
+  'oem/meta/fileio',
 ]
diff --git a/tests/libpldm_utils_test.cpp b/tests/utils.cpp
similarity index 100%
rename from tests/libpldm_utils_test.cpp
rename to tests/utils.cpp