diff --git a/.travis.yml b/.travis.yml index 43392ae..4fc5668 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ install: script: - (cd example-os && make) - - ./utils/gui-wrapper.sh ./test/${MODE}.sh + - ./utils/gui-wrapper.sh 800x600x24 ./test/${MODE}.sh - | ./utils/auto-push.sh "https://github.com/jsmaniac/travis-os.git" \ "git@github.com:jsmaniac/travis-os-deploy-artifacts.git" \ diff --git a/example-os/Makefile b/example-os/Makefile index 475da69..6c503a6 100644 --- a/example-os/Makefile +++ b/example-os/Makefile @@ -13,16 +13,16 @@ test: test-qemu-system-i386 test-qemu-system-arm test-virtualbox test-bochs Make .PHONY: test-qemu-system-i386 test-qemu-system-i386: os.sh ../deploy-screenshots Makefile - (cd .. && xvfb-run -a ./test/qemu-system-i386.sh) + (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-i386.sh) .PHONY: test-qemu-system-arm test-qemu-system-arm: os.sh ../deploy-screenshots Makefile - (cd .. && xvfb-run -a ./test/qemu-system-arm.sh) + (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/qemu-system-arm.sh) .PHONY: test-virtualbox test-virtualbox: os.sh ../deploy-screenshots Makefile - (cd .. && xvfb-run -a ./test/virtualbox.sh) + (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/virtualbox.sh) .PHONY: test-bochs test-bochs: os.sh ../deploy-screenshots Makefile - (cd .. && xvfb-run -a ./test/bochs.sh) + (cd .. && ./utils/gui-wrapper.sh 800x600x24 ./test/bochs.sh) diff --git a/utils/gui-wrapper.sh b/utils/gui-wrapper.sh index c3eaa19..58783fc 100755 --- a/utils/gui-wrapper.sh +++ b/utils/gui-wrapper.sh @@ -1,2 +1,21 @@ #!/bin/sh -xvfb-run -a sh -c 'fluxbox 2>/dev/null & sleep 3; "$@"' utils/gui-wrapper.sh-subshell "$@" \ No newline at end of file + +resolution="$1" # e.g. 800x600x24 (width x height x bits_per_pixel) +shift # the following arguments are the program to execute and its arguments + +bg="$(mktemp --suffix='bg.png')" +fb_cfg="$(mktemp --suffix='fluxbox.cfg')" + +# Create solid black background +convert -size 16x16 xc:black "$bg" + +# Create minimalist fluxbox configuration +cat > "$fb_cfg" </dev/null & sleep 3; "$@"' utils/gui-wrapper.sh-subshell "$@" + +# Cleanup +rm "$bg" "$fb_cfg" \ No newline at end of file