Skip to content

Commit

Permalink
Smarter root directory determination for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Jan 17, 2024
1 parent d05771a commit 3040930
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/headless/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ target_link_libraries(BYOD_headless PUBLIC
BYOD
)

target_compile_definitions(BYOD_headless
PRIVATE
BYOD_ROOT_DIR="${CMAKE_SOURCE_DIR}"
)

set_target_properties(BYOD_headless PROPERTIES CXX_VISIBILITY_PRESET hidden)
4 changes: 1 addition & 3 deletions src/headless/tests/AmpIRsSaveLoadTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ class AmpIRsSaveLoadTest : public UnitTest

const auto testIRFile = []
{
auto rootDir = File::getSpecialLocation (File::currentExecutableFile);
while (rootDir.getFileName() != "BYOD")
rootDir = rootDir.getParentDirectory();
const auto rootDir = juce::File { BYOD_ROOT_DIR };
return rootDir.getChildFile ("src/headless/tests/test_ir.wav");
}();

Expand Down
4 changes: 1 addition & 3 deletions src/headless/tests/ForwardingParamStabilityTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ class ForwardingParamStabilityTest : public UnitTest

const auto [stateFile, paramsFile] = [i]
{
auto rootDir = File::getSpecialLocation (File::currentExecutableFile);
while (rootDir.getFileName() != "BYOD")
rootDir = rootDir.getParentDirectory();
const auto rootDir = juce::File { BYOD_ROOT_DIR };
const auto fileDir = rootDir.getChildFile ("src/headless/tests/OldParamForwardStates");
return std::make_pair (fileDir.getChildFile ("test_" + juce::String { i } + ".xml"),
fileDir.getChildFile ("test_" + juce::String { i } + ".txt"));
Expand Down

0 comments on commit 3040930

Please sign in to comment.