39 # |
39 # |
40 # Test results, and other test byproducts are in $(test_dir), |
40 # Test results, and other test byproducts are in $(test_dir), |
41 # $(test_dir) defaults to $(HOME)/test and can be overloaded: |
41 # $(test_dir) defaults to $(HOME)/test and can be overloaded: |
42 # $ make test_dir=${HOME}/other_test_dir |
42 # $ make test_dir=${HOME}/other_test_dir |
43 # |
43 # |
|
44 # Makefile attemps to use xvfb-run to run each test individually with its own |
|
45 # X server instance. This behavior can be overloaded |
|
46 # $ DISPLAY=:42 make xserver_command='echo "Using $DISPLAY X Server !";' |
44 # |
47 # |
45 # Matiec and Beremiz code are expected to be clean as if after hg clean --all. |
48 # Matiec and Beremiz code are expected to be clean as if after hg clean --all. |
46 # Any change in Matiec directory triggers rebuild of matiec. |
49 # Any change in Matiec directory triggers rebuild of matiec. |
47 # Any change in Matiec and Beremiz directory triggers copy of source code |
50 # Any change in Matiec and Beremiz directory triggers copy of source code |
48 # to $(test_dir)/build. |
51 # to $(test_dir)/build. |
103 # Arbitrary "sleep 1" is probably enough for interactive use |
106 # Arbitrary "sleep 1" is probably enough for interactive use |
104 define xnest_run |
107 define xnest_run |
105 Xnest :42 -geometry 1920x1080+0+0 & export xnestpid=$$!; sleep 1; DISPLAY=:42 $(1); export res=$$?; kill $${xnestpid} 2>/dev/null; exit $${res} |
108 Xnest :42 -geometry 1920x1080+0+0 & export xnestpid=$$!; sleep 1; DISPLAY=:42 $(1); export res=$$?; kill $${xnestpid} 2>/dev/null; exit $${res} |
106 endef |
109 endef |
107 |
110 |
108 # Manually invoked rule {testname}.sikuli |
111 xserver_command ?= xvfb-run -s '-screen 0 1920x1080x24' |
|
112 |
109 define make_idetest_rule |
113 define make_idetest_rule |
110 $(test_dir)/$(1)_idetest/.passed: own_apps |
114 $(test_dir)/$(1)_idetest/.passed: own_apps |
111 rm -rf $(test_dir)/$(1)_idetest |
115 rm -rf $(test_dir)/$(1)_idetest |
112 mkdir $(test_dir)/$(1)_idetest |
116 mkdir $(test_dir)/$(1)_idetest |
113 cd $(test_dir)/$(1)_idetest; xvfb-run -s '-screen 0 1920x1080x24' bash -c '$$(call idetest_command, $(1))' |
117 cd $(test_dir)/$(1)_idetest; $(xserver_command) bash -c '$(call idetest_command, $(1))' |
114 touch $$@ |
118 touch $$@ |
115 |
119 |
|
120 # Manually invoked rule {testname}.sikuli |
116 $(1): $(test_dir)/$(1)_idetest/.passed |
121 $(1): $(test_dir)/$(1)_idetest/.passed |
117 |
122 |
118 # Manually invoked rule xnest_{testname}.sikuli |
123 # Manually invoked rule xnest_{testname}.sikuli |
119 # runs test in xnest so that one can see what happens |
124 # runs test in xnest so that one can see what happens |
120 # depends on docker arguments "-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e DISPLAY=$DISPLAY" |
|
121 xnest_$(1): own_apps |
125 xnest_$(1): own_apps |
122 rm -rf $(test_dir)/$(1)_idetest |
126 rm -rf $(test_dir)/$(1)_idetest |
123 mkdir $(test_dir)/$(1)_idetest |
127 mkdir $(test_dir)/$(1)_idetest |
124 cd $(test_dir)/$(1)_idetest; $$(call xnest_run, bash -c '$(call idetest_command, $(1))') |
128 cd $(test_dir)/$(1)_idetest; $$(call xnest_run, bash -c '$(call idetest_command, $(1))') |
125 |
129 |