Skip to content

Commit

Permalink
[tests] Initial commit
Browse files Browse the repository at this point in the history
Note: when building with Qt5, the warning
"QDBusConnectionPrivate::disconnectRelay called for a signal that was not
found" is issued a number of times - this is fixed in recent Qt versions.

Relates NEMO#684
  • Loading branch information
martyone committed Jul 9, 2013
1 parent d67c3eb commit c83bbef
Show file tree
Hide file tree
Showing 14 changed files with 1,344 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ isEmpty(PREFIX) {
PREFIX = /usr/local
}
TEMPLATE = subdirs
SUBDIRS += src declarative
SUBDIRS += src declarative tests

# No need to build this, but if you want then 'qmake EXAMPLE=1 && make'
count(EXAMPLE, 1) {
Expand Down
17 changes: 15 additions & 2 deletions rpm/libngf-qt.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Do NOT Edit the Auto-generated Part!
# Generated by: spectacle version 0.25
# Generated by: spectacle version 0.26
#

Name: libngf-qt
Expand All @@ -22,6 +22,7 @@ Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtDBus)
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(QtTest)
BuildRequires: doxygen

%description
Expand All @@ -45,6 +46,13 @@ Requires: %{name} = %{version}-%{release}
%description declarative
%{summary}.

%package tests
Summary: Test suite for libngf-qt
Group: System/Libraries
Requires: %{name} = %{version}-%{release}

%description tests
%{summary}.

%prep
%setup -q -n %{name}-%{version}
Expand Down Expand Up @@ -73,7 +81,6 @@ rm -rf %{buildroot}
# >> install post
# << install post


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig
Expand All @@ -98,3 +105,9 @@ rm -rf %{buildroot}
%{_libdir}/qt4/imports/org/nemomobile/ngf/*
# >> files declarative
# << files declarative

%files tests
%defattr(-,root,root,-)
/opt/tests/libngf-qt/*
# >> files tests
# << files tests
8 changes: 8 additions & 0 deletions rpm/libngf-qt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PkgConfigBR:
- QtCore
- QtDBus
- QtDeclarative
- QtTest
Configure: none
Builder: qmake
Files:
Expand All @@ -41,3 +42,10 @@ SubPackages:
Files:
- "%{_libdir}/qt4/imports/org/nemomobile/ngf/*"

- Name: tests
Summary: Test suite for libngf-qt
Group: System/Libraries
Description: "%{summary}."
Files:
- "/opt/tests/libngf-qt/*"

15 changes: 15 additions & 0 deletions rpm/libngf-qt5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: doxygen

%description
Expand All @@ -47,6 +48,14 @@ Requires: %{name} = %{version}-%{release}
%description declarative
%{summary}.

%package tests
Summary: Test suite for libngf-qt5
Group: System/Libraries
Requires: %{name} = %{version}-%{release}

%description tests
%{summary}.

%prep
%setup -q -n %{name}-%{version}

Expand Down Expand Up @@ -97,3 +106,9 @@ rm -rf %{buildroot}
%{_libdir}/qt5/qml/org/nemomobile/ngf/*
# >> files declarative
# << files declarative

%files tests
%defattr(-,root,root,-)
/opt/tests/libngf-qt5/*
# >> files tests
# << files tests
8 changes: 8 additions & 0 deletions rpm/libngf-qt5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PkgConfigBR:
- Qt5Quick
- Qt5Qml # temporary, try remove after qt5.0.2 (.pc file doesn't specify Requires properly)
- Qt5Gui # temporary, try remove after qt5.0.2 (.pc file doesn't specify Requires properly)
- Qt5Test
Configure: none
Builder: qmake5
Files:
Expand All @@ -43,3 +44,10 @@ SubPackages:
Files:
- "%{_libdir}/qt5/qml/org/nemomobile/ngf/*"

- Name: tests
Summary: Test suite for libngf-qt5
Group: System/Libraries
Description: "%{summary}."
Files:
- "/opt/tests/libngf-qt5/*"

23 changes: 23 additions & 0 deletions tests/testapplication.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include(tests_common.pri)

pro_file_basename = $$basename(_PRO_FILE_)
pro_file_basename ~= s/\\.pro$//

TEMPLATE = app
TARGET = $${pro_file_basename}

QT += dbus testlib

HEADERS = testbase.h
SOURCES = $${pro_file_basename}.cpp

INCLUDEPATH += ../src/include
LIBS += -L../src -lngf-qt$${NODASH_QT_VERSION}

target.path = $${INSTALL_TESTDIR}
INSTALLS += target

check.depends = all
check.commands = 'false The variable check.commands must be set in $${_PRO_FILE_}'
check.CONFIG = phony
QMAKE_EXTRA_TARGETS += check
Loading

0 comments on commit c83bbef

Please sign in to comment.