Skip to content

Commit

Permalink
Eliminare nume fereastră hardcodat în scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmarius authored Feb 23, 2023
1 parent d904de7 commit 28bb881
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
BUILD_DIR: "build"
EXT_DIR: "ext"
BIN_DIR: "bin"
APP_WINDOW: "My Window"

defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ endfunction()
# external dependencies with FetchContent
include(FetchContent)

# NOTE: Also update SFML_VERSION env var in .github/workflows/cmake.yml:113
# NOTE: Also update SFML_VERSION env var in .github/workflows/cmake.yml:122
FetchContent_Declare(
SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
Expand Down
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int main() {
delete c;

sf::RenderWindow window;
// NOTE: sync with env variable APP_WINDOW from .github/workflows/cmake.yml:30
window.create(sf::VideoMode({800, 700}), "My Window", sf::Style::Default);
window.setVerticalSyncEnabled(true);
//window.setFramerateLimit(60);
Expand Down
10 changes: 5 additions & 5 deletions scripts/run_sanitizers.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cat "${INPUT_FILENAME}" | ./"${ZIP_NAME}"/"${EXECUTABLE_NAME}" &
sleep 3 && xdotool search --name "My Window" key X &&
sleep 1 && xdotool search --name "My Window" key Y &&
sleep 1 && xdotool search --name "My Window" key X &&
sleep 1 && xdotool search --name "My Window" key Z &&
sleep 2 && xdotool search --name "My Window" key Alt+F4
sleep 3 && xdotool search --name "${APP_WINDOW}" key X &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key Y &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key X &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key Z &&
sleep 2 && xdotool search --name "${APP_WINDOW}" key Alt+F4
10 changes: 5 additions & 5 deletions scripts/run_valgrind.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cat "${INPUT_FILENAME}" | valgrind --leak-check=full --track-origins=yes --error-exitcode=0 ./"${ZIP_NAME}"/"${EXECUTABLE_NAME}" &
sleep 10 && xdotool search --name "My Window" key X &&
sleep 1 && xdotool search --name "My Window" key Y &&
sleep 1 && xdotool search --name "My Window" key X &&
sleep 1 && xdotool search --name "My Window" key Z &&
sleep 2 && xdotool search --name "My Window" key Alt+F4
sleep 10 && xdotool search --name "${APP_WINDOW}" key X &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key Y &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key X &&
sleep 1 && xdotool search --name "${APP_WINDOW}" key Z &&
sleep 2 && xdotool search --name "${APP_WINDOW}" key Alt+F4

0 comments on commit 28bb881

Please sign in to comment.