diff options
| author | vvvv <[email protected]> | 2023-07-27 20:59:24 +0300 |
|---|---|---|
| committer | vvvv <[email protected]> | 2023-07-27 20:59:24 +0300 |
| commit | 95ef237389033d9554531589df9c3dcbed67514d (patch) | |
| tree | 8b2fdfb4196fbef6d1eebd498bacc9ac2adb5198 | |
| parent | 914daa8b14f845dab581ffda3cc139df6eac10ea (diff) | |
Move fastcheck to public
17 files changed, 676 insertions, 0 deletions
diff --git a/ydb/library/yql/public/CMakeLists.txt b/ydb/library/yql/public/CMakeLists.txt index 71687e2ead6..823731a6d81 100644 --- a/ydb/library/yql/public/CMakeLists.txt +++ b/ydb/library/yql/public/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(decimal) +add_subdirectory(fastcheck) add_subdirectory(issue) add_subdirectory(types) add_subdirectory(udf) diff --git a/ydb/library/yql/public/fastcheck/CMakeLists.darwin-x86_64.txt b/ydb/library/yql/public/fastcheck/CMakeLists.darwin-x86_64.txt new file mode 100644 index 00000000000..62f467c5e80 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/CMakeLists.darwin-x86_64.txt @@ -0,0 +1,26 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(ut) + +add_library(yql-public-fastcheck) +target_link_libraries(yql-public-fastcheck PUBLIC + contrib-libs-cxxsupp + yutil + library-yql-ast + core-services-mounts + yql-core-user_data + udf-service-exception_policy + library-yql-sql + yql-sql-pg + yql-parser-pg_wrapper + providers-common-provider +) +target_sources(yql-public-fastcheck PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck.cpp +) diff --git a/ydb/library/yql/public/fastcheck/CMakeLists.linux-aarch64.txt b/ydb/library/yql/public/fastcheck/CMakeLists.linux-aarch64.txt new file mode 100644 index 00000000000..05080dada9b --- /dev/null +++ b/ydb/library/yql/public/fastcheck/CMakeLists.linux-aarch64.txt @@ -0,0 +1,27 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(ut) + +add_library(yql-public-fastcheck) +target_link_libraries(yql-public-fastcheck PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-yql-ast + core-services-mounts + yql-core-user_data + udf-service-exception_policy + library-yql-sql + yql-sql-pg + yql-parser-pg_wrapper + providers-common-provider +) +target_sources(yql-public-fastcheck PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck.cpp +) diff --git a/ydb/library/yql/public/fastcheck/CMakeLists.linux-x86_64.txt b/ydb/library/yql/public/fastcheck/CMakeLists.linux-x86_64.txt new file mode 100644 index 00000000000..05080dada9b --- /dev/null +++ b/ydb/library/yql/public/fastcheck/CMakeLists.linux-x86_64.txt @@ -0,0 +1,27 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(ut) + +add_library(yql-public-fastcheck) +target_link_libraries(yql-public-fastcheck PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-yql-ast + core-services-mounts + yql-core-user_data + udf-service-exception_policy + library-yql-sql + yql-sql-pg + yql-parser-pg_wrapper + providers-common-provider +) +target_sources(yql-public-fastcheck PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck.cpp +) diff --git a/ydb/library/yql/public/fastcheck/CMakeLists.txt b/ydb/library/yql/public/fastcheck/CMakeLists.txt new file mode 100644 index 00000000000..f8b31df0c11 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/CMakeLists.txt @@ -0,0 +1,17 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-aarch64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + include(CMakeLists.darwin-x86_64.txt) +elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) + include(CMakeLists.windows-x86_64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-x86_64.txt) +endif() diff --git a/ydb/library/yql/public/fastcheck/CMakeLists.windows-x86_64.txt b/ydb/library/yql/public/fastcheck/CMakeLists.windows-x86_64.txt new file mode 100644 index 00000000000..62f467c5e80 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/CMakeLists.windows-x86_64.txt @@ -0,0 +1,26 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +add_subdirectory(ut) + +add_library(yql-public-fastcheck) +target_link_libraries(yql-public-fastcheck PUBLIC + contrib-libs-cxxsupp + yutil + library-yql-ast + core-services-mounts + yql-core-user_data + udf-service-exception_policy + library-yql-sql + yql-sql-pg + yql-parser-pg_wrapper + providers-common-provider +) +target_sources(yql-public-fastcheck PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck.cpp +) diff --git a/ydb/library/yql/public/fastcheck/fastcheck.cpp b/ydb/library/yql/public/fastcheck/fastcheck.cpp new file mode 100644 index 00000000000..ec54aef5da5 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/fastcheck.cpp @@ -0,0 +1,95 @@ +#include "fastcheck.h" +#include <ydb/library/yql/ast/yql_ast.h> +#include <ydb/library/yql/ast/yql_expr.h> +#include <ydb/library/yql/core/services/mounts/yql_mounts.h> +#include <ydb/library/yql/core/user_data/yql_user_data.h> +#include <ydb/library/yql/core/yql_type_annotation.h> +#include <ydb/library/yql/core/yql_user_data_storage.h> +#include <ydb/library/yql/sql/sql.h> + +namespace NYql { +namespace NFastCheck { + +bool CheckProgram(const TString& program, const TOptions& options, TIssues& errors) { + TAstParseResult astRes; + if (options.IsSql) { + NSQLTranslation::TTranslationSettings settings; + settings.ClusterMapping = options.ClusterMapping; + settings.SyntaxVersion = options.SyntaxVersion; + settings.V0Behavior = NSQLTranslation::EV0Behavior::Disable; + if (options.IsLibrary) { + settings.Mode = NSQLTranslation::ESqlMode::LIBRARY; + } + + astRes = SqlToYql(program, settings); + } else { + astRes = ParseAst(program); + } + + if (!astRes.IsOk()) { + errors = std::move(astRes.Issues); + return false; + } + + if (options.IsLibrary) { + return true; + } + + if (options.ParseOnly) { + // parse SQL libs + for (const auto& x : options.SqlLibs) { + NSQLTranslation::TTranslationSettings settings; + settings.ClusterMapping = options.ClusterMapping; + settings.SyntaxVersion = options.SyntaxVersion; + settings.V0Behavior = NSQLTranslation::EV0Behavior::Disable; + settings.File = x.first; + settings.Mode = NSQLTranslation::ESqlMode::LIBRARY; + + astRes = SqlToYql(x.second, settings); + if (!astRes.IsOk()) { + errors = std::move(astRes.Issues); + return false; + } + } + + return true; + } + + TVector<NUserData::TUserData> userData; + for (const auto& x : options.SqlLibs) { + NUserData::TUserData data; + data.Type_ = NUserData::EType::LIBRARY; + data.Disposition_ = NUserData::EDisposition::INLINE; + data.Name_ = x.first; + data.Content_ = x.second; + userData.push_back(data); + } + + TExprContext libCtx; + libCtx.IssueManager.AddIssues(std::move(astRes.Issues)); + IModuleResolver::TPtr moduleResolver; + TUserDataTable userDataTable = GetYqlModuleResolver(libCtx, moduleResolver, userData, options.ClusterMapping, {}); + if (!userDataTable) { + errors = libCtx.IssueManager.GetIssues(); + libCtx.IssueManager.Reset(); + return false; + } + + auto userDataStorage = MakeIntrusive<TUserDataStorage>(nullptr, userDataTable, nullptr, nullptr); + if (auto modules = dynamic_cast<TModuleResolver*>(moduleResolver.get())) { + modules->AttachUserData(userDataStorage); + } + + TExprContext exprCtx(libCtx.NextUniqueId); + TExprNode::TPtr exprRoot; + if (!CompileExpr(*astRes.Root, exprRoot, exprCtx, moduleResolver.get(), false, Max<ui32>(), options.SyntaxVersion)) { + errors = exprCtx.IssueManager.GetIssues(); + exprCtx.IssueManager.Reset(); + return false; + } + + return true; +} + +} +} diff --git a/ydb/library/yql/public/fastcheck/fastcheck.h b/ydb/library/yql/public/fastcheck/fastcheck.h new file mode 100644 index 00000000000..2740343e4c1 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/fastcheck.h @@ -0,0 +1,21 @@ +#pragma once +#include <ydb/library/yql/ast/yql_errors.h> +#include <util/generic/hash.h> +#include <ydb/library/yql/providers/common/provider/yql_provider_names.h> + +namespace NYql { +namespace NFastCheck { + +struct TOptions { + bool IsSql = true; + bool ParseOnly = false; + THashMap<TString, TString> ClusterMapping; + ui16 SyntaxVersion = 1; + bool IsLibrary = false; + THashMap<TString, TString> SqlLibs = {}; // mapping file name => SQL +}; + +bool CheckProgram(const TString& program, const TOptions& options, TIssues& errors); + +} +} diff --git a/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp b/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp new file mode 100644 index 00000000000..79c4d30d4f3 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp @@ -0,0 +1,120 @@ +#include "fastcheck.h" +#include <library/cpp/testing/unittest/registar.h> + +using namespace NYql; +using namespace NYql::NFastCheck; + +Y_UNIT_TEST_SUITE(TFastCheckTests) { + Y_UNIT_TEST(ParsePureYqlGood) { + TOptions options; + options.IsSql = false; + options.ParseOnly = true; + TIssues errors; + UNIT_ASSERT(CheckProgram("(return world)", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(ParsePureYqlBad) { + TOptions options; + options.IsSql = false; + options.ParseOnly = true; + TIssues errors; + UNIT_ASSERT(CheckProgram("(return world1)", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(ParsePureSqlGood) { + TOptions options; + options.IsSql = true; + options.ParseOnly = true; + TIssues errors; + UNIT_ASSERT(CheckProgram("select 1", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(ParsePureSqlBad) { + TOptions options; + options.IsSql = true; + options.ParseOnly = true; + TIssues errors; + UNIT_ASSERT(!CheckProgram("select1", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(1, errors.Size()); + } + + Y_UNIT_TEST(CompilePureYqlBad) { + TOptions options; + options.IsSql = false; + options.ParseOnly = false; + TIssues errors; + UNIT_ASSERT(!CheckProgram("(return world1)", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(1, errors.Size()); + } + + Y_UNIT_TEST(CompileTableSqlGood) { + TOptions options; + options.IsSql = true; + options.ParseOnly = false; + options.ClusterMapping["plato"] = YtProviderName; + TIssues errors; + UNIT_ASSERT(CheckProgram("select key,count(*) from plato.Input group by key", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(CompileTableSqlBad) { + TOptions options; + options.IsSql = true; + options.ParseOnly = false; + TIssues errors; + UNIT_ASSERT(!CheckProgram("select key,count(*) from plato.Input", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(1, errors.Size()); + } + + Y_UNIT_TEST(CompileLibrary) { + TOptions options; + options.IsSql = true; + options.IsLibrary = true; + TIssues errors; + UNIT_ASSERT(CheckProgram("$x = 1; export $x", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(CompileSqlWithLibsGood) { + TOptions options; + options.IsSql = true; + options.ParseOnly = false; + options.SqlLibs["foo.sql"] = "$x = 1; export $x;"; + TIssues errors; + UNIT_ASSERT(CheckProgram("pragma library('foo.sql');import foo symbols $x; select $x", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } + + Y_UNIT_TEST(ParseSqlWithBadLib) { + TOptions options; + options.IsSql = true; + options.ParseOnly = true; + options.SqlLibs["foo.sql"] = "$x = 1; zexport $x;"; + TIssues errors; + UNIT_ASSERT(!CheckProgram("pragma library('foo.sql');import foo symbols $x; select $x", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(1, errors.Size()); + } + + Y_UNIT_TEST(CompileSqlWithUnresolvedLib) { + TOptions options; + options.IsSql = true; + options.ParseOnly = false; + options.SqlLibs["foo.sql"] = "$x = 1; export $x;"; + TIssues errors; + UNIT_ASSERT(!CheckProgram("pragma library('foo.sql');import foo symbols $y; select $y", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(1, errors.Size()); + } + + Y_UNIT_TEST(ParseSqlWithUnresolvedLib) { + TOptions options; + options.IsSql = true; + options.ParseOnly = true; + options.SqlLibs["foo.sql"] = "$x = 1; export $x;"; + TIssues errors; + UNIT_ASSERT(CheckProgram("pragma library('foo.sql');import foo symbols $y; select $y", options, errors)); + UNIT_ASSERT_VALUES_EQUAL(0, errors.Size()); + } +} diff --git a/ydb/library/yql/public/fastcheck/ut/CMakeLists.darwin-x86_64.txt b/ydb/library/yql/public/fastcheck/ut/CMakeLists.darwin-x86_64.txt new file mode 100644 index 00000000000..ff1721ab9b7 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/CMakeLists.darwin-x86_64.txt @@ -0,0 +1,67 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-library-yql-public-fastcheck-ut) +target_include_directories(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck +) +target_link_libraries(ydb-library-yql-public-fastcheck-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + yql-public-fastcheck +) +target_link_options(ydb-library-yql-public-fastcheck-ut PRIVATE + -Wl,-platform_version,macos,11.0,11.0 + -fPIC + -fPIC + -framework + CoreFoundation +) +target_sources(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp +) +set_property( + TARGET + ydb-library-yql-public-fastcheck-ut + PROPERTY + SPLIT_FACTOR + 1 +) +add_yunittest( + NAME + ydb-library-yql-public-fastcheck-ut + TEST_TARGET + ydb-library-yql-public-fastcheck-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-library-yql-public-fastcheck-ut + system_allocator +) +vcs_info(ydb-library-yql-public-fastcheck-ut) diff --git a/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-aarch64.txt b/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-aarch64.txt new file mode 100644 index 00000000000..9b4ba9f94da --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-aarch64.txt @@ -0,0 +1,70 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-library-yql-public-fastcheck-ut) +target_include_directories(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck +) +target_link_libraries(ydb-library-yql-public-fastcheck-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + cpp-testing-unittest_main + yql-public-fastcheck +) +target_link_options(ydb-library-yql-public-fastcheck-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp +) +set_property( + TARGET + ydb-library-yql-public-fastcheck-ut + PROPERTY + SPLIT_FACTOR + 1 +) +add_yunittest( + NAME + ydb-library-yql-public-fastcheck-ut + TEST_TARGET + ydb-library-yql-public-fastcheck-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-library-yql-public-fastcheck-ut + cpp-malloc-jemalloc +) +vcs_info(ydb-library-yql-public-fastcheck-ut) diff --git a/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-x86_64.txt b/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-x86_64.txt new file mode 100644 index 00000000000..6f6db82494f --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/CMakeLists.linux-x86_64.txt @@ -0,0 +1,72 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-library-yql-public-fastcheck-ut) +target_include_directories(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck +) +target_link_libraries(ydb-library-yql-public-fastcheck-ut PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + yql-public-fastcheck +) +target_link_options(ydb-library-yql-public-fastcheck-ut PRIVATE + -ldl + -lrt + -Wl,--no-as-needed + -fPIC + -fPIC + -lpthread + -lrt + -ldl +) +target_sources(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp +) +set_property( + TARGET + ydb-library-yql-public-fastcheck-ut + PROPERTY + SPLIT_FACTOR + 1 +) +add_yunittest( + NAME + ydb-library-yql-public-fastcheck-ut + TEST_TARGET + ydb-library-yql-public-fastcheck-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-library-yql-public-fastcheck-ut + cpp-malloc-tcmalloc + libs-tcmalloc-no_percpu_cache +) +vcs_info(ydb-library-yql-public-fastcheck-ut) diff --git a/ydb/library/yql/public/fastcheck/ut/CMakeLists.txt b/ydb/library/yql/public/fastcheck/ut/CMakeLists.txt new file mode 100644 index 00000000000..f8b31df0c11 --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/CMakeLists.txt @@ -0,0 +1,17 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-aarch64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + include(CMakeLists.darwin-x86_64.txt) +elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) + include(CMakeLists.windows-x86_64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-x86_64.txt) +endif() diff --git a/ydb/library/yql/public/fastcheck/ut/CMakeLists.windows-x86_64.txt b/ydb/library/yql/public/fastcheck/ut/CMakeLists.windows-x86_64.txt new file mode 100644 index 00000000000..57cad616bcd --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/CMakeLists.windows-x86_64.txt @@ -0,0 +1,60 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_executable(ydb-library-yql-public-fastcheck-ut) +target_include_directories(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck +) +target_link_libraries(ydb-library-yql-public-fastcheck-ut PUBLIC + contrib-libs-cxxsupp + yutil + library-cpp-cpuid_check + cpp-testing-unittest_main + yql-public-fastcheck +) +target_sources(ydb-library-yql-public-fastcheck-ut PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/library/yql/public/fastcheck/fastcheck_ut.cpp +) +set_property( + TARGET + ydb-library-yql-public-fastcheck-ut + PROPERTY + SPLIT_FACTOR + 1 +) +add_yunittest( + NAME + ydb-library-yql-public-fastcheck-ut + TEST_TARGET + ydb-library-yql-public-fastcheck-ut + TEST_ARG + --print-before-suite + --print-before-test + --fork-tests + --print-times + --show-fails +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + LABELS + SMALL +) +set_yunittest_property( + TEST + ydb-library-yql-public-fastcheck-ut + PROPERTY + PROCESSORS + 1 +) +target_allocator(ydb-library-yql-public-fastcheck-ut + system_allocator +) +vcs_info(ydb-library-yql-public-fastcheck-ut) diff --git a/ydb/library/yql/public/fastcheck/ut/ya.make b/ydb/library/yql/public/fastcheck/ut/ya.make new file mode 100644 index 00000000000..572ef6db88d --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ut/ya.make @@ -0,0 +1,7 @@ +UNITTEST_FOR(ydb/library/yql/public/fastcheck) + +SRCS( + fastcheck_ut.cpp +) + +END() diff --git a/ydb/library/yql/public/fastcheck/ya.make b/ydb/library/yql/public/fastcheck/ya.make new file mode 100644 index 00000000000..4cc3fccef0e --- /dev/null +++ b/ydb/library/yql/public/fastcheck/ya.make @@ -0,0 +1,22 @@ +LIBRARY() + +SRCS( + fastcheck.cpp +) + +PEERDIR( + ydb/library/yql/ast + ydb/library/yql/core/services/mounts + ydb/library/yql/core/user_data + ydb/library/yql/public/udf/service/exception_policy + ydb/library/yql/sql + ydb/library/yql/sql/pg + ydb/library/yql/parser/pg_wrapper + ydb/library/yql/providers/common/provider +) + +END() + +RECURSE_FOR_TESTS( + ut +) diff --git a/ydb/library/yql/public/ya.make b/ydb/library/yql/public/ya.make index f41406c3bdc..37dcc6368a6 100644 --- a/ydb/library/yql/public/ya.make +++ b/ydb/library/yql/public/ya.make @@ -1,5 +1,6 @@ RECURSE( decimal + fastcheck issue types udf |
