mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 02:15:06 +03:00
new file: projects/cmocka.org/package.yml
new file: projects/cmocka.org/test.c
This commit is contained in:
parent
9af795a591
commit
44dbadc38c
2 changed files with 56 additions and 0 deletions
41
projects/cmocka.org/package.yml
Normal file
41
projects/cmocka.org/package.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
distributable:
|
||||
url: https://cmocka.org/files/{{version.marketing}}/cmocka-{{version}}.tar.xz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
gitlab: cmocka/cmocka/tags
|
||||
strip:
|
||||
- /^cmocka-/
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
cmake.org: '*'
|
||||
|
||||
working-directory: build
|
||||
script:
|
||||
- cmake .. $ARGS
|
||||
- make --jobs {{ hw.concurrency }}
|
||||
- make --jobs {{ hw.concurrency }} install
|
||||
|
||||
env:
|
||||
ARGS:
|
||||
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
- -Wno-dev
|
||||
- -DBUILD_TESTING=OFF
|
||||
- -DWITH_STATIC_LIB=ON
|
||||
- -DWITH_CMOCKERY_SUPPORT=ON
|
||||
- -DUNIT_TESTING=ON
|
||||
- -DCMAKE_C_COMPILER={{deps.tea.xyz/gx/cc.prefix}}/bin/cc
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
freedesktop.org/pkg-config: '*'
|
||||
tea.xyz/gx/cc: c99
|
||||
script:
|
||||
- pkg-config --modversion cmocka | grep {{version}}
|
||||
- cc test.c -lcmocka -o test
|
||||
- ./test
|
15
projects/cmocka.org/test.c
Normal file
15
projects/cmocka.org/test.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <setjmp.h>
|
||||
#include <cmocka.h>
|
||||
|
||||
static void null_test_success(void **state) {
|
||||
(void) state; /* unused */
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test(null_test_success),
|
||||
};
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
Loading…
Reference in a new issue