124 |
124 |
125 ide_test_dir = $(src)/ide_tests |
125 ide_test_dir = $(src)/ide_tests |
126 sikuli_ide_tests = $(subst $(ide_test_dir)/,,$(wildcard $(ide_test_dir)/*.sikuli)) |
126 sikuli_ide_tests = $(subst $(ide_test_dir)/,,$(wildcard $(ide_test_dir)/*.sikuli)) |
127 pytest_ide_tests = $(subst $(ide_test_dir)/,,$(wildcard $(ide_test_dir)/*.pytest)) |
127 pytest_ide_tests = $(subst $(ide_test_dir)/,,$(wildcard $(ide_test_dir)/*.pytest)) |
128 |
128 |
|
129 fluxbox_command ?= echo "session.screen0.toolbar.placement: TopCenter" > fluxbox_init; (fluxbox -rc fluxbox_init >/dev/null 2>&1 &) |
|
130 |
129 define sikuli_idetest_command |
131 define sikuli_idetest_command |
130 (fluxbox >/dev/null 2>&1 &); BEREMIZPATH=$(build_dir)/beremiz sikulix -r $(src)/ide_tests/$(1) |
132 $(fluxbox_command); BEREMIZPATH=$(build_dir)/beremiz sikulix -r $(src)/ide_tests/$(1) |
131 endef |
133 endef |
132 |
134 |
133 |
135 |
134 DELAY=400 |
136 DELAY=400 |
135 KILL_DELAY=430 |
137 KILL_DELAY=430 |
136 PYTEST=$(dir $(BEREMIZPYTHONPATH))/pytest |
138 PYTEST=$(dir $(BEREMIZPYTHONPATH))/pytest |
137 define pytest_idetest_command |
139 define pytest_idetest_command |
138 (fluxbox >/dev/null 2>&1 &); PYTHONPATH=$(ide_test_dir) timeout -k $(KILL_DELAY) $(DELAY) $(PYTEST) --maxfail=1 --timeout=100 $(src)/ide_tests/$(1) |
140 $(fluxbox_command); PYTHONPATH=$(ide_test_dir) timeout -k $(KILL_DELAY) $(DELAY) $(PYTEST) --maxfail=1 --timeout=100 $(src)/ide_tests/$(1) |
139 endef |
141 endef |
140 |
142 |
141 # Xnest based interactive sessions for tests edit and debug. |
143 # Xnest based interactive sessions for tests edit and debug. |
142 # Would be nice with something equivalent to xvfb-run, waiting for USR1. |
144 # Would be nice with something equivalent to xvfb-run, waiting for USR1. |
143 # Arbitrary "sleep 1" is probably enough for interactive use |
145 # Arbitrary "sleep 1" is probably enough for interactive use |
167 |
169 |
168 ide_tests : $(ide_tests_targets) |
170 ide_tests : $(ide_tests_targets) |
169 echo "$(ide_tests_targets) : Passed" |
171 echo "$(ide_tests_targets) : Passed" |
170 |
172 |
171 xnest_xterm: built_apps |
173 xnest_xterm: built_apps |
172 $(call xnest_run, bash -c '(fluxbox &);xterm') |
174 $(call xnest_run, bash -c '$(fluxbox_command);xterm') |
173 |
175 |
174 xnest_sikuli: built_apps |
176 xnest_sikuli: built_apps |
175 $(call xnest_run, bash -c '(fluxbox &);(BEREMIZPATH=$(build_dir)/beremiz xterm -e sikulix &);xterm') |
177 $(call xnest_run, bash -c '$(fluxbox_command);(BEREMIZPATH=$(build_dir)/beremiz xterm -e sikulix &);xterm') |
176 |
178 |
177 xvfb_sikuli: built_apps |
179 xvfb_sikuli: built_apps |
178 echo "******************************************" |
180 echo "******************************************" |
179 echo "On host, run 'xvncviewer 127.0.0.1:5900' to see sikuli X session" |
181 echo "On host, run 'xvncviewer 127.0.0.1:5900' to see sikuli X session" |
180 echo "Docker container must be created with TESTDEBUG=YES. For example :" |
182 echo "Docker container must be created with TESTDEBUG=YES. For example :" |