diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:13 +0300 |
commit | 736dcd8ca259457a136f2f9f9168c44643914323 (patch) | |
tree | ddd46a036d68bfa83aa11b892f31243ea6b068a1 /library/cpp/testing | |
parent | 9bf2fa2b060c9881d3135c2208c624a1dd546ecc (diff) | |
download | ydb-736dcd8ca259457a136f2f9f9168c44643914323.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing')
24 files changed, 45 insertions, 45 deletions
diff --git a/library/cpp/testing/README.md b/library/cpp/testing/README.md index e8e0391be4..8980ccfd0a 100644 --- a/library/cpp/testing/README.md +++ b/library/cpp/testing/README.md @@ -12,5 +12,5 @@ * `gtest_protobuf` — утилиты для работы с протобуфом в тестах. * `hook` — хуки для выполнения пользовательских функций в тестах и бенчмарках. * `mock_server` — реализация http-сервера для тестов. -* `unittest` — реализация модуля UNITTEST — основного средства для тестирования тестов на С++ в Аркадии. -* `unittest_main` — реализация `int main(argc, argv)` для модуля UNITTEST (она вынесена в отдельную библиотеку, чтобы оставить возможность для реализации `UNITTEST_WITH_CUSTOM_ENTRY_POINT` и `YT_UNITTEST`. +* `unittest` — реализация модуля UNITTEST — основного средства для тестирования тестов на С++ в Аркадии. +* `unittest_main` — реализация `int main(argc, argv)` для модуля UNITTEST (она вынесена в отдельную библиотеку, чтобы оставить возможность для реализации `UNITTEST_WITH_CUSTOM_ENTRY_POINT` и `YT_UNITTEST`. diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp index 08d8708005..f8cb2c01f9 100644 --- a/library/cpp/testing/benchmark/bench.cpp +++ b/library/cpp/testing/benchmark/bench.cpp @@ -3,10 +3,10 @@ #include <contrib/libs/re2/re2/re2.h> #include <library/cpp/colorizer/output.h> -#include <library/cpp/getopt/small/last_getopt.h> +#include <library/cpp/getopt/small/last_getopt.h> #include <library/cpp/json/json_value.h> #include <library/cpp/linear_regression/linear_regression.h> -#include <library/cpp/threading/poor_man_openmp/thread_helper.h> +#include <library/cpp/threading/poor_man_openmp/thread_helper.h> #include <util/system/hp_timer.h> #include <util/system/info.h> @@ -22,7 +22,7 @@ #include <util/generic/maybe.h> #include <util/generic/strbuf.h> #include <util/generic/intrlist.h> -#include <util/stream/format.h> +#include <util/stream/format.h> #include <util/system/yield.h> using re2::RE2; @@ -128,11 +128,11 @@ namespace { } TString hr; - if (t > 10 * 1000) { - hr = " (" + ToString(HumanReadableSize(t, ESizeFormat::SF_QUANTITY)) + ")"; - } - - return ToString(t) + hr + " cycles"; + if (t > 10 * 1000) { + hr = " (" + ToString(HumanReadableSize(t, ESizeFormat::SF_QUANTITY)) + ")"; + } + + return ToString(t) + hr + " cycles"; } const ui64 N = GetCycleCount(); @@ -312,7 +312,7 @@ namespace { class TCSVReporter: public IReporter { public: TCSVReporter() { - Cout << "Name\tSamples\tIterations\tRun_time\tPer_iteration_sec\tPer_iteration_cycles" << Endl; + Cout << "Name\tSamples\tIterations\tRun_time\tPer_iteration_sec\tPer_iteration_cycles" << Endl; } ~TCSVReporter() override { @@ -469,7 +469,7 @@ void Out<TResult>(IOutputStream& out, const TResult& r) { out << "----------- " << LightRed() << r.TestName << Old() << " ---------------" << Endl << " samples: " << White() << r.Samples << Old() << Endl << " iterations: " << White() << r.Iterations << Old() << Endl - << " iterations hr: " << White() << HumanReadableSize(r.Iterations, SF_QUANTITY) << Old() << Endl + << " iterations hr: " << White() << HumanReadableSize(r.Iterations, SF_QUANTITY) << Old() << Endl << " run time: " << White() << r.RunTime << Old() << Endl; if (r.CyclesPerIteration) { diff --git a/library/cpp/testing/benchmark/examples/main.cpp b/library/cpp/testing/benchmark/examples/main.cpp index ddd8b05ffc..03cb856b85 100644 --- a/library/cpp/testing/benchmark/examples/main.cpp +++ b/library/cpp/testing/benchmark/examples/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/benchmark/bench.h> +#include <library/cpp/testing/benchmark/bench.h> #include <util/generic/xrange.h> #include <util/generic/algorithm.h> diff --git a/library/cpp/testing/benchmark/examples/metrics/main.py b/library/cpp/testing/benchmark/examples/metrics/main.py index 8f9d9d06ae..11ab1c2cd1 100644 --- a/library/cpp/testing/benchmark/examples/metrics/main.py +++ b/library/cpp/testing/benchmark/examples/metrics/main.py @@ -3,5 +3,5 @@ import yatest.common as yc def test_export_metrics(metrics): metrics.set_benchmark(yc.execute_benchmark( - 'library/cpp/testing/benchmark/examples/examples', + 'library/cpp/testing/benchmark/examples/examples', threads=8)) diff --git a/library/cpp/testing/benchmark/examples/metrics/ya.make b/library/cpp/testing/benchmark/examples/metrics/ya.make index a9dbdca9fa..d6767e9c33 100644 --- a/library/cpp/testing/benchmark/examples/metrics/ya.make +++ b/library/cpp/testing/benchmark/examples/metrics/ya.make @@ -15,6 +15,6 @@ TAG( TEST_SRCS(main.py) -DEPENDS(library/cpp/testing/benchmark/examples) +DEPENDS(library/cpp/testing/benchmark/examples) END() diff --git a/library/cpp/testing/benchmark/main/main.cpp b/library/cpp/testing/benchmark/main/main.cpp index aabcb89c43..264a1de8e5 100644 --- a/library/cpp/testing/benchmark/main/main.cpp +++ b/library/cpp/testing/benchmark/main/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/benchmark/bench.h> +#include <library/cpp/testing/benchmark/bench.h> #include <util/generic/yexception.h> #include <util/stream/output.h> diff --git a/library/cpp/testing/benchmark/main/ya.make b/library/cpp/testing/benchmark/main/ya.make index d00cdcf9fc..8ae7e336bd 100644 --- a/library/cpp/testing/benchmark/main/ya.make +++ b/library/cpp/testing/benchmark/main/ya.make @@ -10,7 +10,7 @@ SRCS( ) PEERDIR( - library/cpp/testing/benchmark + library/cpp/testing/benchmark ) END() diff --git a/library/cpp/testing/benchmark/ya.make b/library/cpp/testing/benchmark/ya.make index f42be80698..1a2d32c4cd 100644 --- a/library/cpp/testing/benchmark/ya.make +++ b/library/cpp/testing/benchmark/ya.make @@ -13,10 +13,10 @@ SRCS( PEERDIR( contrib/libs/re2 library/cpp/colorizer - library/cpp/getopt/small + library/cpp/getopt/small library/cpp/json library/cpp/linear_regression - library/cpp/threading/poor_man_openmp + library/cpp/threading/poor_man_openmp ) END() diff --git a/library/cpp/testing/gmock_in_unittest/events.cpp b/library/cpp/testing/gmock_in_unittest/events.cpp index dbd65b727d..058d4c9087 100644 --- a/library/cpp/testing/gmock_in_unittest/events.cpp +++ b/library/cpp/testing/gmock_in_unittest/events.cpp @@ -1,6 +1,6 @@ #include "events.h" -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> #include <util/generic/strbuf.h> #include <util/generic/string.h> diff --git a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp index 97f19050e4..9cdebaf928 100644 --- a/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp +++ b/library/cpp/testing/gmock_in_unittest/example_ut/example_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/gmock_in_unittest/gmock.h> -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> #include <util/generic/string.h> diff --git a/library/cpp/testing/gmock_in_unittest/registration.cpp b/library/cpp/testing/gmock_in_unittest/registration.cpp index c2872a4c27..b2c9ee7812 100644 --- a/library/cpp/testing/gmock_in_unittest/registration.cpp +++ b/library/cpp/testing/gmock_in_unittest/registration.cpp @@ -2,7 +2,7 @@ #include <gmock/gmock.h> -#include <library/cpp/testing/unittest/plugin.h> +#include <library/cpp/testing/unittest/plugin.h> namespace { class TGMockUnittestPlugin: public NUnitTest::NPlugin::IPlugin { diff --git a/library/cpp/testing/gmock_in_unittest/ya.make b/library/cpp/testing/gmock_in_unittest/ya.make index 5de68ad98d..e7fb9fc7df 100644 --- a/library/cpp/testing/gmock_in_unittest/ya.make +++ b/library/cpp/testing/gmock_in_unittest/ya.make @@ -6,7 +6,7 @@ PEERDIR( contrib/restricted/googletest/googlemock contrib/restricted/googletest/googletest library/cpp/testing/gtest_extensions - library/cpp/testing/unittest + library/cpp/testing/unittest ) SRCS( diff --git a/library/cpp/testing/unittest/example_ut.cpp b/library/cpp/testing/unittest/example_ut.cpp index bcc1ce33f0..7dd238e1a0 100644 --- a/library/cpp/testing/unittest/example_ut.cpp +++ b/library/cpp/testing/unittest/example_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> /* * just copy-paste it for good start point diff --git a/library/cpp/testing/unittest/fat/test_port_manager.cpp b/library/cpp/testing/unittest/fat/test_port_manager.cpp index f77d2e3a25..b8fa5ab39d 100644 --- a/library/cpp/testing/unittest/fat/test_port_manager.cpp +++ b/library/cpp/testing/unittest/fat/test_port_manager.cpp @@ -1,5 +1,5 @@ -#include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/testing/unittest/tests_data.h> +#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/tests_data.h> bool IsFreePort(ui16 port) { TInet6StreamSocket sock; diff --git a/library/cpp/testing/unittest/registar.cpp b/library/cpp/testing/unittest/registar.cpp index 3679b768ed..3bd65ef2e1 100644 --- a/library/cpp/testing/unittest/registar.cpp +++ b/library/cpp/testing/unittest/registar.cpp @@ -1,6 +1,6 @@ #include "registar.h" -#include <library/cpp/diff/diff.h> +#include <library/cpp/diff/diff.h> #include <library/cpp/colorizer/colors.h> #include <util/generic/bt_exception.h> diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 44517a0092..6bcaf3c909 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -46,7 +46,7 @@ namespace NUnitTest { TString GetResetTag(); // Raise error handler - // Used for testing library/cpp/testing/unittest macroses + // Used for testing library/cpp/testing/unittest macroses // and unittest helpers. // For all other unittests standard handler is used using TRaiseErrorHandler = std::function<void(const char*, const TString&, bool)>; diff --git a/library/cpp/testing/unittest/registar_ut.cpp b/library/cpp/testing/unittest/registar_ut.cpp index 1f36d53abb..7d42768383 100644 --- a/library/cpp/testing/unittest/registar_ut.cpp +++ b/library/cpp/testing/unittest/registar_ut.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> Y_UNIT_TEST_SUITE(TUnitTestMacroTest) { Y_UNIT_TEST(Assert) { diff --git a/library/cpp/testing/unittest/ut/main.cpp b/library/cpp/testing/unittest/ut/main.cpp index e303e21e30..02d979560d 100644 --- a/library/cpp/testing/unittest/ut/main.cpp +++ b/library/cpp/testing/unittest/ut/main.cpp @@ -1,6 +1,6 @@ -#include <library/cpp/testing/unittest/gtest.h> -#include <library/cpp/testing/unittest/registar.h> -#include <library/cpp/testing/unittest/tests_data.h> +#include <library/cpp/testing/unittest/gtest.h> +#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/tests_data.h> #include <util/generic/set.h> #include <util/network/sock.h> diff --git a/library/cpp/testing/unittest/ut/ya.make b/library/cpp/testing/unittest/ut/ya.make index 6d4c0959cc..318d3e5980 100644 --- a/library/cpp/testing/unittest/ut/ya.make +++ b/library/cpp/testing/unittest/ut/ya.make @@ -1,4 +1,4 @@ -UNITTEST_FOR(library/cpp/testing/unittest) +UNITTEST_FOR(library/cpp/testing/unittest) OWNER(snowball) diff --git a/library/cpp/testing/unittest/utmain.cpp b/library/cpp/testing/unittest/utmain.cpp index 305bc6b40f..fcc2bd2632 100644 --- a/library/cpp/testing/unittest/utmain.cpp +++ b/library/cpp/testing/unittest/utmain.cpp @@ -612,7 +612,7 @@ static int DoUsage(const char* progname) { << "Options:\n" << " -h, --help print this help message\n" << " -l, --list print a list of available tests\n" - << " -A --list-verbose print a list of available subtests\n" + << " -A --list-verbose print a list of available subtests\n" << " --print-before-test print each test name before running it\n" << " --print-before-suite print each test suite name before running it\n" << " --show-fails print a list of all failed tests at the end\n" @@ -683,7 +683,7 @@ int NUnitTest::RunMain(int argc, char** argv) { return DoUsage(argv[0]); } else if (strcmp(name, "--list") == 0 || strcmp(name, "-l") == 0) { listTests = LIST; - } else if (strcmp(name, "--list-verbose") == 0 || strcmp(name, "-A") == 0) { + } else if (strcmp(name, "--list-verbose") == 0 || strcmp(name, "-A") == 0) { listTests = LIST_VERBOSE; } else if (strcmp(name, "--print-before-suite=false") == 0) { processor.SetPrintBeforeSuite(false); diff --git a/library/cpp/testing/unittest/ya.make b/library/cpp/testing/unittest/ya.make index aaa4f2ba85..d247605826 100644 --- a/library/cpp/testing/unittest/ya.make +++ b/library/cpp/testing/unittest/ya.make @@ -10,7 +10,7 @@ OWNER( PEERDIR( library/cpp/colorizer library/cpp/dbg_output - library/cpp/diff + library/cpp/diff library/cpp/json/writer library/cpp/testing/common library/cpp/testing/hook diff --git a/library/cpp/testing/unittest_main/main.cpp b/library/cpp/testing/unittest_main/main.cpp index fc5d2d9418..984203e304 100644 --- a/library/cpp/testing/unittest_main/main.cpp +++ b/library/cpp/testing/unittest_main/main.cpp @@ -1,4 +1,4 @@ -#include <library/cpp/testing/unittest/utmain.h> +#include <library/cpp/testing/unittest/utmain.h> int main(int argc, char** argv) { return NUnitTest::RunMain(argc, argv); diff --git a/library/cpp/testing/unittest_main/ya.make b/library/cpp/testing/unittest_main/ya.make index 80a6cc699b..eb6df9dbaa 100644 --- a/library/cpp/testing/unittest_main/ya.make +++ b/library/cpp/testing/unittest_main/ya.make @@ -3,8 +3,8 @@ LIBRARY() OWNER(pg) PEERDIR( - library/cpp/testing/unittest - library/cpp/terminate_handler + library/cpp/testing/unittest + library/cpp/terminate_handler ) SRCS( diff --git a/library/cpp/testing/ya.make b/library/cpp/testing/ya.make index 6a57ac2ee6..96426b026a 100644 --- a/library/cpp/testing/ya.make +++ b/library/cpp/testing/ya.make @@ -1,9 +1,9 @@ RECURSE( common - benchmark - benchmark/examples - benchmark/examples/metrics - benchmark/main + benchmark + benchmark/examples + benchmark/examples/metrics + benchmark/main boost_test boost_test_main dump_clang_coverage @@ -18,7 +18,7 @@ RECURSE( gtest_protobuf hook mock_server - unittest - unittest_main + unittest + unittest_main urlnorm ) |