diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /util/tests | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'util/tests')
-rw-r--r-- | util/tests/benchmark/ya.make | 11 | ||||
-rw-r--r-- | util/tests/cython/test_digest.py | 12 | ||||
-rw-r--r-- | util/tests/cython/test_folder.py | 12 | ||||
-rw-r--r-- | util/tests/cython/test_generic.py | 29 | ||||
-rw-r--r-- | util/tests/cython/test_memory.py | 12 | ||||
-rw-r--r-- | util/tests/cython/test_stream.py | 12 | ||||
-rw-r--r-- | util/tests/cython/test_system.py | 12 | ||||
-rw-r--r-- | util/tests/cython/ya.make | 39 | ||||
-rw-r--r-- | util/tests/fuzzing/ya.make | 7 | ||||
-rw-r--r-- | util/tests/style/ya.make | 7 | ||||
-rw-r--r-- | util/tests/sym_versions/test_glibc.py | 29 | ||||
-rw-r--r-- | util/tests/sym_versions/ya.make | 42 | ||||
-rw-r--r-- | util/tests/ut/ya.make | 26 | ||||
-rw-r--r-- | util/tests/ya.make | 13 | ||||
-rw-r--r-- | util/tests/ya_util_tests.inc | 4 |
15 files changed, 267 insertions, 0 deletions
diff --git a/util/tests/benchmark/ya.make b/util/tests/benchmark/ya.make new file mode 100644 index 0000000000..134cbfabd1 --- /dev/null +++ b/util/tests/benchmark/ya.make @@ -0,0 +1,11 @@ +OWNER(g:util) +SUBSCRIBER(g:util-subscribers) + +RECURSE_ROOT_RELATIVE( + util/charset/benchmark + util/generic/benchmark + util/random/benchmark + util/memory/benchmark + util/string/benchmark + util/system/benchmark +) diff --git a/util/tests/cython/test_digest.py b/util/tests/cython/test_digest.py new file mode 100644 index 0000000000..89c95df720 --- /dev/null +++ b/util/tests/cython/test_digest.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.digest.multi_ut import TestMultiHash + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestMultiHash', +] diff --git a/util/tests/cython/test_folder.py b/util/tests/cython/test_folder.py new file mode 100644 index 0000000000..ca176ab2a5 --- /dev/null +++ b/util/tests/cython/test_folder.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.folder.path_ut import TestPath + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestPath', +] diff --git a/util/tests/cython/test_generic.py b/util/tests/cython/test_generic.py new file mode 100644 index 0000000000..a0d61339cc --- /dev/null +++ b/util/tests/cython/test_generic.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.generic.deque_ut import TestDeque +from util.generic.hash_ut import TestHash +from util.generic.hash_set_ut import TestHashSet +from util.generic.list_ut import TestList +from util.generic.maybe_ut import TestMaybe +from util.generic.ptr_ut import TestHolder +from util.generic.string_ut import TestStroka +from util.generic.vector_ut import TestVector +from util.string.cast_ut import TestFromString, TestToString + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestDeque', + 'TestHash', + 'TestHashSet', + 'TestHolder', + 'TestList', + 'TestMaybe', + 'TestStroka', + 'TestVector', + 'TestFromString', + 'TestToString', +] diff --git a/util/tests/cython/test_memory.py b/util/tests/cython/test_memory.py new file mode 100644 index 0000000000..705f384726 --- /dev/null +++ b/util/tests/cython/test_memory.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.memory.blob_ut import TestBlob + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestBlob', +] diff --git a/util/tests/cython/test_stream.py b/util/tests/cython/test_stream.py new file mode 100644 index 0000000000..6abfe1de0d --- /dev/null +++ b/util/tests/cython/test_stream.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.stream.str_ut import TestStringOutput + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestStringOutput', +] diff --git a/util/tests/cython/test_system.py b/util/tests/cython/test_system.py new file mode 100644 index 0000000000..923fb442e5 --- /dev/null +++ b/util/tests/cython/test_system.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function, absolute_import, division + +from util.system.types_ut import TestTypes + +# Test discovery does not work in cython modules. +# Reexporting test classes here to satisfy pylint and pytest. + +__all__ = [ + 'TestTypes', +] diff --git a/util/tests/cython/ya.make b/util/tests/cython/ya.make new file mode 100644 index 0000000000..b928c19026 --- /dev/null +++ b/util/tests/cython/ya.make @@ -0,0 +1,39 @@ +PY23_TEST() + +OWNER(g:util) +SUBSCRIBER(g:util-subscribers) + +SRCDIR(util) + +NO_WSHADOW() + +PY_SRCS( + NAMESPACE + util + folder/path_ut.pyx + generic/array_ref_ut.pyx + generic/deque_ut.pyx + generic/maybe_ut.pyx + generic/ptr_ut.pyx + generic/string_ut.pyx + generic/vector_ut.pyx + generic/list_ut.pyx + generic/hash_set_ut.pyx + generic/hash_ut.pyx + memory/blob_ut.pyx + stream/str_ut.pyx + string/cast_ut.pyx + system/types_ut.pyx + digest/multi_ut.pyx +) + +TEST_SRCS( + test_digest.py + test_folder.py + test_generic.py + test_memory.py + test_stream.py + test_system.py +) + +END() diff --git a/util/tests/fuzzing/ya.make b/util/tests/fuzzing/ya.make new file mode 100644 index 0000000000..d9a8f9df9f --- /dev/null +++ b/util/tests/fuzzing/ya.make @@ -0,0 +1,7 @@ +OWNER(g:util) +SUBSCRIBER(g:util-subscribers) + +RECURSE_ROOT_RELATIVE( + util/string/fuzzing + util/generic/fuzz +) diff --git a/util/tests/style/ya.make b/util/tests/style/ya.make new file mode 100644 index 0000000000..3014797060 --- /dev/null +++ b/util/tests/style/ya.make @@ -0,0 +1,7 @@ +CPP_STYLE_TEST() + +OWNER(pg) + +STYLE(util/**/*.cpp util/**/*.h util/**/*.c) + +END() diff --git a/util/tests/sym_versions/test_glibc.py b/util/tests/sym_versions/test_glibc.py new file mode 100644 index 0000000000..c76359c54c --- /dev/null +++ b/util/tests/sym_versions/test_glibc.py @@ -0,0 +1,29 @@ +import os +import functools + +import yatest.common as yc +import library.python.resource as lpr + + +def construct_path(p): + parts = p.split('/') + + return p + '/' + '-'.join(parts[-3:]) + + +def iter_binaries(): + ok = False + + for l in lpr.find('/test_binaries').split('\n'): + if '# start' in l: + ok = True + else: + if '# end' in l: + ok = False + + if ok: + yield construct_path(l.strip()) + + +for p in iter_binaries(): + globals()['test_' + os.path.basename(p).replace('-', '_')] = functools.partial(yc.process.check_glibc_version, p) diff --git a/util/tests/sym_versions/ya.make b/util/tests/sym_versions/ya.make new file mode 100644 index 0000000000..3957c60fc9 --- /dev/null +++ b/util/tests/sym_versions/ya.make @@ -0,0 +1,42 @@ +PY2TEST() + +OWNER( + pg + g:util +) +SUBSCRIBER(g:util-subscribers) + +TEST_SRCS(test_glibc.py) + +PEERDIR( + library/python/resource +) + +RESOURCE( + ya.make /test_binaries +) + +DEPENDS( + # start binaries + util/generic/ut + util/charset/ut + util/datetime/ut + util/digest/ut + util/draft/ut + util/folder/ut + util/memory/ut + util/network/ut + util/random/ut + util/stream/ut + util/string/ut + util/system/ut + util/thread/ut + # end binaries + contrib/python/pyelftools/readelf +) + +FORK_SUBTESTS() + +SPLIT_FACTOR(10) + +END() diff --git a/util/tests/ut/ya.make b/util/tests/ut/ya.make new file mode 100644 index 0000000000..94278cbde1 --- /dev/null +++ b/util/tests/ut/ya.make @@ -0,0 +1,26 @@ +UNITTEST_FOR(util) + +OWNER(g:util) +SUBSCRIBER(g:util-subscribers) + +SRCS( + ysaveload_ut.cpp +) + +END() + +RECURSE_ROOT_RELATIVE( + util/charset/ut + util/datetime/ut + util/digest/ut + util/draft/ut + util/folder/ut + util/generic/ut + util/memory/ut + util/network/ut + util/random/ut + util/stream/ut + util/string/ut + util/system/ut + util/thread/ut +) diff --git a/util/tests/ya.make b/util/tests/ya.make new file mode 100644 index 0000000000..e1e85c2931 --- /dev/null +++ b/util/tests/ya.make @@ -0,0 +1,13 @@ +RECURSE( + benchmark + cython + fuzzing + ut + style +) + +IF (OS_LINUX) + RECURSE( + sym_versions + ) +ENDIF() diff --git a/util/tests/ya_util_tests.inc b/util/tests/ya_util_tests.inc new file mode 100644 index 0000000000..57855aee6b --- /dev/null +++ b/util/tests/ya_util_tests.inc @@ -0,0 +1,4 @@ +IF (OS_DARWIN) + SIZE(LARGE) + TAG(ya:fat ya:force_sandbox ya:exotic_platform) +ENDIF() |