Skip to content

Commit

Permalink
Don't use absolute path when loading test data
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jszczerbinski committed Oct 30, 2024
1 parent ab5d1aa commit 176db13
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
22 changes: 22 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,28 @@ set(AWS_ALL_LIBS
${AWS_C_SDKUTILS_LIB}
)

SET(TEST_DATA
TestOrcFile.test1.orc
brotli_sample.txt.br
decode
decode2
encode
encode2
large_file.csv.gz
nation.impala.parquet
one_byte.csv
public_domain_books.csv
small_file.csv
small_file.csv.bz2
small_file.csv.gz
small_file.csv.zst
zero_byte.csv
)

FOREACH (TD ${TEST_DATA})
configure_file("data/${TD}" "data/${TD}" COPYONLY)
ENDFOREACH ()

message("CLOUD_PROVIDER is set to " $ENV{CLOUD_PROVIDER})
#Due to docker issue the tests are failing on linux.
if (APPLE OR WIN32 OR CLIENT_CODE_COVERAGE)
Expand Down
20 changes: 1 addition & 19 deletions tests/utils/TestSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,5 @@

std::string TestSetup::getDataDir()
{
#ifdef _WIN32
char appveyorBuildDir[500];
DWORD dwRet = 0;
dwRet= GetEnvironmentVariable("APPVEYOR_BUILD_FOLDER", appveyorBuildDir, sizeof(appveyorBuildDir));
if (dwRet != 0)
{
return std::string(appveyorBuildDir) + PATH_SEP + "tests" + PATH_SEP + "data" + PATH_SEP;
}
#else
const char * travisBuildDir = getenv("TRAVIS_BUILD_DIR");
if (travisBuildDir)
{
return std::string(travisBuildDir) + PATH_SEP + "tests" + PATH_SEP + "data" + PATH_SEP;
}
#endif

const std::string current_file = __FILE__;
std::string utilDir = current_file.substr(0, current_file.find_last_of(PATH_SEP));
return utilDir + PATH_SEP + ".." + PATH_SEP + "data" + PATH_SEP;
return std::string("data") + PATH_SEP;
}

0 comments on commit 176db13

Please sign in to comment.