mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-12 17:02:23 -05:00
Add AppDir::deployIcon test.
This commit is contained in:
committed by
TheAssassin
parent
eacc907c85
commit
47ff6c8e9d
@@ -124,11 +124,31 @@ namespace AppDirUnitTests {
|
||||
for (recursive_directory_iterator itr(tmpAppDir); itr != end_itr && (!simple_app_desktop_found); itr++) {
|
||||
const auto path = relative(itr->path(), tmpAppDir).filename().string();
|
||||
|
||||
if (path.find("SimpleApp.Desktop") != std::string::npos)
|
||||
if (path.find("simple_app.Desktop") != std::string::npos)
|
||||
simple_app_desktop_found = true;
|
||||
}
|
||||
|
||||
if (!simple_app_desktop_found)
|
||||
FAIL();
|
||||
}
|
||||
|
||||
|
||||
TEST_F(AppDirUnitTestsFixture, deployIcon) {
|
||||
path iconPath = SIMPLE_ICON_PATH;
|
||||
appDir.deployIcon(iconPath);
|
||||
appDir.executeDeferredOperations();
|
||||
|
||||
bool simple_icon_found = false;
|
||||
recursive_directory_iterator end_itr; // default construction yields past-the-end
|
||||
for (recursive_directory_iterator itr(tmpAppDir); itr != end_itr && (!simple_icon_found); itr++) {
|
||||
const auto path = relative(itr->path(), tmpAppDir).filename().string();
|
||||
|
||||
if (path.find("simple_icon.svg") != std::string::npos)
|
||||
simple_icon_found = true;
|
||||
}
|
||||
|
||||
if (!simple_icon_found)
|
||||
FAIL();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ target_include_directories(AppDirUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/include
|
||||
target_compile_definitions(AppDirUnitTests PRIVATE
|
||||
-DSIMPLE_LIBRARY_PATH="$<TARGET_FILE:simple_library>"
|
||||
-DSIMPLE_EXECUTABLE_PATH="$<TARGET_FILE:simple_executable>"
|
||||
-DSIMPLE_DESKTOP_ENTRY_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/SimpleApp.Desktop"
|
||||
-DSIMPLE_DESKTOP_ENTRY_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/simple_app.Desktop"
|
||||
-DSIMPLE_ICON_PATH="${CMAKE_CURRENT_SOURCE_DIR}/data/simple_icon.svg"
|
||||
)
|
||||
|
||||
add_gtest(AppDirUnitTests)
|
||||
|
||||
38
tests/data/simple_icon.svg
Normal file
38
tests/data/simple_icon.svg
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg8"
|
||||
version="1.1"
|
||||
viewBox="0 0 4.2333332 4.2333335"
|
||||
height="16"
|
||||
width="16">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(0,-292.76665)"
|
||||
id="layer1">
|
||||
<rect
|
||||
width="4.2333322"
|
||||
height="4.2333322"
|
||||
y="292.76666"
|
||||
x="6.0100706e-07"
|
||||
id="rect815"
|
||||
style="opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user