From 787e0ad868a38d6d355dc7a6ddb07c5d3f5a94eb Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sun, 25 Dec 2022 13:04:30 +0400 Subject: [PATCH] Remove fixtures --- .cirrus.yml | 2 +- .github/workflows/main.yml | 2 +- .gitignore | 2 - .openbsd.yml | 2 +- Makefile.am | 4 -- README.md | 3 +- configure.ac | 8 --- fixtures/.gitignore | 8 --- fixtures/Makefile.am | 61 ---------------- fixtures/multiboot2_bin_examples_gen.c.in | 84 ----------------------- 10 files changed, 4 insertions(+), 172 deletions(-) delete mode 100644 fixtures/.gitignore delete mode 100644 fixtures/Makefile.am delete mode 100644 fixtures/multiboot2_bin_examples_gen.c.in diff --git a/.cirrus.yml b/.cirrus.yml index 0a1199c..9ef966f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,7 +12,7 @@ main_freebsd_task: - pip install --user Jinja2 PyYAML main_build_script: - ./autogen.sh - - ./configure --enable-fixtures --enable-checks-all CFLAGS='-O3' + - ./configure --enable-checks-all CFLAGS='-O3' - make - sudo make install main_test_script: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a21c54..9aa66f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: - name: autogen run: ./autogen.sh - 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 run: make - name: check diff --git a/.gitignore b/.gitignore index 0eef5a1..0576ee3 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,6 @@ /Makefile.in /examples/Makefile.in -/fixtures/Makefile.in /include/Makefile.in /libc/Makefile.in /libc/include/Makefile.in @@ -76,7 +75,6 @@ /Makefile /examples/Makefile -/fixtures/Makefile /include/Makefile /libc/Makefile /libc/include/Makefile diff --git a/.openbsd.yml b/.openbsd.yml index 593ce5f..e263cd6 100644 --- a/.openbsd.yml +++ b/.openbsd.yml @@ -31,7 +31,7 @@ tasks: - build: | cd libkernaux ./autogen.sh - ./configure --enable-fixtures --enable-checks-all CFLAGS='-O3' + ./configure --enable-checks-all CFLAGS='-O3' make doas make install - test: | diff --git a/Makefile.am b/Makefile.am index 203bdba..e29cecc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,10 +13,6 @@ endif SUBDIRS += . -if ENABLE_FIXTURES -SUBDIRS += fixtures -endif - if ENABLE_CHECKS SUBDIRS += examples tests endif diff --git a/README.md b/README.md index 1ca6878..2212113 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,6 @@ stable options. * `--enable-checks-pthreads` - enable tests that require pthreads * `--enable-checks-python` - enable tests that require Python 3 with YAML and Jinja2 -* `--enable-fixtures` - enable fixtures for tests and bindings * `--enable-pkg-config[=PATH]` - install pkg-config files [PATH='${libdir}/pkgconfig'] @@ -195,7 +194,7 @@ environment. ``` ./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 ``` diff --git a/configure.ac b/configure.ac index 00709d9..259445f 100644 --- a/configure.ac +++ b/configure.ac @@ -27,8 +27,6 @@ AC_CONFIG_FILES([ Makefile libkernaux.pc examples/Makefile - fixtures/Makefile - fixtures/multiboot2_bin_examples_gen.c include/Makefile libc/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])) 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([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])) @@ -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]) 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_checks" = yes], [enable_checks=yes], [enable_checks=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_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_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_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]) dnl Features (disabled by default) -AM_CONDITIONAL([ENABLE_FIXTURES], [test "$enable_fixtures" = yes]) AM_CONDITIONAL([ENABLE_FREESTANDING], [test "$enable_freestanding" = yes]) AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = 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])]) 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_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])]) diff --git a/fixtures/.gitignore b/fixtures/.gitignore deleted file mode 100644 index 248bdd9..0000000 --- a/fixtures/.gitignore +++ /dev/null @@ -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 diff --git a/fixtures/Makefile.am b/fixtures/Makefile.am deleted file mode 100644 index 060b2b2..0000000 --- a/fixtures/Makefile.am +++ /dev/null @@ -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 diff --git a/fixtures/multiboot2_bin_examples_gen.c.in b/fixtures/multiboot2_bin_examples_gen.c.in deleted file mode 100644 index 5f7feab..0000000 --- a/fixtures/multiboot2_bin_examples_gen.c.in +++ /dev/null @@ -1,84 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#include -#include -#include -#include - -#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); -}