test_includes = [ include_directories(join_paths(zstd_rootdir, 'programs')) ]
-datagen_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
- join_paths(zstd_rootdir, 'tests/datagencli.c')]
+testcommon_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
+ join_paths(zstd_rootdir, 'programs/util.c'),
+ join_paths(zstd_rootdir, 'programs/timefn.c'),
+ join_paths(zstd_rootdir, 'programs/benchfn.c'),
+ join_paths(zstd_rootdir, 'programs/benchzstd.c')]
+testcommon = static_library('testcommon',
+ testcommon_sources)
+
+datagen_sources = [join_paths(zstd_rootdir, 'tests/datagencli.c')]
datagen = executable('datagen',
datagen_sources,
c_args: [ '-DNDEBUG' ],
include_directories: test_includes,
dependencies: libzstd_dep,
+ link_with: testcommon,
install: false)
-fullbench_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
- join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'programs/benchfn.c'),
- join_paths(zstd_rootdir, 'programs/benchzstd.c'),
- join_paths(zstd_rootdir, 'tests/fullbench.c')]
+fullbench_sources = [join_paths(zstd_rootdir, 'tests/fullbench.c')]
fullbench = executable('fullbench',
fullbench_sources,
include_directories: test_includes,
dependencies: libzstd_dep,
+ link_with: testcommon,
install: false)
-fuzzer_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
- join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'tests/fuzzer.c')]
+fuzzer_sources = [join_paths(zstd_rootdir, 'tests/fuzzer.c')]
fuzzer = executable('fuzzer',
fuzzer_sources,
include_directories: test_includes,
dependencies: [ libzstd_dep, thread_dep ],
+ link_with: testcommon,
install: false)
-zstreamtest_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
- join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'tests/seqgen.c'),
+zstreamtest_sources = [join_paths(zstd_rootdir, 'tests/seqgen.c'),
join_paths(zstd_rootdir, 'tests/zstreamtest.c')]
zstreamtest = executable('zstreamtest',
zstreamtest_sources,
include_directories: test_includes,
dependencies: libzstd_dep,
+ link_with: testcommon,
install: false)
-paramgrill_sources = [join_paths(zstd_rootdir, 'programs/benchfn.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'programs/benchzstd.c'),
- join_paths(zstd_rootdir, 'programs/datagen.c'),
- join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'tests/paramgrill.c')]
+paramgrill_sources = [join_paths(zstd_rootdir, 'tests/paramgrill.c')]
paramgrill = executable('paramgrill',
paramgrill_sources,
include_directories: test_includes,
dependencies: [ libzstd_dep, libm_dep ],
+ link_with: testcommon,
install: false)
roundTripCrash_sources = [join_paths(zstd_rootdir, 'tests/roundTripCrash.c')]
install: false)
endif
-decodecorpus_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'tests/decodecorpus.c')]
+decodecorpus_sources = [join_paths(zstd_rootdir, 'tests/decodecorpus.c')]
decodecorpus = executable('decodecorpus',
decodecorpus_sources,
include_directories: test_includes,
dependencies: [ libzstd_dep, libm_dep ],
+ link_with: testcommon,
install: false)
-poolTests_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
- join_paths(zstd_rootdir, 'programs/timefn.c'),
- join_paths(zstd_rootdir, 'tests/poolTests.c'),
+poolTests_sources = [join_paths(zstd_rootdir, 'tests/poolTests.c'),
join_paths(zstd_rootdir, 'lib/common/pool.c'),
join_paths(zstd_rootdir, 'lib/common/threading.c'),
join_paths(zstd_rootdir, 'lib/common/zstd_common.c'),
poolTests_sources,
include_directories: test_includes,
dependencies: [ libzstd_dep, thread_dep ],
+ link_with: testcommon,
install: false)
checkTag_sources = [join_paths(zstd_rootdir, 'tests/checkTag.c')]