Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests to /opt. JB#57272 #1

Merged
merged 2 commits into from Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions rpm/libquillmetadata-qt5.spec
@@ -1,9 +1,9 @@
Name: libquillmetadata-qt5
Summary: Qt based library for still image metadata manipulation
Version: 1.111111.0
Version: 2.0.0
Release: 0
License: LGPLv2 or GPLv3 or Qt Commercial or LGPLv2 with Nokia Qt LGPL Exception v1.1
URL: https://git.sailfishos.org/mer-core/quillmetadata
URL: https://github.com/sailfishos/quillmetadata
Source0: %{name}-%{version}.tar.bz2
Requires: qt5-plugin-imageformat-jpeg
Requires(post): /sbin/ldconfig
Expand Down Expand Up @@ -72,8 +72,7 @@ rm -rf %{buildroot}

%files tests
%defattr(-,root,root,-)
%{_datadir}/libquillmetadata-qt5-tests/*
%{_libdir}/libquillmetadata-qt5-tests/*
/opt/tests/libquillmetadata-qt5/

%files devel
%defattr(-,root,root,-)
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.pri
Expand Up @@ -22,7 +22,7 @@ LIBS += -lquillmetadata-qt5
QT += testlib

# --- install
target.path = $$[QT_INSTALL_LIBS]/libquillmetadata-qt5-tests/
target.path = /opt/tests/libquillmetadata-qt5/
INSTALLS += target

# --- clean
Expand Down
32 changes: 9 additions & 23 deletions tests/tests.pro
@@ -1,5 +1,3 @@
PACKAGENAME = libquillmetadata-qt5

TEMPLATE = subdirs

DEPENDPATH += .
Expand All @@ -10,27 +8,15 @@ CONFIG += ordered
SUBDIRS += ut_metadata \
ut_regions

# --- generate tests.xml
tests_xml.target = tests.xml
tests_xml.depends = $$PWD/tests.xml.in
tests_xml.commands = sed -e "s:@PACKAGENAME@:$${PACKAGENAME}:g" $< > $@

QMAKE_EXTRA_TARGETS = tests_xml
QMAKE_CLEAN += $$tests_xml.target
PRE_TARGETDEPS += $$tests_xml.target

# --- install
tatam.depends = tests_xml
tatam.files = $$tests_xml.target
tatam.path = $$(DESTDIR)/usr/share/$${PACKAGENAME}-tests/
tatam.CONFIG += no_check_exist
tests_xml.files = tests.xml
tests_xml.path = $$(DESTDIR)/opt/tests/libquillmetadata-qt5/

tatamimages.files += images/exif.jpg
tatamimages.files += images/xmp.jpg
tatamimages.files += images/iptc.jpg
tatamimages.files += images/gps.jpg
tatamimages.files += images/mnaa.jpg
images.files += images/exif.jpg
images.files += images/xmp.jpg
images.files += images/iptc.jpg
images.files += images/gps.jpg
images.files += images/mnaa.jpg

tatamimages.path = $${tatam.path}/images/
images.path = $${tests_xml.path}/images/

INSTALLS = tatam tatamimages
INSTALLS = tests_xml images
6 changes: 3 additions & 3 deletions tests/tests.xml.in → tests/tests.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<testdefinition version="0.1">
<suite name="@PACKAGENAME@-tests" domain="application-domain">
<suite name="libquillmetadata-qt5" domain="application-domain">
<description>Automated test cases for libquill</description>

<set name="@PACKAGENAME@-test0" feature="metadata">
<set name="libquillmetadata-qt5" feature="libquillmetadata">
<description>quill metadata test</description>
<case name="ut_metadata" type="Functional" level="Component">
<step>/usr/lib/@PACKAGENAME@-tests/ut_metadata </step>
<step>/opt/tests/libquillmetadata-qt5/ut_metadata </step>
</case>
</set>
</suite>
Expand Down
10 changes: 1 addition & 9 deletions tests/ut_metadata/ut_metadata.cpp
Expand Up @@ -48,11 +48,7 @@

ut_metadata::ut_metadata()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
imagePath = "/usr/share/libquillmetadata-qt5-tests/images/";
#else
imagePath = "/usr/share/libquillmetadata-tests/images/";
#endif
imagePath = "/opt/tests/libquillmetadata-qt5/images/";
}

void ut_metadata::initTestCase()
Expand Down Expand Up @@ -449,11 +445,7 @@ void ut_metadata::testWriteGps()
void ut_metadata::testGps_XmpExif()
{
// TODO: Stop skipping the test once that it becomes possible to only read XMP data
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QSKIP("Reading only XMP data is still unsupported");
#else
QSKIP("Reading only XMP data is still unsupported", SkipSingle);
#endif

QTemporaryFile file;
file.open();
Expand Down
6 changes: 1 addition & 5 deletions tests/ut_regions/ut_regions.cpp
Expand Up @@ -48,11 +48,7 @@

ut_regions::ut_regions()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
imagePath = "/usr/share/libquillmetadata-qt5-tests/images/";
#else
imagePath = "/usr/share/libquillmetadata-tests/images/";
#endif
imagePath = "/opt/tests/libquillmetadata-qt5/images/";
}

void ut_regions::initTestCase()
Expand Down