mirror of
https://github.com/tailix/libkernaux.git
synced 2025-06-30 18:42:46 -04:00
Add fixtures (#150)
This commit is contained in:
parent
22ec69dfca
commit
79c8bcad6a
32 changed files with 217 additions and 54 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
/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
|
||||||
|
@ -77,6 +78,7 @@
|
||||||
|
|
||||||
/Makefile
|
/Makefile
|
||||||
/examples/Makefile
|
/examples/Makefile
|
||||||
|
/fixtures/Makefile
|
||||||
/include/Makefile
|
/include/Makefile
|
||||||
/libc/Makefile
|
/libc/Makefile
|
||||||
/libc/include/Makefile
|
/libc/include/Makefile
|
||||||
|
@ -84,6 +86,15 @@
|
||||||
|
|
||||||
/include/kernaux/version.h
|
/include/kernaux/version.h
|
||||||
|
|
||||||
|
/fixtures/multiboot2_bin_examples_gen
|
||||||
|
/fixtures/multiboot2_bin_examples_gen.c
|
||||||
|
/fixtures/multiboot2_header_example0.bin
|
||||||
|
/fixtures/multiboot2_header_example1.bin
|
||||||
|
/fixtures/multiboot2_header_example2.bin
|
||||||
|
/fixtures/multiboot2_info_example0.bin
|
||||||
|
/fixtures/multiboot2_info_example1.bin
|
||||||
|
/fixtures/multiboot2_info_example2.bin
|
||||||
|
|
||||||
/examples/assert
|
/examples/assert
|
||||||
/examples/cmdline
|
/examples/cmdline
|
||||||
/examples/generic_display
|
/examples/generic_display
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
2022-12-17 Alex Kotov <kotovalexarian@gmail.com>
|
2022-12-17 Alex Kotov <kotovalexarian@gmail.com>
|
||||||
|
|
||||||
|
* configure.ac: Feature "--(enable|disable)-fixtures" has been added
|
||||||
* src/multiboot2/*_print.c: Print some values in hex
|
* src/multiboot2/*_print.c: Print some values in hex
|
||||||
|
|
||||||
2022-12-16 Alex Kotov <kotovalexarian@gmail.com>
|
2022-12-16 Alex Kotov <kotovalexarian@gmail.com>
|
||||||
|
|
||||||
* configure.ac: Feature "--with[out]-multiboot2" has been added
|
* configure.ac: Package "--with[out]-multiboot2" has been added
|
||||||
* include/kernaux/multiboot2.h: Has been made stable
|
* include/kernaux/multiboot2.h: Has been made stable
|
||||||
|
|
||||||
2022-12-14 Alex Kotov <kotovalexarian@gmail.com>
|
2022-12-14 Alex Kotov <kotovalexarian@gmail.com>
|
||||||
|
|
|
@ -13,6 +13,10 @@ endif
|
||||||
|
|
||||||
SUBDIRS += .
|
SUBDIRS += .
|
||||||
|
|
||||||
|
if ENABLE_FIXTURES
|
||||||
|
SUBDIRS += fixtures
|
||||||
|
endif
|
||||||
|
|
||||||
if ENABLE_CHECKS
|
if ENABLE_CHECKS
|
||||||
SUBDIRS += examples tests
|
SUBDIRS += examples tests
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -142,6 +142,7 @@ 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
|
||||||
|
|
||||||
#### Packages
|
#### Packages
|
||||||
|
|
||||||
|
@ -195,7 +196,7 @@ environment.
|
||||||
|
|
||||||
```
|
```
|
||||||
./autogen.sh # if present
|
./autogen.sh # if present
|
||||||
./configure --enable-checks # or --enable-checks-all, but see prerequisites
|
./configure --enable-fixtures --enable-checks # or --enable-checks-all, but see prerequisites
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ if KernAux::Version.with_cmdline?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assert 'usign common tests' do
|
assert 'usign fixtures' do
|
||||||
cmdline_yml = File.expand_path('../../../../common/cmdline.yml', __FILE__)
|
cmdline_yml = File.expand_path('../../../../fixtures/cmdline.yml', __FILE__)
|
||||||
|
|
||||||
YAML.load(File.read(cmdline_yml)).each do |test|
|
YAML.load(File.read(cmdline_yml)).each do |test|
|
||||||
escape_str = lambda do |str|
|
escape_str = lambda do |str|
|
||||||
|
|
|
@ -65,12 +65,12 @@ if KernAux::Version.with_printf?
|
||||||
end
|
end
|
||||||
|
|
||||||
[
|
[
|
||||||
['', 'using regular tests'],
|
['', 'using regular fixtures'],
|
||||||
['_orig', 'using original tests'],
|
['_orig', 'using original fixtures'],
|
||||||
].each do |(suffix, description)|
|
].each do |(suffix, description)|
|
||||||
assert description do
|
assert description do
|
||||||
printf_yml =
|
printf_yml =
|
||||||
File.expand_path("../../../../common/printf#{suffix}.yml", __FILE__)
|
File.expand_path("../../../../fixtures/printf#{suffix}.yml", __FILE__)
|
||||||
|
|
||||||
YAML.load(File.read(printf_yml)).each do |test|
|
YAML.load(File.read(printf_yml)).each do |test|
|
||||||
expected = test['result']
|
expected = test['result']
|
||||||
|
|
|
@ -91,8 +91,9 @@ KernAux::Version.with_cmdline? and RSpec.describe KernAux, '.cmdline' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'using common tests' do
|
context 'using fixtures' do
|
||||||
cmdline_yml = File.expand_path('../../../../../common/cmdline.yml', __dir__)
|
cmdline_yml =
|
||||||
|
File.expand_path('../../../../../fixtures/cmdline.yml', __dir__)
|
||||||
|
|
||||||
YAML.safe_load_file(cmdline_yml).each do |test|
|
YAML.safe_load_file(cmdline_yml).each do |test|
|
||||||
escape_str = lambda do |str|
|
escape_str = lambda do |str|
|
||||||
|
|
|
@ -39,12 +39,12 @@ KernAux::Version.with_printf? and RSpec.describe KernAux, '.sprintf' do
|
||||||
end
|
end
|
||||||
|
|
||||||
[
|
[
|
||||||
['', 'using regular tests'],
|
['', 'using regular fixtures'],
|
||||||
['_orig', 'using original tests'],
|
['_orig', 'using original fixtures'],
|
||||||
].each do |(suffix, description)|
|
].each do |(suffix, description)|
|
||||||
context description do
|
context description do
|
||||||
printf_yml = File.expand_path(
|
printf_yml = File.expand_path(
|
||||||
"../../../../../common/printf#{suffix}.yml",
|
"../../../../../fixtures/printf#{suffix}.yml",
|
||||||
__dir__,
|
__dir__,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ AC_CONFIG_SRCDIR([src/assert.c])
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
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
|
||||||
|
@ -49,6 +51,7 @@ 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([split-libc], AS_HELP_STRING([--enable-split-libc], [split off libc]))
|
AC_ARG_ENABLE([split-libc], AS_HELP_STRING([--enable-split-libc], [split off libc]))
|
||||||
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]))
|
||||||
|
@ -134,6 +137,7 @@ 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_split_libc" = yes], [enable_split_libc=yes], [enable_split_libc=no])
|
AS_IF([test "$enable_split_libc" = yes], [enable_split_libc=yes], [enable_split_libc=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])
|
||||||
|
@ -171,7 +175,9 @@ 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']))
|
||||||
|
@ -197,6 +203,7 @@ 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_SPLIT_LIBC], [test "$enable_split_libc" = yes])
|
AM_CONDITIONAL([ENABLE_SPLIT_LIBC], [test "$enable_split_libc" = yes])
|
||||||
AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
|
AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes])
|
||||||
|
@ -249,6 +256,7 @@ AS_IF([test "$enable_werror" = yes], [AC_DEFINE([ENABLE_WERROR],
|
||||||
|
|
||||||
dnl Features (disabled by default)
|
dnl Features (disabled by default)
|
||||||
AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC], [1], [split off libc])])
|
AS_IF([test "$enable_split_libc" = yes], [AC_DEFINE([ENABLE_SPLIT_LIBC], [1], [split off libc])])
|
||||||
|
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])])
|
||||||
|
|
53
fixtures/Makefile.am
Normal file
53
fixtures/Makefile.am
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
include $(top_srcdir)/make/shared.am
|
||||||
|
|
||||||
|
noinst_PROGRAMS =
|
||||||
|
nodist_noinst_DATA =
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# 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_examples_gen: multiboot2_bin
|
||||||
|
./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
|
84
fixtures/multiboot2_bin_examples_gen.c.in
Normal file
84
fixtures/multiboot2_bin_examples_gen.c.in
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <kernaux/assert.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);
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ multiboot2_header_print0_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_header_print0_SOURCES = \
|
multiboot2_header_print0_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_header_print0.c \
|
multiboot2_header_print0.c \
|
||||||
multiboot2_header_example0.h
|
../fixtures/multiboot2_header_example0.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
############################
|
############################
|
||||||
|
@ -27,7 +27,7 @@ multiboot2_header_print1_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_header_print1_SOURCES = \
|
multiboot2_header_print1_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_header_print1.c \
|
multiboot2_header_print1.c \
|
||||||
multiboot2_header_example1.h
|
../fixtures/multiboot2_header_example1.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
############################
|
############################
|
||||||
|
@ -40,7 +40,7 @@ multiboot2_header_print2_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_header_print2_SOURCES = \
|
multiboot2_header_print2_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_header_print2.c \
|
multiboot2_header_print2.c \
|
||||||
multiboot2_header_example2.h
|
../fixtures/multiboot2_header_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
@ -53,7 +53,7 @@ multiboot2_info_print0_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_info_print0_SOURCES = \
|
multiboot2_info_print0_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_info_print0.c \
|
multiboot2_info_print0.c \
|
||||||
multiboot2_info_example0.h
|
../fixtures/multiboot2_info_example0.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
@ -66,7 +66,7 @@ multiboot2_info_print1_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_info_print1_SOURCES = \
|
multiboot2_info_print1_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_info_print1.c \
|
multiboot2_info_print1.c \
|
||||||
multiboot2_info_example1.h
|
../fixtures/multiboot2_info_example1.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
@ -79,7 +79,7 @@ multiboot2_info_print2_LDADD = $(top_builddir)/libkernaux.la
|
||||||
multiboot2_info_print2_SOURCES = \
|
multiboot2_info_print2_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
multiboot2_info_print2.c \
|
multiboot2_info_print2.c \
|
||||||
multiboot2_info_example2.h
|
../fixtures/multiboot2_info_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################
|
##################
|
||||||
|
@ -121,7 +121,7 @@ test_cmdline_gen_SOURCES = \
|
||||||
test_cmdline_gen.c \
|
test_cmdline_gen.c \
|
||||||
cmdline_gen.py \
|
cmdline_gen.py \
|
||||||
cmdline_gen.jinja \
|
cmdline_gen.jinja \
|
||||||
$(top_srcdir)/common/cmdline.yml \
|
$(top_srcdir)/fixtures/cmdline.yml \
|
||||||
cmdline_test.h \
|
cmdline_test.h \
|
||||||
cmdline_test.c
|
cmdline_test.c
|
||||||
endif
|
endif
|
||||||
|
@ -129,8 +129,8 @@ endif
|
||||||
|
|
||||||
CLEANFILES += test_cmdline_gen.c
|
CLEANFILES += test_cmdline_gen.c
|
||||||
|
|
||||||
test_cmdline_gen.c: $(top_srcdir)/tests/cmdline_gen.py $(top_srcdir)/tests/cmdline_gen.jinja $(top_srcdir)/common/cmdline.yml
|
test_cmdline_gen.c: $(top_srcdir)/tests/cmdline_gen.py $(top_srcdir)/tests/cmdline_gen.jinja $(top_srcdir)/fixtures/cmdline.yml
|
||||||
$(PYTHON) $(top_srcdir)/tests/cmdline_gen.py $(top_srcdir)/tests/cmdline_gen.jinja $(top_srcdir)/common/cmdline.yml test_cmdline_gen.c
|
$(PYTHON) $(top_srcdir)/tests/cmdline_gen.py $(top_srcdir)/tests/cmdline_gen.jinja $(top_srcdir)/fixtures/cmdline.yml test_cmdline_gen.c
|
||||||
|
|
||||||
############
|
############
|
||||||
# test_elf #
|
# test_elf #
|
||||||
|
@ -190,8 +190,8 @@ test_multiboot2_common_packing_LDADD = $(top_builddir)/libkernaux.la
|
||||||
test_multiboot2_common_packing_SOURCES = \
|
test_multiboot2_common_packing_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
test_multiboot2_common_packing.c \
|
test_multiboot2_common_packing.c \
|
||||||
multiboot2_header_example2.h \
|
../fixtures/multiboot2_header_example2.h \
|
||||||
multiboot2_info_example2.h
|
../fixtures/multiboot2_info_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
|
@ -204,8 +204,8 @@ test_multiboot2_header_helpers_LDADD = $(top_builddir)/libkernaux.la
|
||||||
test_multiboot2_header_helpers_SOURCES = \
|
test_multiboot2_header_helpers_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
test_multiboot2_header_helpers.c \
|
test_multiboot2_header_helpers.c \
|
||||||
multiboot2_header_example1.h \
|
../fixtures/multiboot2_header_example1.h \
|
||||||
multiboot2_header_example2.h
|
../fixtures/multiboot2_header_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
@ -234,8 +234,8 @@ test_multiboot2_header_validation_LDADD = $(top_builddir)/libkernaux.la
|
||||||
test_multiboot2_header_validation_SOURCES = \
|
test_multiboot2_header_validation_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
test_multiboot2_header_validation.c \
|
test_multiboot2_header_validation.c \
|
||||||
multiboot2_header_example1.h \
|
../fixtures/multiboot2_header_example1.h \
|
||||||
multiboot2_header_example2.h
|
../fixtures/multiboot2_header_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
@ -248,8 +248,8 @@ test_multiboot2_info_helpers_LDADD = $(top_builddir)/libkernaux.la
|
||||||
test_multiboot2_info_helpers_SOURCES = \
|
test_multiboot2_info_helpers_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
test_multiboot2_info_helpers.c \
|
test_multiboot2_info_helpers.c \
|
||||||
multiboot2_info_example1.h \
|
../fixtures/multiboot2_info_example1.h \
|
||||||
multiboot2_info_example2.h
|
../fixtures/multiboot2_info_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
|
@ -278,8 +278,8 @@ test_multiboot2_info_validation_LDADD = $(top_builddir)/libkernaux.la
|
||||||
test_multiboot2_info_validation_SOURCES = \
|
test_multiboot2_info_validation_SOURCES = \
|
||||||
main.c \
|
main.c \
|
||||||
test_multiboot2_info_validation.c \
|
test_multiboot2_info_validation.c \
|
||||||
multiboot2_info_example1.h \
|
../fixtures/multiboot2_info_example1.h \
|
||||||
multiboot2_info_example2.h
|
../fixtures/multiboot2_info_example2.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#############
|
#############
|
||||||
|
@ -359,14 +359,14 @@ test_printf_fmt_gen_SOURCES = \
|
||||||
test_printf_fmt_gen.c \
|
test_printf_fmt_gen.c \
|
||||||
printf_fmt_gen.py \
|
printf_fmt_gen.py \
|
||||||
printf_fmt_gen.jinja \
|
printf_fmt_gen.jinja \
|
||||||
$(top_srcdir)/common/printf_fmt.yml
|
$(top_srcdir)/fixtures/printf_fmt.yml
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CLEANFILES += test_printf_fmt_gen.c
|
CLEANFILES += test_printf_fmt_gen.c
|
||||||
|
|
||||||
test_printf_fmt_gen.c: $(top_srcdir)/tests/printf_fmt_gen.py $(top_srcdir)/tests/printf_fmt_gen.jinja $(top_srcdir)/common/printf_fmt.yml
|
test_printf_fmt_gen.c: $(top_srcdir)/tests/printf_fmt_gen.py $(top_srcdir)/tests/printf_fmt_gen.jinja $(top_srcdir)/fixtures/printf_fmt.yml
|
||||||
$(PYTHON) $(top_srcdir)/tests/printf_fmt_gen.py $(top_srcdir)/tests/printf_fmt_gen.jinja $(top_srcdir)/common/printf_fmt.yml test_printf_fmt_gen.c
|
$(PYTHON) $(top_srcdir)/tests/printf_fmt_gen.py $(top_srcdir)/tests/printf_fmt_gen.jinja $(top_srcdir)/fixtures/printf_fmt.yml test_printf_fmt_gen.c
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# test_printf_gen #
|
# test_printf_gen #
|
||||||
|
@ -381,15 +381,15 @@ test_printf_gen_SOURCES = \
|
||||||
test_printf_gen.c \
|
test_printf_gen.c \
|
||||||
printf_gen.py \
|
printf_gen.py \
|
||||||
printf_gen.jinja \
|
printf_gen.jinja \
|
||||||
$(top_srcdir)/common/printf.yml \
|
$(top_srcdir)/fixtures/printf.yml \
|
||||||
$(top_srcdir)/common/printf_orig.yml
|
$(top_srcdir)/fixtures/printf_orig.yml
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CLEANFILES += test_printf_gen.c
|
CLEANFILES += test_printf_gen.c
|
||||||
|
|
||||||
test_printf_gen.c: $(top_srcdir)/tests/printf_gen.py $(top_srcdir)/tests/printf_gen.jinja $(top_srcdir)/common/printf.yml $(top_srcdir)/common/printf_orig.yml
|
test_printf_gen.c: $(top_srcdir)/tests/printf_gen.py $(top_srcdir)/tests/printf_gen.jinja $(top_srcdir)/fixtures/printf.yml $(top_srcdir)/fixtures/printf_orig.yml
|
||||||
$(PYTHON) $(top_srcdir)/tests/printf_gen.py $(top_srcdir)/tests/printf_gen.jinja $(top_srcdir)/common/printf.yml $(top_srcdir)/common/printf_orig.yml test_printf_gen.c
|
$(PYTHON) $(top_srcdir)/tests/printf_gen.py $(top_srcdir)/tests/printf_gen.jinja $(top_srcdir)/fixtures/printf.yml $(top_srcdir)/fixtures/printf_orig.yml test_printf_gen.c
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# test_units_human #
|
# test_units_human #
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_header_example0.h"
|
#include "../fixtures/multiboot2_header_example0.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_header_example1.h"
|
#include "../fixtures/multiboot2_header_example1.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_header_example2.h"
|
#include "../fixtures/multiboot2_header_example2.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_info_example0.h"
|
#include "../fixtures/multiboot2_info_example0.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_info_example1.h"
|
#include "../fixtures/multiboot2_info_example1.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "multiboot2_info_example2.h"
|
#include "../fixtures/multiboot2_info_example2.h"
|
||||||
|
|
||||||
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
static void my_putc(void *display KERNAUX_UNUSED, char c)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "multiboot2_header_example2.h"
|
#include "../fixtures/multiboot2_header_example2.h"
|
||||||
#include "multiboot2_info_example2.h"
|
#include "../fixtures/multiboot2_info_example2.h"
|
||||||
|
|
||||||
#define HEAD_SIZEOF1(type, inst, size) \
|
#define HEAD_SIZEOF1(type, inst, size) \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#include <kernaux/multiboot2.h>
|
#include <kernaux/multiboot2.h>
|
||||||
|
|
||||||
#include "multiboot2_header_example1.h"
|
#include "../fixtures/multiboot2_header_example1.h"
|
||||||
#include "multiboot2_header_example2.h"
|
#include "../fixtures/multiboot2_header_example2.h"
|
||||||
|
|
||||||
void test_main()
|
void test_main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "multiboot2_info_example1.h"
|
#include "../fixtures/multiboot2_info_example1.h"
|
||||||
#include "multiboot2_info_example2.h"
|
#include "../fixtures/multiboot2_info_example2.h"
|
||||||
|
|
||||||
#include <kernaux/macro/packing_start.run>
|
#include <kernaux/macro/packing_start.run>
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "multiboot2_info_example1.h"
|
#include "../fixtures/multiboot2_info_example1.h"
|
||||||
#include "multiboot2_info_example2.h"
|
#include "../fixtures/multiboot2_info_example2.h"
|
||||||
|
|
||||||
#include <kernaux/macro/packing_start.run>
|
#include <kernaux/macro/packing_start.run>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue