Skip to content

Commit

Permalink
refactor: rm SQL_CASE_BASE_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd committed Jul 25, 2024
1 parent ca7ab42 commit fe3500c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
6 changes: 6 additions & 0 deletions hybridse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ configure_file(
"${PROJECT_SOURCE_DIR}/src/version.h.in"
"${PROJECT_SOURCE_DIR}/src/hybridse_version.h"
)

configure_file(
"${PROJECT_SOURCE_DIR}/src/case/test_cfg.h.in"
"${PROJECT_SOURCE_DIR}/src/case/test_cfg.h"
)

if (DEFINED ENV{CI})
# suppress useless maven log (e.g download log) on CI environment
set(MAVEN_FLAGS --batch-mode)
Expand Down
11 changes: 2 additions & 9 deletions hybridse/src/case/sql_case.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "glog/logging.h"
#include "node/sql_node.h"
#include "plan/plan_api.h"
#include "case/test_cfg.h"
#include "vm/engine.h"
#include "zetasql/parser/parser.h"
#include "planv2/ast_node_converter.h"
Expand Down Expand Up @@ -1758,15 +1759,7 @@ std::set<std::string> SqlCase::HYBRIDSE_LEVEL() {
}

std::string SqlCase::SqlCaseBaseDir() {
char* value = getenv("SQL_CASE_BASE_DIR");
if (value != nullptr) {
return std::string(value);
}
value = getenv("YAML_CASE_BASE_DIR");
if (value != nullptr) {
return std::string(value);
}
return "";
return SQL_CASE_BASE_DIR;
}

absl::StatusOr<std::vector<codec::Row>> ExtractInsertRow(vm::HybridSeJitWrapper* jit, absl::string_view insert,
Expand Down
22 changes: 22 additions & 0 deletions hybridse/src/case/test_cfg.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Copyright (c) 2024 OpenMLDB Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef HYBRIDSE_SRC_CASE_TEST_CFG_H_
#define HYBRIDSE_SRC_CASE_TEST_CFG_H_

#define SQL_CASE_BASE_DIR "${CMAKE_SOURCE_DIR}"

#endif // HYBRIDSE_SRC_CASE_TEST_CFG_H_

0 comments on commit fe3500c

Please sign in to comment.