Merge lp:~jpakkane/grail/fix_oos_tests into lp:grail

Proposed by Jussi Pakkanen
Status: Merged
Merged at revision: 208
Proposed branch: lp:~jpakkane/grail/fix_oos_tests
Merge into: lp:grail
Diff against target: 235 lines (+22/-21)
12 files modified
test/Makefile.am (+1/-0)
test/check-mapping.cpp (+1/-1)
test/check-transform.cpp (+1/-1)
test/device.cpp (+2/-2)
test/x11/atomic-timeout.cpp (+2/-2)
test/x11/dragthresh.cpp (+3/-3)
test/x11/no-premature-gestures.cpp (+2/-2)
test/x11/no-tap-after-drag.cpp (+2/-2)
test/x11/parallel-atomic-gestures.cpp (+2/-2)
test/x11/tap-touch-accept.cpp (+2/-2)
test/x11/timeout.cpp (+2/-2)
test/x11/twodrag.cpp (+2/-2)
To merge this branch: bzr merge lp:~jpakkane/grail/fix_oos_tests
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+98992@code.launchpad.net

Description of the change

Make tests work when using an out-of-source build.

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

I'm OK with this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/Makefile.am'
2--- test/Makefile.am 2012-03-21 20:34:27 +0000
3+++ test/Makefile.am 2012-03-23 09:48:19 +0000
4@@ -53,6 +53,7 @@
5 -I$(top_srcdir) \
6 -I$(top_srcdir)/include \
7 -I../include \
8+ -DTEST_ROOT_DIR=\"$(abs_top_srcdir)/test/\"\
9 $(WARNING_CPPFLAGS) \
10 $(GTEST_CPPFLAGS) \
11 $(XORG_GTEST_CPPFLAGS)
12
13=== modified file 'test/check-mapping.cpp'
14--- test/check-mapping.cpp 2011-11-30 20:10:59 +0000
15+++ test/check-mapping.cpp 2012-03-23 09:48:19 +0000
16@@ -37,7 +37,7 @@
17 ge_.gesture = TpGesture;
18 ge_.priv = this;
19
20- fd_ = open("io/evemu/one-tap.evemu", O_RDONLY | O_NONBLOCK);
21+ fd_ = open(TEST_ROOT_DIR "io/evemu/one-tap.evemu", O_RDONLY | O_NONBLOCK);
22
23 if (0 != grail_open(&ge_, fd_))
24 throw std::runtime_error(
25
26=== modified file 'test/check-transform.cpp'
27--- test/check-transform.cpp 2011-11-30 20:10:59 +0000
28+++ test/check-transform.cpp 2012-03-23 09:48:19 +0000
29@@ -39,7 +39,7 @@
30 }
31
32 void SetUp() {
33- fp_ = fopen("io/evemu/one-tap.evemu", "r");
34+ fp_ = fopen(TEST_ROOT_DIR "io/evemu/one-tap.evemu", "r");
35 if (!fp_)
36 throw std::runtime_error(
37 "Error opening pre-recorded events file io/evemu/one-tap.evemu.");
38
39=== modified file 'test/device.cpp'
40--- test/device.cpp 2012-01-25 02:37:56 +0000
41+++ test/device.cpp 2012-03-23 09:48:19 +0000
42@@ -36,11 +36,11 @@
43
44 FILE* fp = fopen(path, "r");
45 if (fp == NULL)
46- throw std::runtime_error("Failed to open device file");
47+ throw std::runtime_error(std::string("Failed to open device file ") + path);
48
49 if (evemu_read(device_, fp) <= 0) {
50 fclose(fp);
51- throw std::runtime_error("Failed to read device file");
52+ throw std::runtime_error(std::string("Failed to read device file ") + path);
53 }
54
55 fclose(fp);
56
57=== modified file 'test/x11/atomic-timeout.cpp'
58--- test/x11/atomic-timeout.cpp 2012-03-20 21:07:39 +0000
59+++ test/x11/atomic-timeout.cpp 2012-03-23 09:48:19 +0000
60@@ -167,14 +167,14 @@
61 }
62
63 TEST_F(AtomicTap, Recording) {
64- utouch::evemu::Device device("recordings/ntrig_dell_xt2/device.prop");
65+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/ntrig_dell_xt2/device.prop");
66
67 /* Pump once to ensure the X server has initialized the device */
68 PumpEvents();
69 ASSERT_NE(nullptr, device_) << "X server failed to initialize touchscreen";
70
71 utouch::evemu::Recording recording(device,
72- "recordings/ntrig_dell_xt2/2_tap.record");
73+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/2_tap.record");
74
75 recording.Play();
76
77
78=== modified file 'test/x11/dragthresh.cpp'
79--- test/x11/dragthresh.cpp 2012-03-20 19:51:47 +0000
80+++ test/x11/dragthresh.cpp 2012-03-23 09:48:19 +0000
81@@ -152,7 +152,7 @@
82 }
83
84 TEST_F(DragThreshold, Recording) {
85- utouch::evemu::Device device("recordings/ntrig_dell_xt2/device.prop");
86+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/ntrig_dell_xt2/device.prop");
87
88 /* Pump once to ensure the X server has initialized the device */
89 PumpEvents();
90@@ -162,7 +162,7 @@
91
92 utouch::evemu::Recording bad_drag(
93 device,
94- "recordings/ntrig_dell_xt2/drag_below_thresh.record");
95+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/drag_below_thresh.record");
96
97 bad_drag.Play();
98
99@@ -172,7 +172,7 @@
100
101 utouch::evemu::Recording good_drag(
102 device,
103- "recordings/ntrig_dell_xt2/drag_above_thresh.record");
104+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/drag_above_thresh.record");
105
106 good_drag.Play();
107
108
109=== modified file 'test/x11/no-premature-gestures.cpp'
110--- test/x11/no-premature-gestures.cpp 2012-03-20 19:51:47 +0000
111+++ test/x11/no-premature-gestures.cpp 2012-03-23 09:48:19 +0000
112@@ -198,7 +198,7 @@
113 }
114
115 TEST_F(NoPrematureGestures, Recording) {
116- utouch::evemu::Device device("recordings/apple_magic_trackpad/device.prop");
117+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/apple_magic_trackpad/device.prop");
118
119 /* Pump once to ensure the X server has initialized the device */
120 PumpEvents();
121@@ -206,7 +206,7 @@
122
123 utouch::evemu::Recording recording(
124 device,
125- "recordings/apple_magic_trackpad/synced_4_drag.record");
126+ TEST_ROOT_DIR "recordings/apple_magic_trackpad/synced_4_drag.record");
127
128 recording.Play();
129
130
131=== modified file 'test/x11/no-tap-after-drag.cpp'
132--- test/x11/no-tap-after-drag.cpp 2012-03-20 19:51:47 +0000
133+++ test/x11/no-tap-after-drag.cpp 2012-03-23 09:48:19 +0000
134@@ -190,7 +190,7 @@
135 }
136
137 void NoTapAfterDrag::SetupEvEmuDeviceAndRun() {
138- utouch::evemu::Device device("recordings/apple_magic_trackpad/device.prop");
139+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/apple_magic_trackpad/device.prop");
140
141 /* Pump once to ensure the X server has initialized the device */
142 PumpEvents();
143@@ -198,7 +198,7 @@
144
145 utouch::evemu::Recording recording(
146 device,
147- "recordings/apple_magic_trackpad/4_drag.record");
148+ TEST_ROOT_DIR "recordings/apple_magic_trackpad/4_drag.record");
149
150 recording.Play();
151
152
153=== modified file 'test/x11/parallel-atomic-gestures.cpp'
154--- test/x11/parallel-atomic-gestures.cpp 2012-03-22 13:38:23 +0000
155+++ test/x11/parallel-atomic-gestures.cpp 2012-03-23 09:48:19 +0000
156@@ -366,7 +366,7 @@
157 }
158
159 TEST_F(ParallelAtomicGestures, Recording) {
160- utouch::evemu::Device device("recordings/apple_magic_trackpad/device.prop");
161+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/apple_magic_trackpad/device.prop");
162
163 /* Pump once to ensure the X server has initialized the device */
164 PumpEvents();
165@@ -374,7 +374,7 @@
166
167 utouch::evemu::Recording recording(
168 device,
169- "recordings/apple_magic_trackpad/3_drag_ended_by_4th_touch.record");
170+ TEST_ROOT_DIR "recordings/apple_magic_trackpad/3_drag_ended_by_4th_touch.record");
171
172 recording.Play();
173
174
175=== modified file 'test/x11/tap-touch-accept.cpp'
176--- test/x11/tap-touch-accept.cpp 2012-03-21 19:15:27 +0000
177+++ test/x11/tap-touch-accept.cpp 2012-03-23 09:48:19 +0000
178@@ -210,14 +210,14 @@
179 }
180
181 TEST_F(TapTouchAccept, Recording) {
182- utouch::evemu::Device device("recordings/ntrig_dell_xt2/device.prop");
183+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/ntrig_dell_xt2/device.prop");
184
185 /* Pump once to ensure the X server has initialized the device */
186 PumpEvents();
187 ASSERT_NE(nullptr, device_) << "X server failed to initialize touchscreen";
188
189 utouch::evemu::Recording recording(device,
190- "recordings/ntrig_dell_xt2/1_tap.record");
191+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/1_tap.record");
192
193 recording.Play();
194
195
196=== modified file 'test/x11/timeout.cpp'
197--- test/x11/timeout.cpp 2012-03-20 19:51:47 +0000
198+++ test/x11/timeout.cpp 2012-03-23 09:48:19 +0000
199@@ -228,14 +228,14 @@
200 }
201
202 TEST_F(Timeout, Recording) {
203- utouch::evemu::Device device("recordings/ntrig_dell_xt2/device.prop");
204+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/ntrig_dell_xt2/device.prop");
205
206 /* Pump once to ensure the X server has initialized the device */
207 PumpEvents();
208 ASSERT_NE(nullptr, device_) << "X server failed to initialize touchscreen";
209
210 utouch::evemu::Recording bad_drag(device,
211- "recordings/ntrig_dell_xt2/timeout.record");
212+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/timeout.record");
213
214 bad_drag.Play();
215
216
217=== modified file 'test/x11/twodrag.cpp'
218--- test/x11/twodrag.cpp 2012-03-20 21:07:39 +0000
219+++ test/x11/twodrag.cpp 2012-03-23 09:48:19 +0000
220@@ -201,14 +201,14 @@
221 }
222
223 TEST_F(TwoDrag, Recording) {
224- utouch::evemu::Device device("recordings/ntrig_dell_xt2/device.prop");
225+ utouch::evemu::Device device(TEST_ROOT_DIR "recordings/ntrig_dell_xt2/device.prop");
226
227 /* Pump once to ensure the X server has initialized the device */
228 PumpEvents();
229 ASSERT_NE(nullptr, device_) << "X server failed to initialize touchscreen";
230
231 utouch::evemu::Recording recording(device,
232- "recordings/ntrig_dell_xt2/2_drag.record");
233+ TEST_ROOT_DIR "recordings/ntrig_dell_xt2/2_drag.record");
234
235 recording.Play();
236

Subscribers

People subscribed via source and target branches