You've already forked linuxdeploy
mirror of
https://github.com/encounter/linuxdeploy.git
synced 2026-03-30 11:18:58 -07:00
Add unit test for AppDir::deployFile
This commit is contained in:
committed by
TheAssassin
parent
47ff6c8e9d
commit
376eddb14d
@@ -149,6 +149,24 @@ namespace AppDirUnitTests {
|
||||
|
||||
if (!simple_icon_found)
|
||||
FAIL();
|
||||
}
|
||||
|
||||
|
||||
TEST_F(AppDirUnitTestsFixture, deployFile) {
|
||||
path filePath = SIMPLE_FILE_PATH;
|
||||
appDir.deployFile(filePath, tmpAppDir / "usr/share/doc/simple_application/");
|
||||
appDir.executeDeferredOperations();
|
||||
|
||||
bool simple_file_found = false;
|
||||
recursive_directory_iterator end_itr; // default construction yields past-the-end
|
||||
for (recursive_directory_iterator itr(tmpAppDir); itr != end_itr && (!simple_file_found); itr++) {
|
||||
const auto path = relative(itr->path(), tmpAppDir).filename().string();
|
||||
|
||||
if (path.find("simple_file.txt") != std::string::npos)
|
||||
simple_file_found = true;
|
||||
}
|
||||
|
||||
if (!simple_file_found)
|
||||
FAIL();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ target_compile_definitions(AppDirUnitTests PRIVATE
|
||||
-DSIMPLE_EXECUTABLE_PATH="$<TARGET_FILE:simple_executable>"
|
||||
-DSIMPLE_DESKTOP_ENTRY_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/simple_app.Desktop"
|
||||
-DSIMPLE_ICON_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/simple_icon.svg"
|
||||
-DSIMPLE_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/simple_file.txt"
|
||||
)
|
||||
|
||||
add_gtest(AppDirUnitTests)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Hello World!
|
||||
Reference in New Issue
Block a user