summaryrefslogtreecommitdiffstats
path: root/contrib/meson/tests
diff options
context:
space:
mode:
authorLzu Tao <taolzu@gmail.com>2018-12-01 05:15:53 (GMT)
committerLzu Tao <taolzu@gmail.com>2018-12-02 03:00:27 (GMT)
commit5bc119455fde697f132adbd7fd50f095954f703b (patch)
treed4b4bcffae99a9f793c735f9e59c8a452806c95b /contrib/meson/tests
parent6689dae33ba1eb588abe3d3cb763bc5dc08878b3 (diff)
downloadlz4-5bc119455fde697f132adbd7fd50f095954f703b.zip
lz4-5bc119455fde697f132adbd7fd50f095954f703b.tar.gz
lz4-5bc119455fde697f132adbd7fd50f095954f703b.tar.bz2
Add meson build system
Diffstat (limited to 'contrib/meson/tests')
-rw-r--r--contrib/meson/tests/meson.build81
1 files changed, 81 insertions, 0 deletions
diff --git a/contrib/meson/tests/meson.build b/contrib/meson/tests/meson.build
new file mode 100644
index 0000000..82e2813
--- /dev/null
+++ b/contrib/meson/tests/meson.build
@@ -0,0 +1,81 @@
+# #############################################################################
+# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
+# All rights reserved.
+#
+# This source code is licensed under both the BSD-style license (found in the
+# LICENSE file in the root directory of this source tree) and the GPLv2 (found
+# in the COPYING file in the root directory of this source tree).
+# #############################################################################
+
+lz4_root_dir = '../../..'
+programs_dir_inc = include_directories(join_paths(lz4_root_dir, 'programs'))
+lib_dir_inc = include_directories(join_paths(lz4_root_dir, 'lib'))
+
+# =============================================================================
+# Test flags
+# =============================================================================
+
+TEST_FILES = join_paths(lz4_root_dir, 'tests/COPYING')
+FUZZER_TIME = '-T90s'
+NB_LOOPS = '-i1'
+
+# =============================================================================
+# Executables
+# =============================================================================
+
+fullbench_sources = [join_paths(lz4_root_dir, 'tests/fullbench.c')]
+fullbench = executable('fullbench',
+ fullbench_sources,
+ include_directories: programs_dir_inc,
+ dependencies: liblz4_dep,
+ install: false)
+
+fuzzer_sources = [join_paths(lz4_root_dir, 'tests/fuzzer.c')]
+fuzzer = executable('fuzzer',
+ fuzzer_sources,
+ c_args: ['-D_DEFAULT_SOURCE', '-D_BSD_SOURCE'], # since glibc 2.19
+ include_directories: programs_dir_inc,
+ dependencies: liblz4_dep,
+ install: false)
+
+frametest_sources = [join_paths(lz4_root_dir, 'tests/frametest.c')]
+frametest = executable('frametest',
+ frametest_sources,
+ include_directories: programs_dir_inc,
+ dependencies: liblz4_dep,
+ install: false)
+
+roundTripTest_sources = [join_paths(lz4_root_dir, 'tests/roundTripTest.c')]
+roundTripTest = executable('roundTripTest',
+ roundTripTest_sources,
+ dependencies: [ liblz4_dep ],
+ install: false)
+
+datagen_sources = [join_paths(lz4_root_dir, 'tests/datagencli.c')]
+datagen = executable('datagen',
+ datagen_sources,
+ objects: lz4.extract_objects(join_paths(lz4_root_dir, 'programs/datagen.c')),
+ include_directories: lz4_includes,
+ dependencies: [ liblz4_dep ],
+ install: false)
+
+checkFrame_sources = [join_paths(lz4_root_dir, 'tests/checkFrame.c')]
+checkFrame = executable('checkFrame',
+ checkFrame_sources,
+ include_directories: programs_dir_inc,
+ dependencies: [ liblz4_dep ],
+ install: false)
+
+checkTag_sources = [join_paths(lz4_root_dir, 'tests/checkTag.c')]
+checkTag = executable('checkTag',
+ checkTag_sources,
+ include_directories: lib_dir_inc,
+ install: false)
+
+# =============================================================================
+# Tests (Use "meson test --list" to list all tests)
+# =============================================================================
+
+test('test-fullbench', fullbench, args: ['--no-prompt', NB_LOOPS, TEST_FILES])
+test('test-fuzzer', fuzzer, args: [FUZZER_TIME])
+test('test-frametest', frametest, args: [FUZZER_TIME])