1
0
Fork 0
mirror of https://github.com/tailix/libclayer.git synced 2024-11-20 11:06:24 -05:00

Remove fixtures

This commit is contained in:
Alex Kotov 2022-12-25 13:04:30 +04:00
parent 3102a9b57b
commit 787e0ad868
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
10 changed files with 4 additions and 172 deletions

View file

@ -12,7 +12,7 @@ main_freebsd_task:
- pip install --user Jinja2 PyYAML - pip install --user Jinja2 PyYAML
main_build_script: main_build_script:
- ./autogen.sh - ./autogen.sh
- ./configure --enable-fixtures --enable-checks-all CFLAGS='-O3' - ./configure --enable-checks-all CFLAGS='-O3'
- make - make
- sudo make install - sudo make install
main_test_script: main_test_script:

View file

@ -34,7 +34,7 @@ jobs:
- name: autogen - name: autogen
run: ./autogen.sh run: ./autogen.sh
- name: configure - name: configure
run: ./configure ${{matrix.assert}} --enable-fixtures --enable-checks --enable-checks-pthreads --enable-checks-python CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}' run: ./configure ${{matrix.assert}} --enable-checks --enable-checks-pthreads --enable-checks-python CC='${{matrix.cc}}' CFLAGS='${{matrix.opt}}'
- name: make - name: make
run: make run: make
- name: check - name: check

2
.gitignore vendored
View file

@ -43,7 +43,6 @@
/Makefile.in /Makefile.in
/examples/Makefile.in /examples/Makefile.in
/fixtures/Makefile.in
/include/Makefile.in /include/Makefile.in
/libc/Makefile.in /libc/Makefile.in
/libc/include/Makefile.in /libc/include/Makefile.in
@ -76,7 +75,6 @@
/Makefile /Makefile
/examples/Makefile /examples/Makefile
/fixtures/Makefile
/include/Makefile /include/Makefile
/libc/Makefile /libc/Makefile
/libc/include/Makefile /libc/include/Makefile

View file

@ -31,7 +31,7 @@ tasks:
- build: | - build: |
cd libkernaux cd libkernaux
./autogen.sh ./autogen.sh
./configure --enable-fixtures --enable-checks-all CFLAGS='-O3' ./configure --enable-checks-all CFLAGS='-O3'
make make
doas make install doas make install
- test: | - test: |

View file

@ -13,10 +13,6 @@ endif
SUBDIRS += . SUBDIRS += .
if ENABLE_FIXTURES
SUBDIRS += fixtures
endif
if ENABLE_CHECKS if ENABLE_CHECKS
SUBDIRS += examples tests SUBDIRS += examples tests
endif endif

View file

@ -139,7 +139,6 @@ stable options.
* `--enable-checks-pthreads` - enable tests that require pthreads * `--enable-checks-pthreads` - enable tests that require pthreads
* `--enable-checks-python` - enable tests that require Python 3 with YAML and * `--enable-checks-python` - enable tests that require Python 3 with YAML and
Jinja2 Jinja2
* `--enable-fixtures` - enable fixtures for tests and bindings
* `--enable-pkg-config[=PATH]` - install pkg-config files * `--enable-pkg-config[=PATH]` - install pkg-config files
[PATH='${libdir}/pkgconfig'] [PATH='${libdir}/pkgconfig']
@ -195,7 +194,7 @@ environment.
``` ```
./autogen.sh # if present ./autogen.sh # if present
./configure --enable-fixtures --enable-checks # or --enable-checks-all, but see prerequisites ./configure --enable-checks # or --enable-checks-all, but see prerequisites
make make
``` ```

View file

