Remove gtest
It would be useful to be able to run libcper decoding unit tests without
needing a C compiler, as would be required if this were compiled to a
python module.
Change-Id: I183bc9ef048c336205186ea449e15b7766b19990
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/tests/meson.build b/tests/meson.build
index 0123dc2..8101587 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,37 +1,15 @@
-cmake = import('cmake')
-
-gtest = dependency('gtest', disabler: true, required: false)
-gmock = dependency('gmock', disabler: true, required: false)
-if not gtest.found() or not gmock.found()
- gtest_proj = import('cmake').subproject('googletest', required: false)
- if gtest_proj.found()
- gtest = declare_dependency(
- dependencies: [
- dependency('threads'),
- gtest_proj.dependency('gtest'),
- ],
- )
- gmock = gtest_proj.dependency('gmock')
- else
- assert(
- not get_option('tests').allowed(),
- 'Googletest is required if tests are enabled',
- )
- endif
-endif
-
jsonc_daccord = dependency(
'jsoncdac',
default_options: ['default_library=static'],
)
-test_sources = ['test-utils.c', 'base64_test.cpp']
+test_sources = files('base64_test.c', 'test-utils.c')
test_include_dirs = ['.', '../include']
cper_tests = executable(
'cper-tests',
- 'ir-tests.cpp',
+ 'ir-tests.c',
test_sources,
implicit_include_directories: false,
include_directories: include_directories(test_include_dirs),
@@ -40,17 +18,15 @@
jsonc_daccord,
libcper_parse_dep,
libcper_generate_dep,
- gtest,
- gmock,
],
)
-test('test-cper-tests', cper_tests, protocol: 'gtest')
+test('test-cper-tests', cper_tests)
-cxx = meson.get_compiler('cpp')
+cc = meson.get_compiler('c')
# Fuzzing only works on linux at this moment. osx clang doesn't have leak detector
is_darwin = host_machine.system().startswith('darwin')
-if (cxx.get_id() == 'clang') and get_option('fuzz').allowed() and not is_darwin
+if (cc.get_id() == 'clang') and get_option('fuzz').allowed() and not is_darwin
sanitize = ['fuzzer']
fuzz_args = [
'-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION',
@@ -63,7 +39,6 @@
[fuzzer_test + '.c'] + libcper_parse_sources + edk_sources + 'test-utils.c' + libcper_generate_sources,
implicit_include_directories: false,
include_directories: include_directories(test_include_dirs),
- cpp_args: fuzz_args,
c_args: fuzz_args,
link_args: fuzz_args,
dependencies: [json_c_dep, jsonc_daccord],