diff --git a/Makefile.am b/Makefile.am index f5a00fd..25d517a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/tests/printf.yml b/common/printf.yml similarity index 100% rename from tests/printf.yml rename to common/printf.yml diff --git a/tests/printf_orig.yml b/common/printf_orig.yml similarity index 100% rename from tests/printf_orig.yml rename to common/printf_orig.yml diff --git a/pkgs/ruby/spec/lib/kernaux/sprintf_spec.rb b/pkgs/ruby/spec/lib/kernaux/sprintf_spec.rb index 6609100..34b9927 100644 --- a/pkgs/ruby/spec/lib/kernaux/sprintf_spec.rb +++ b/pkgs/ruby/spec/lib/kernaux/sprintf_spec.rb @@ -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'] diff --git a/tests/printf_gen.py b/tests/printf_gen.py index 7c8943f..343e792 100644 --- a/tests/printf_gen.py +++ b/tests/printf_gen.py @@ -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():