mirror of
https://github.com/tailix/libkernaux.git
synced 2025-03-24 17:16:12 -04:00
Common: move files with tests for printf
This commit is contained in:
parent
725e381a9e
commit
62abac62e0
5 changed files with 10 additions and 7 deletions
|
@ -272,12 +272,12 @@ tests_test_printf_gen_SOURCES = \
|
|||
tests/test_printf_gen.c \
|
||||
tests/printf_gen.py \
|
||||
tests/printf_gen.jinja \
|
||||
tests/printf.yml \
|
||||
tests/printf_orig.yml
|
||||
common/printf.yml \
|
||||
common/printf_orig.yml
|
||||
|
||||
tests_test_units_human_SOURCES = \
|
||||
$(libkernaux_a_SOURCES) \
|
||||
tests/test_units_human.c
|
||||
|
||||
tests/test_printf_gen.c: tests/printf_gen.py tests/printf_gen.jinja tests/printf.yml tests/printf_orig.yml
|
||||
tests/test_printf_gen.c: tests/printf_gen.py tests/printf_gen.jinja common/printf.yml common/printf_orig.yml
|
||||
python3 tests/printf_gen.py
|
||||
|
|
|
@ -22,7 +22,7 @@ RSpec.describe KernAux, '.sprintf' do
|
|||
].each do |(suffix, description)|
|
||||
context description do
|
||||
printf_yml =
|
||||
File.expand_path("../../../../../tests/printf#{suffix}.yml", __dir__)
|
||||
File.expand_path("../../../../../common/printf#{suffix}.yml", __dir__)
|
||||
|
||||
YAML.safe_load_file(printf_yml).each do |test|
|
||||
expected = test['result']
|
||||
|
|
|
@ -7,10 +7,13 @@ CASES_REG_FILENAME = 'printf.yml'
|
|||
TEMPLATE_FILENAME = 'printf_gen.jinja'
|
||||
TEST_FILENAME = 'test_printf_gen.c'
|
||||
|
||||
TESTS_DIRPATH = path.dirname(path.abspath(__file__))
|
||||
ROOT_DIRPATH = path.dirname(path.dirname(path.join(path.abspath(__file__))))
|
||||
|
||||
CASES_ORIG_FILEPATH = path.join(TESTS_DIRPATH, CASES_ORIG_FILENAME)
|
||||
CASES_REG_FILEPATH = path.join(TESTS_DIRPATH, CASES_REG_FILENAME)
|
||||
COMMON_DIRPATH = path.join(ROOT_DIRPATH, 'common')
|
||||
TESTS_DIRPATH = path.join(ROOT_DIRPATH, 'tests')
|
||||
|
||||
CASES_ORIG_FILEPATH = path.join(COMMON_DIRPATH, CASES_ORIG_FILENAME)
|
||||
CASES_REG_FILEPATH = path.join(COMMON_DIRPATH, CASES_REG_FILENAME)
|
||||
TEST_FILEPATH = path.join(TESTS_DIRPATH, TEST_FILENAME)
|
||||
|
||||
def main():
|
||||
|
|
Loading…
Add table
Reference in a new issue