@ -27,8 +27,6 @@ AC_CONFIG_FILES([
Makefile Makefile
libkernaux.pc libkernaux.pc
examples/Makefile examples/Makefile
fixtures/Makefile
fixtures/multiboot2_bin_examples_gen.c
include/Makefile include/Makefile
libc/Makefile libc/Makefile
libc/include/Makefile libc/include/Makefile
@ -55,7 +53,6 @@ AC_ARG_ENABLE([float], AS_HELP_STRING([--disable-float], [dis
AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror])) AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror]))
dnl Features (disabled by default) dnl Features (disabled by default)
AC_ARG_ENABLE([fixtures], AS_HELP_STRING([--enable-fixtures], [enable fixtures for tests and bindings]))
AC_ARG_ENABLE([freestanding], AS_HELP_STRING([--enable-freestanding], [build for freestanding environment])) AC_ARG_ENABLE([freestanding], AS_HELP_STRING([--enable-freestanding], [build for freestanding environment]))
AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable usual tests and examples])) AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable usual tests and examples]))
AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [enable all checks])) AC_ARG_ENABLE([checks-all], AS_HELP_STRING([--enable-checks-all], [enable all checks]))
@ -144,7 +141,6 @@ AS_IF([test "$enable_float" = no ], [enable_float=no], [ena
AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_werror=yes]) AS_IF([test "$enable_werror" = no ], [enable_werror=no], [enable_werror=yes])
dnl Features (disabled by default) dnl Features (disabled by default)
AS_IF([test "$enable_fixtures" = yes], [enable_fixtures=yes], [enable_fixtures=no])
AS_IF([test "$enable_freestanding" = yes], [enable_freestanding=yes], [enable_freestanding=no]) AS_IF([test "$enable_freestanding" = yes], [enable_freestanding=yes], [enable_freestanding=no])
AS_IF([test "$enable_checks" = yes], [enable_checks=yes], [enable_checks=no]) AS_IF([test "$enable_checks" = yes], [enable_checks=yes], [enable_checks=no])
AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [enable_checks_all=no]) AS_IF([test "$enable_checks_all" = yes], [enable_checks_all=yes], [enable_checks_all=no])
@ -186,9 +182,7 @@ AS_IF([test "$with_libc" = yes], [with_libc=yes], [wit
############# #############
AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests])) AS_IF([test "$enable_checks" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding tests]))
AS_IF([test "$enable_fixtures" = yes -a "$enable_freestanding" = yes], AC_MSG_ERROR([can not build freestanding fixtures]))
AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests])) AS_IF([test "$enable_checks" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with tests]))
AS_IF([test "$enable_fixtures" = yes -a "$with_libc" = yes], AC_MSG_ERROR([can not use package `libc' with fixtures]))
AS_IF([test "$with_printf" = yes -a "$with_ntoa" = no], AC_MSG_ERROR([package `printf' requires package `ntoa'])) AS_IF([test "$with_printf" = yes -a "$with_ntoa" = no], AC_MSG_ERROR([package `printf' requires package `ntoa']))
AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt'])) AS_IF([test "$with_printf" = yes -a "$with_printf_fmt" = no], AC_MSG_ERROR([package `printf' requires package `printf-fmt']))
@ -214,7 +208,6 @@ AM_CONDITIONAL([ENABLE_FLOAT], [test "$enable_float" = yes])
AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes]) AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes])
dnl Features (disabled by default) dnl Features (disabled by default)
AM_CONDITIONAL([ENABLE_FIXTURES], [test "$enable_fixtures" = yes])
AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes]) AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes])
AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes]) AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes]) AM_CONDITIONAL([ENABLE_CHECKS_CPPCHECK], [test "$enable_checks_cppcheck" = yes])
@ -269,7 +262,6 @@ AS_IF([test "$enable_float" = yes], [AC_DEFINE([ENABLE_FLOAT],
AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1], [enabled -Werror])]) AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR], [1], [enabled -Werror])])
dnl Features (disabled by default) dnl Features (disabled by default)
AS_IF([test "$enable_fixtures" = yes], [AC_DEFINE([ENABLE_FIXTURES], [1], [enabled fixtures for tests and bindings])])
AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])]) AS_IF([test "$enable_freestanding" = yes], [AC_DEFINE([ENABLE_FREESTANDING], [1], [build for freestanding environment])])
AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS], [1], [enabled usual tests and examples])]) AS_IF([test "$enable_checks" = yes], [AC_DEFINE([ENABLE_CHECKS], [1], [enabled usual tests and examples])])
AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])]) AS_IF([test "$enable_checks_cppcheck" = yes], [AC_DEFINE([ENABLE_CHECKS_CPPCHECK], [1], [enabled cppcheck])])

8
fixtures/.gitignore vendored
View file

@ -1,8 +0,0 @@
/multiboot2_bin_examples_gen
/multiboot2_bin_examples_gen.c
/multiboot2_header_example0.bin
/multiboot2_header_example1.bin
/multiboot2_header_example2.bin
/multiboot2_info_example0.bin
/multiboot2_info_example1.bin
/multiboot2_info_example2.bin

View file

@ -1,61 +0,0 @@
include $(top_srcdir)/make/shared.am
noinst_PROGRAMS =
nodist_noinst_DATA =
EXTRA_DIST = \
multiboot2_header_example0.txt \
multiboot2_header_example1.txt \
multiboot2_header_example2.txt \
multiboot2_info_example0.txt \
multiboot2_info_example1.txt \
multiboot2_info_example2.txt
#########################################
# multiboot2_(header|info)_example*.bin #
#########################################
if WITH_MULTIBOOT2
nodist_noinst_DATA += \
multiboot2_header_example0.bin \
multiboot2_header_example1.bin \
multiboot2_header_example2.bin \
multiboot2_info_example0.bin \
multiboot2_info_example1.bin \
multiboot2_info_example2.bin
endif
multiboot2_header_example0.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen header 0
multiboot2_header_example1.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen header 1
multiboot2_header_example2.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen header 2
multiboot2_info_example0.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen info 0
multiboot2_info_example1.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen info 1
multiboot2_info_example2.bin: multiboot2_bin_examples_gen
./multiboot2_bin_examples_gen info 2
###############################
# multiboot2_bin_examples_gen #
###############################
if WITH_MULTIBOOT2
noinst_PROGRAMS += multiboot2_bin_examples_gen
multiboot2_bin_examples_gen_LDADD = $(top_builddir)/libkernaux.la
nodist_multiboot2_bin_examples_gen_SOURCES = multiboot2_bin_examples_gen.c
multiboot2_bin_examples_gen_SOURCES = \
multiboot2_header_example0.h \
multiboot2_header_example1.h \
multiboot2_header_example2.h \
multiboot2_info_example0.h \
multiboot2_info_example1.h \
multiboot2_info_example2.h
endif

View file

@ -1,84 +0,0 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <kernaux/runtime.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "multiboot2_header_example0.h"
#include "multiboot2_header_example1.h"
#include "multiboot2_header_example2.h"
#include "multiboot2_info_example0.h"
#include "multiboot2_info_example1.h"
#include "multiboot2_info_example2.h"
static void assert_cb(
const char *const file,
const int line,
const char *const msg
) {
fprintf(stderr, "%s:%d:%s\n", file, line, msg);
abort();
}
#define EXAMPLE(type, number) do { \
static const char *const filename = \
"@abs_top_builddir@/fixtures/multiboot2_"#type"_example"#number".bin"; \
FILE *const file = fopen(filename, "w"); \
assert(file); \
assert( \
fwrite( \
&multiboot2_##type##_example##number, \
1, \
sizeof(multiboot2_##type##_example##number), \
file \
) == sizeof(multiboot2_##type##_example##number) \
); \
assert(fclose(file) == 0); \
} while (0)
int main(const int argc, const char *const *const argv)
{
kernaux_assert_cb = assert_cb;
assert(argc == 3);
const char *const type = argv[1];
const char *const number = argv[2];
if (strcmp(type, "header") == 0) {
if (strcmp(number, "0") == 0) {
EXAMPLE(header, 0);
}
else if (strcmp(number, "1") == 0) {
EXAMPLE(header, 1);
}
else if (strcmp(number, "2") == 0) {
EXAMPLE(header, 2);
}
else {
abort();
}
} else if (strcmp(type, "info") == 0) {
if (strcmp(number, "0") == 0) {
EXAMPLE(info, 0);
}
else if (strcmp(number, "1") == 0) {
EXAMPLE(info, 1);
}
else if (strcmp(number, "2") == 0) {
EXAMPLE(info, 2);
}
else {
abort();
}
} else {
abort();
}
exit(EXIT_SUCCESS);
}