D subprojects/varchunk/.build.yml => subprojects/varchunk/.build.yml +0 -17
@@ 1,17 0,0 @@
-# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
-# SPDX-License-Identifier: CC0-1.0
-
-image: alpine/latest
-packages:
- - reuse
- - meson
-tasks:
- - setup: |
- cd varchunk
- meson setup build
- - build: |
- cd varchunk
- ninja -C build
- - test: |
- cd varchunk
- ninja -C build test
A subprojects/varchunk/.builds/alpine-latest.yml => subprojects/varchunk/.builds/alpine-latest.yml +65 -0
@@ 0,0 1,65 @@
+# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
+# SPDX-License-Identifier: CC0-1.0
+
+---
+
+image: alpine/latest
+
+packages:
+ - clang15-analyzer
+ - llvm15
+ - reuse
+ - meson
+ - git-subtree
+ - hut
+ - jq
+ - valgrind
+
+environment:
+ project: varchunk
+
+secrets:
+ - 0545580c-42ac-4700-b322-4e9df924eb07
+ - 5fe806cd-3af4-4588-9898-8115d9262144
+
+sources:
+ - https://git.open-music-kontrollers.ch/~hp/ci
+
+tasks:
+ - gcc: |
+ . ~/ci/activate
+
+ ci-meson gcc setup
+ ci-meson gcc build
+ ci-meson gcc test
+ ci-meson gcc memcheck
+
+ - clang: |
+ . ~/ci/activate
+
+ ci-meson clang setup
+ ci-meson clang build
+ ci-meson clang test
+ ci-meson clang memcheck
+
+ - analyzer: |
+ . ~/ci/activate
+
+ ci-meson analyzer setup
+ ci-meson analyzer build
+ ci-meson analyzer test
+
+ - deploy: |
+ . ~/ci/activate
+
+ if ! ci-isrelease; then
+ complete-build
+ fi
+
+ ci-subtreemerge
+
+triggers:
+ - action: email
+ condition: failure
+ to: "<dev@open-music-kontrollers.ch>"
+...
M subprojects/varchunk/meson.build => subprojects/varchunk/meson.build +36 -34
@@ 8,50 8,52 @@ project('varchunk', 'c', default_options : [
'b_lto=true',
'c_std=c11'])
+build_tests = get_option('build-tests')
+
reuse = find_program('reuse', required : false)
add_project_arguments('-D_GNU_SOURCE', language : 'c')
cc = meson.get_compiler('c')
+rt_dep = cc.find_library('rt')
-thread_dep = dependency('threads')
-
-lib_deps = []
-
-lib_incs = []
-lib_incs += include_directories('')
+lib_deps = [
+ rt_dep
+]
-lib_srcs = []
-lib_srcs += join_paths('src', 'varchunk.c')
-
-if host_machine.system() == 'linux'
- rt_dep = cc.find_library('rt')
- lib_deps += rt_dep
-endif
+lib_srcs = [
+ join_paths('src', 'varchunk.c')
+]
varchunk = declare_dependency(
- include_directories : lib_incs,
dependencies : lib_deps,
sources : lib_srcs)
-test_deps = []
-test_deps += varchunk
-test_deps += thread_dep
-
-test_srcs = []
-test_srcs += join_paths('test', 'test.c')
-
-test_varchunk = executable('Test', test_srcs,
- dependencies : test_deps,
- install : false)
-
-test('Test', test_varchunk,
- args : ['100000'],
- timeout : 360) # seconds
-
-if reuse.found()
- test('REUSE', reuse, args : [
- '--root', meson.current_source_dir(),
- 'lint'
- ])
+if build_tests
+ thread_dep = dependency('threads')
+
+ test_deps = [
+ varchunk,
+ thread_dep
+ ]
+
+ test_srcs = [
+ join_paths('test', 'test.c')
+ ]
+
+ test_varchunk = executable('Test', test_srcs,
+ dependencies : test_deps,
+ install : false)
+
+ test('Test', test_varchunk,
+ args : ['100000'],
+ timeout : 360, # seconds
+ suite: ['memcheck'])
+
+ if reuse.found()
+ test('REUSE', reuse, args : [
+ '--root', meson.current_source_dir(),
+ 'lint'
+ ])
+ endif
endif
M subprojects/varchunk/meson_options.txt => subprojects/varchunk/meson_options.txt +5 -1
@@ 1,4 1,8 @@
# SPDX-FileCopyrightText: Hanspeter Portner <dev@open-music-kontrollers.ch>
# SPDX-License-Identifier: CC0-1.0
-option('version', type : 'string', value : '0.1.135')
+option('build-tests',
+ type : 'boolean',
+ value : true)
+
+option('version', type : 'string', value : '0.2.0')
M subprojects/varchunk/test/test.c => subprojects/varchunk/test/test.c +3 -3
@@ 47,7 47,7 @@ producer_main(void *arg)
}
#endif
- written = PAD(rand() * 1024.f / RAND_MAX);
+ written = PAD(rand() * 1024 / RAND_MAX);
size_t maximum;
if( (ptr = varchunk_write_request_max(varchunk, written, &maximum)) )
@@ 109,7 109,7 @@ consumer_main(void *arg)
}
static void
-test_threaded()
+test_threaded(void)
{
pthread_t producer;
pthread_t consumer;
@@ 189,7 189,7 @@ varchunk_shm_deinit(varchunk_shm_t *varchunk_shm)
}
static void
-test_shared()
+test_shared(void)
{
const char *name = "/varchunk_shm_test";
pid_t pid = fork();