Skip to content

Commit

Permalink
feat: setup SqlCaseBaseDir for hybridse
Browse files Browse the repository at this point in the history
TODO: also setup for tests in src/
  • Loading branch information
aceforeverd committed Jul 25, 2024
1 parent dfa4603 commit a5ffc88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hybridse/include/case/sql_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ class SqlCase {
}
static std::set<std::string> HYBRIDSE_LEVEL();

// Get the base directory searching for yaml test cases.
// It is by default directory to current git repository, or you can override
// the base directory with 'SQL_CASE_BASE_DIR' environment variable
static std::string SqlCaseBaseDir();

static bool IsDebug() {
Expand Down
4 changes: 4 additions & 0 deletions hybridse/src/case/sql_case.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,10 @@ 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);
}
return SQL_CASE_BASE_DIR;

Check warning on line 1766 in hybridse/src/case/sql_case.cc

View check run for this annotation

Codecov / codecov/patch

hybridse/src/case/sql_case.cc#L1766

Added line #L1766 was not covered by tests
}

Expand Down

0 comments on commit a5ffc88

Please sign in to comment.