From fc137a26a0db8dc4cad807c7109f9a1f395b4ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 11 Aug 2020 12:47:09 +0200 Subject: [PATCH] Add Fedora CI tests --- tests/samples/fstrm-sample-program.c | 31 ++++++++++++++++++++++++++++ tests/tests.yml | 15 ++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/samples/fstrm-sample-program.c create mode 100644 tests/tests.yml diff --git a/tests/samples/fstrm-sample-program.c b/tests/samples/fstrm-sample-program.c new file mode 100644 index 0000000..c11e333 --- /dev/null +++ b/tests/samples/fstrm-sample-program.c @@ -0,0 +1,31 @@ +#include +#include +#include + +int +main(void) +{ + const char *file_path = "/tmp/output.fs"; + struct fstrm_file_options *fopt; + struct fstrm_iothr *iothr; + struct fstrm_writer *writer; + + fopt = fstrm_file_options_init(); + fstrm_file_options_set_file_path(fopt, file_path); + writer = fstrm_file_writer_init(fopt, NULL); + if (!writer) { + fprintf(stderr, "Error: fstrm_file_writer_init() failed.\n"); + exit(EXIT_FAILURE); + } + + iothr = fstrm_iothr_init(NULL, &writer); + if (!iothr) { + fprintf(stderr, "Error: fstrm_iothr_init() failed.\n"); + exit(EXIT_FAILURE); + } + + fstrm_iothr_destroy(&iothr); + fstrm_file_options_destroy(&fopt); + + return 0; +} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..e395693 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,15 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - fstrm-devel + - gcc + tests: + - pkg-config: + dir: . + run: pkg-config --modversion libfstrm + - build-sample-program: + dir: samples + run: gcc -Wall -Wextra $(pkg-config --cflags --libs libfstrm) -o /dev/null fstrm-sample-program.c