Merge lp:~pete-woods/indicator-network/tests-not-run-lp1612619 into lp:indicator-network

Proposed by Pete Woods
Status: Merged
Approved by: Pete Woods
Approved revision: 624
Merged at revision: 622
Proposed branch: lp:~pete-woods/indicator-network/tests-not-run-lp1612619
Merge into: lp:indicator-network
Diff against target: 98 lines (+35/-6)
3 files modified
CMakeLists.txt (+8/-0)
debian/rules (+8/-4)
tests/integration/test-indicator.cpp (+19/-2)
To merge this branch: bzr merge lp:~pete-woods/indicator-network/tests-not-run-lp1612619
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+302916@code.launchpad.net

Commit message

Re-enable tests on all architectures

Description of the change

Re-enable tests on all architectures

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-06-20 11:06:20 +0000
3+++ CMakeLists.txt 2016-08-17 11:48:25 +0000
4@@ -113,6 +113,7 @@
5 add_subdirectory(po)
6 add_subdirectory(doc)
7
8+if(ENABLE_TESTS)
9 enable_testing()
10 add_subdirectory(tests)
11
12@@ -138,6 +139,13 @@
13 ${CMAKE_BINARY_DIR}/*
14 )
15
16+else()
17+
18+# The autopilot tests need this fixture
19+add_subdirectory(tests/data)
20+
21+endif()
22+
23 endif()
24
25 add_subdirectory(scripts)
26
27=== modified file 'debian/rules'
28--- debian/rules 2015-12-16 11:48:00 +0000
29+++ debian/rules 2016-08-17 11:48:25 +0000
30@@ -7,13 +7,17 @@
31
32 export DPKG_GENSYMBOLS_CHECK_LEVEL = 4
33
34+ifneq (,$(filter $(DEB_HOST_ARCH),arm64 s390x powerpc))
35+ ENABLE_TESTS = OFF
36+else
37+ ENABLE_TESTS = ON
38+endif
39+
40 %:
41 dh $@ --parallel --fail-missing --with python3
42
43-ifneq (,filter(s390x ,$(DEB_HOST_ARCH)))
44-override_dh_auto_test:
45- dh_auto_test || true
46-endif
47+override_dh_auto_configure:
48+ dh_auto_configure -- -DENABLE_TESTS=${ENABLE_TESTS}
49
50 override_dh_install:
51 cd tests/autopilot; \
52
53=== modified file 'tests/integration/test-indicator.cpp'
54--- tests/integration/test-indicator.cpp 2016-07-15 11:25:21 +0000
55+++ tests/integration/test-indicator.cpp 2016-08-17 11:48:25 +0000
56@@ -3193,12 +3193,21 @@
57
58 ASSERT_NO_THROW(startIndicator());
59
60+
61+ auto modems = con->modems();
62+ QSignalSpy rowsInsertedSpy(modems, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
63+ if (modems->rowCount() == 0) {
64+ ASSERT_TRUE(rowsInsertedSpy.wait());
65+ }
66+
67+ ASSERT_EQ(1, modems->rowCount());
68+
69 // Check that the indicator switch is enabled when we are not in flightmode
70 // and there is a SIM for mobile data set.
71
72 con->setMobileDataEnabled(true);
73 con->setFlightMode(false);
74- con->setSimForMobileData(getModemSim(*con->modems(), 0));
75+ con->setSimForMobileData(getModemSim(*modems, 0));
76
77 EXPECT_MATCHRESULT(mh::MenuMatcher(phoneParameters())
78 .item(mh::MenuItemMatcher()
79@@ -3254,11 +3263,19 @@
80
81 ASSERT_NO_THROW(startIndicator());
82
83+ auto modems = con->modems();
84+ QSignalSpy rowsInsertedSpy(modems, SIGNAL(rowsInserted(const QModelIndex &, int, int)));
85+ if (modems->rowCount() == 0) {
86+ ASSERT_TRUE(rowsInsertedSpy.wait());
87+ }
88+
89+ ASSERT_EQ(1, modems->rowCount());
90+
91 // Check that Connectivity::mobileDataEnabled follows the indicator switch
92
93 con->setMobileDataEnabled(true);
94 con->setFlightMode(false);
95- con->setSimForMobileData(getModemSim(*con->modems(), 0));
96+ con->setSimForMobileData(getModemSim(*modems, 0));
97 QTest::qWait(250);
98 QSignalSpy spy(con.get(), SIGNAL(mobileDataEnabledUpdated(bool)));
99

Subscribers

People subscribed via source and target branches