-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ test-kle: | |
|
||
test-queue: | ||
zig test src/spsc_queue.zig | ||
|
||
functional-tests: | ||
cd tests && ./test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
# TODO: should check if free: | ||
FAKE_DISPLAY=:99 | ||
APP=${SCRIPT_DIR}/../zig-out/bin/klawa | ||
TEST_EVENTS=test_events.bin | ||
TEST_RENDER_DIR=render-out | ||
|
||
# TODO: add option to choose display, for local development Xephyr is better | ||
# but on CI Xvfb is required | ||
|
||
#Xephyr -br -ac -noreset -screen 960x320 $FAKE_DISPLAY & | ||
#DISPLAY_PID=$! | ||
|
||
Xvfb -ac $FAKE_DISPLAY -screen 0 960x320x24 > /dev/null 2>&1 & | ||
DISPLAY_PID=$! | ||
|
||
# wait for Xephyr | ||
sleep 1 | ||
|
||
DISPLAY=$FAKE_DISPLAY $APP --record $TEST_EVENTS & | ||
APP_PID=$! | ||
|
||
# wait for tested app | ||
sleep 1 | ||
|
||
# simulate some input | ||
DISPLAY=$FAKE_DISPLAY xdotool type --delay 500 "this is klawa app" | ||
kill -9 $APP_PID | ||
|
||
mkdir $TEST_RENDER_DIR | ||
DISPLAY=$FAKE_DISPLAY $APP --replay $TEST_EVENTS --render $TEST_RENDER_DIR | ||
kill -9 $DISPLAY_PID | ||
|
||
rm $TEST_EVENTS | ||
|
||
cd $TEST_RENDER_DIR && ffmpeg -y -framerate 60 -s 960x320 -pix_fmt rgba -i "frame%05d.raw" -c:v libvpx-vp9 ../output1.webm | ||
cd - | ||
|
||
rm -rf $TEST_RENDER_DIR |