[tracker/functional-test: 5/18] Test files and expected data for the extraction test-cases



commit 11a5a24367b081e3827c5fe8150c24374a5c5363
Author: Ivan Frade <ivan frade nokia com>
Date:   Wed Aug 18 18:23:26 2010 +0300

    Test files and expected data for the extraction test-cases

 .../test-extraction-data/Makefile.am               |    3 +
 tests/functional-tests/test-extraction-data/README |   56 ++++++++++++++++++++
 .../test-extraction-data/audio/Makefile.am         |   11 ++++
 .../audio/audio-test-1.expected                    |   19 +++++++
 .../test-extraction-data/audio/audio-test-1.mp3    |  Bin 0 -> 61547 bytes
 .../audio/audio-test-2.expected                    |   19 +++++++
 .../test-extraction-data/audio/audio-test-2.mp3    |  Bin 0 -> 65536 bytes
 .../test-extraction-data/images/Makefile.am        |   13 +++++
 .../images/corrupted-image.expected                |    8 +++
 .../images/corrupted-image.gif                     |  Bin 0 -> 224 bytes
 .../images/test-image-1.expected                   |   21 +++++++
 .../test-extraction-data/images/test-image-1.jpg   |  Bin 0 -> 7558 bytes
 .../images/test-image-2.expected                   |   11 ++++
 .../test-extraction-data/images/test-image-2.png   |  Bin 0 -> 2374 bytes
 .../images/test-image-3.expected                   |   13 +++++
 .../test-extraction-data/images/test-image-3.tif   |  Bin 0 -> 4594 bytes
 .../test-extraction-data/office/Makefile.am        |   13 +++++
 .../test-extraction-data/office/office-doc.doc     |  Bin 0 -> 82944 bytes
 .../office/office-doc.expected                     |   10 ++++
 .../test-extraction-data/office/pdf-doc.expected   |    9 +++
 .../test-extraction-data/office/pdf-doc.pdf        |  Bin 0 -> 236639 bytes
 .../office/powerpoint.expected                     |    9 +++
 .../test-extraction-data/office/powerpoint.ppt     |  Bin 0 -> 1508864 bytes
 .../test-extraction-data/video/184505.expected     |   12 ++++
 .../test-extraction-data/video/184505.mp4          |  Bin 0 -> 74438 bytes
 .../test-extraction-data/video/Makefile.am         |   13 +++++
 .../test-extraction-data/video/video-1.expected    |   11 ++++
 .../test-extraction-data/video/video-1.mp4         |  Bin 0 -> 211931 bytes
 .../test-extraction-data/video/video-2.expected    |   11 ++++
 .../test-extraction-data/video/video-2.mov         |  Bin 0 -> 170678 bytes
 30 files changed, 262 insertions(+), 0 deletions(-)
---
diff --git a/tests/functional-tests/test-extraction-data/Makefile.am b/tests/functional-tests/test-extraction-data/Makefile.am
new file mode 100644
index 0000000..c9e3f9c
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/Makefile.am
@@ -0,0 +1,3 @@
+include $(top_srcdir)/Makefile.decl
+
+SUBDIRS = audio images office video
\ No newline at end of file
diff --git a/tests/functional-tests/test-extraction-data/README b/tests/functional-tests/test-extraction-data/README
new file mode 100644
index 0000000..149c0f9
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/README
@@ -0,0 +1,56 @@
+test-extraction-data
+====================
+
+The python test will traverse recursively this directory, loading the .expected files as tests.
+
+.expected file format
+=====================
+
+It is a .ini (.desktop) formatted file with two mandatory sections: TestFile and Metadata.
+Optionally there can be a "Meego" section, for metadata that should be checked only on that platform.
+Adding more platforms is fairly trivial but requires to modify the python code.
+
+The TestFile section contains the 
+* Filename (mandatory): relative path from the .expected of the file under test.
+* Bugzilla (optional): reference to a bug related with the file.
+* Comment (optional): brief description of why that file is in the test suite (problematic, format example...)
+* ExpectedFailure (optional): If this key is present, we expect the extraction to fail.
+    If ExpectedFailure is included, it is recommended to fill the Bugzilla field! 
+
+The Metadata section contains pairs of property=values with few special rules:
+1. The ':' in the properties is replaced with Í?_'. Note that in the values is ok to have ':'.
+  
+   E.G.    nfo:duration=5 -> nfo_duration=5
+       but a=nmm:Video    -> a=nmm:Video 
+
+2. If the property name is prefixed with '!' then the property is NOT expected in the extraction
+   If the negated property has a value, it forbids the exact value. Otherwise, it forbids the property at all.
+
+   E.G.   The extraction is:    a nmm:Video; nfo:duration 50.
+
+       !a=nmm:Audio     -> PASS because there is no "a nmm:Audio"
+       !nfo_duration=12 -> PASS because duration has a different value
+       !nfo_duration=   -> FAIL because there shouldn't be any nfo:duration at all
+
+3. The translation of the extraction results to a python dictionary is very basic. 
+   It handles a couple of special cases, relevant for testing:
+
+  mlo:location [a mlo:GeoPoint; mlo:city "XXX"]    -> mlo_location_city=XXX
+  mlo:location [a mlo:GeoPoint; mlo:country "XXX"] -> mlo_location_country=XXX
+  nao:hasTag [a nao:Tag; nao:prefLabel "XXX"]      -> nao_hasTag_prefLabel=XXX
+
+Example
+======
+
+Everything together should look like this:
+
+[TestFile]
+Filename=x.mp4
+Bugzilla=GB#123123
+Comment=Video usually clasiffied as Audio by mistake
+
+[Metadata]
+a=nmm:Video
+!a=nmm:Audio
+nfo_duration=123
+
diff --git a/tests/functional-tests/test-extraction-data/audio/Makefile.am b/tests/functional-tests/test-extraction-data/audio/Makefile.am
new file mode 100644
index 0000000..4744a5b
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/audio/Makefile.am
@@ -0,0 +1,11 @@
+include $(top_srcdir)/Makefile.decl
+
+audiotestdir = $(datadir)/tracker-tests/test-extraction-data/audio
+
+audiotest_DATA =		\
+	audio-test-1.mp3	\
+	audio-test-1.expected	\
+	audio-test-2.mp3	\
+	audio-test-2.expected
+
+EXTRA_DIST = $(audiotest_DATA)
\ No newline at end of file
diff --git a/tests/functional-tests/test-extraction-data/audio/audio-test-1.expected b/tests/functional-tests/test-extraction-data/audio/audio-test-1.expected
new file mode 100644
index 0000000..8759962
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/audio/audio-test-1.expected
@@ -0,0 +1,19 @@
+[TestFile]
+Filename=audio-test-1.mp3
+Bugzilla=
+Comment=Basic MP3 example
+
+[Metadata]
+a=nmm:MusicPiece
+nie_title=Simply Juvenile
+nfo_genre=Pop
+nie_copyright=none
+nie_comment=I am for simple MP3 testing
+nmm_trackNumber=13
+nfo_codec=MPEG
+nfo_channels=1
+nfo_duration=15
+nfo_sampleRate=22050
+nfo_averageBitrate=32000
+
+[Meego]
diff --git a/tests/functional-tests/test-extraction-data/audio/audio-test-1.mp3 b/tests/functional-tests/test-extraction-data/audio/audio-test-1.mp3
new file mode 100644
index 0000000..bbd4c76
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/audio/audio-test-1.mp3 differ
diff --git a/tests/functional-tests/test-extraction-data/audio/audio-test-2.expected b/tests/functional-tests/test-extraction-data/audio/audio-test-2.expected
new file mode 100644
index 0000000..0ab85f9
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/audio/audio-test-2.expected
@@ -0,0 +1,19 @@
+[TestFile]
+Filename=audio-test-2.mp3
+Bugzilla=NB#177663
+Comment=Mp3 with id3v2 tags. Encoded wasn't extracted.
+ Binary cut with dd of the original file.
+
+[Metadata]
+a=nmm:MusicPiece
+nie_title=Vinegar
+nfo_genre=Pop
+nie_copyright=(P) 2008 Sony Music Entertainment Finland Oy
+nmm_trackNumber=1
+nfo_codec=MPEG
+nfo_channels=2
+nfo_sampleRate=44100
+nfo_averageBitrate=256000
+
+[Meego]
+nfo_encodedBy=Nokia Music
diff --git a/tests/functional-tests/test-extraction-data/audio/audio-test-2.mp3 b/tests/functional-tests/test-extraction-data/audio/audio-test-2.mp3
new file mode 100644
index 0000000..d8a176f
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/audio/audio-test-2.mp3 differ
diff --git a/tests/functional-tests/test-extraction-data/images/Makefile.am b/tests/functional-tests/test-extraction-data/images/Makefile.am
new file mode 100644
index 0000000..17da26a
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/images/Makefile.am
@@ -0,0 +1,13 @@
+include $(top_srcdir)/Makefile.decl
+
+imagestestdir = $(datadir)/tracker-tests/test-extraction-data/images
+
+imagestest_DATA =		\
+	test-image-1.jpg	\
+	test-image-1.expected	\
+	test-image-2.png	\
+	test-image-2.expected 	\
+	test-image-3.tif	\
+	test-image-3.expected
+
+EXTRA_DIST = $(imagestest_DATA)
diff --git a/tests/functional-tests/test-extraction-data/images/corrupted-image.expected b/tests/functional-tests/test-extraction-data/images/corrupted-image.expected
new file mode 100644
index 0000000..d435fb3
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/images/corrupted-image.expected
@@ -0,0 +1,8 @@
+[TestFile]
+Filename=corrupted-image.gif
+Bugzilla=NB#184882
+Comment=This image make the extractor crash
+ExpectedFailure=
+
+[Metadata]
+a=nmm:Photo
diff --git a/tests/functional-tests/test-extraction-data/images/corrupted-image.gif b/tests/functional-tests/test-extraction-data/images/corrupted-image.gif
new file mode 100644
index 0000000..d179201
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/images/corrupted-image.gif differ
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-1.expected b/tests/functional-tests/test-extraction-data/images/test-image-1.expected
new file mode 100644
index 0000000..ce3f682
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/images/test-image-1.expected
@@ -0,0 +1,21 @@
+[TestFile]
+Filename=test-image-1.jpg
+Bugzilla=
+Comment=Basic jpeg example
+
+[Metadata]
+a=nmm:Photo
+nfo_width=699
+nfo_height=464
+nao_hasTag_prefLabel=test
+nao_hasTag_prefLabel=tracker
+nie_title=Kid
+nmm_fnumber=5
+nmm_focalLength=5
+nie_comment=This is a for tracker test
+mlo_location_city=Tig
+mlo_location_country=Banglore
+nfo_horizontalResolution=20
+nfo_verticalResolution=20
+
+[Meego]
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-1.jpg b/tests/functional-tests/test-extraction-data/images/test-image-1.jpg
new file mode 100644
index 0000000..f1f917b
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/images/test-image-1.jpg differ
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-2.expected b/tests/functional-tests/test-extraction-data/images/test-image-2.expected
new file mode 100644
index 0000000..5264068
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/images/test-image-2.expected
@@ -0,0 +1,11 @@
+[TestFile]
+Filename=test-image-2.png
+Bugzilla=
+Comment=Basic png example
+
+[Metadata]
+a=nmm:Photo
+nfo_width=211
+nfo_height=217
+
+[Meego]
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-2.png b/tests/functional-tests/test-extraction-data/images/test-image-2.png
new file mode 100644
index 0000000..7ff9788
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/images/test-image-2.png differ
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-3.expected b/tests/functional-tests/test-extraction-data/images/test-image-3.expected
new file mode 100644
index 0000000..7aab615
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/images/test-image-3.expected
@@ -0,0 +1,13 @@
+[TestFile]
+Filename=test-image-3.tif
+Bugzilla=
+Comment=Basic TIFF example
+
+[Metadata]
+a=nmm:Photo
+nfo_width=37
+nfo_height=39
+nie_title=/home/amit/Desktop/test-image-3.tif
+nfo_orientation=nfo:orientation-top-mirror
+
+[Meego]
diff --git a/tests/functional-tests/test-extraction-data/images/test-image-3.tif b/tests/functional-tests/test-extraction-data/images/test-image-3.tif
new file mode 100644
index 0000000..8d91556
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/images/test-image-3.tif differ
diff --git a/tests/functional-tests/test-extraction-data/office/Makefile.am b/tests/functional-tests/test-extraction-data/office/Makefile.am
new file mode 100644
index 0000000..71d070a
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/office/Makefile.am
@@ -0,0 +1,13 @@
+include $(top_srcdir)/Makefile.decl
+
+officetestdir = $(datadir)/tracker-tests/test-extraction-data/office
+
+officetest_DATA =		\
+	office-doc.doc		\
+	office-doc.expected	\
+	pdf-doc.pdf		\
+	pdf-doc.expected	\
+	powerpoint.ppt		\
+	powerpoint.expected
+
+EXTRA_DIST = $(officetest_DATA)
\ No newline at end of file
diff --git a/tests/functional-tests/test-extraction-data/office/office-doc.doc b/tests/functional-tests/test-extraction-data/office/office-doc.doc
new file mode 100644
index 0000000..8450cdd
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/office/office-doc.doc differ
diff --git a/tests/functional-tests/test-extraction-data/office/office-doc.expected b/tests/functional-tests/test-extraction-data/office/office-doc.expected
new file mode 100644
index 0000000..df85285
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/office/office-doc.expected
@@ -0,0 +1,10 @@
+[TestFile]
+Filename=office-doc.doc
+Comment=MS Office document (unknown version)
+
+[Metadata]
+a=nfo:PaginatedTextDocument
+nie_generator=Microsoft Word 10.0
+nfo_wordCount=3053
+nie_title=Public Comments on Performance Based Payments
+nco_creator_fullname=capitadj
diff --git a/tests/functional-tests/test-extraction-data/office/pdf-doc.expected b/tests/functional-tests/test-extraction-data/office/pdf-doc.expected
new file mode 100644
index 0000000..93de5b7
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/office/pdf-doc.expected
@@ -0,0 +1,9 @@
+[TestFile]
+Filename=pdf-doc.pdf
+Comment=PDF document from the office tools
+
+[Metadata]
+
+[Meego]
+a=nfo:PaginatedTextDocument
+nfo_pageCount=22
diff --git a/tests/functional-tests/test-extraction-data/office/pdf-doc.pdf b/tests/functional-tests/test-extraction-data/office/pdf-doc.pdf
new file mode 100644
index 0000000..064645c
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/office/pdf-doc.pdf differ
diff --git a/tests/functional-tests/test-extraction-data/office/powerpoint.expected b/tests/functional-tests/test-extraction-data/office/powerpoint.expected
new file mode 100644
index 0000000..a21d8c3
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/office/powerpoint.expected
@@ -0,0 +1,9 @@
+[TestFile]
+Filename=powerpoint.ppt
+Comment=Powerpoint document (unknown version!)
+
+[Metadata]
+a=nfo:PaginatedTextDocument
+nie_generator=Microsoft PowerPoint
+nfo_wordCount=573
+nie_title=ARTificial Life
diff --git a/tests/functional-tests/test-extraction-data/office/powerpoint.ppt b/tests/functional-tests/test-extraction-data/office/powerpoint.ppt
new file mode 100644
index 0000000..2fc0a73
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/office/powerpoint.ppt differ
diff --git a/tests/functional-tests/test-extraction-data/video/184505.expected b/tests/functional-tests/test-extraction-data/video/184505.expected
new file mode 100644
index 0000000..c2a9839
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/video/184505.expected
@@ -0,0 +1,12 @@
+[TestFile]
+Filename=184505.mp4
+Bugzilla=NB#184505
+Comment=Video without audio stream. Seems to be clasified as Audio.
+
+[Metadata]
+a=nmm:Video
+!a=nmm:Audio
+
+[Meego]
+nfo_height=480
+nfo_width=864
diff --git a/tests/functional-tests/test-extraction-data/video/184505.mp4 b/tests/functional-tests/test-extraction-data/video/184505.mp4
new file mode 100644
index 0000000..7fc8151
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/video/184505.mp4 differ
diff --git a/tests/functional-tests/test-extraction-data/video/Makefile.am b/tests/functional-tests/test-extraction-data/video/Makefile.am
new file mode 100644
index 0000000..9814722
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/video/Makefile.am
@@ -0,0 +1,13 @@
+include $(top_srcdir)/Makefile.decl
+
+if DIST_FUNCTIONAL_TESTS
+videotestdir = $(datadir)/tracker-tests/test-extraction-data/video
+
+videotest_DATA =			\
+	video-1.mp4			\
+	video-1.expected		\
+	video-2.mov			\
+	video-2.expected
+
+EXTRA_DIST = $(videotest_DATA)
+endif
diff --git a/tests/functional-tests/test-extraction-data/video/video-1.expected b/tests/functional-tests/test-extraction-data/video/video-1.expected
new file mode 100644
index 0000000..aaa28be
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/video/video-1.expected
@@ -0,0 +1,11 @@
+[TestFile]
+Filename=video-1.mp4
+Comment=Just one standard mp4
+[Metadata]
+a=nmm:Video
+nie_title=MPEG-4-x264.mp4
+nfo_codec=MPEG-4 AAC audio
+
+[Meego]
+nfo_height=240
+nfo_width=320
diff --git a/tests/functional-tests/test-extraction-data/video/video-1.mp4 b/tests/functional-tests/test-extraction-data/video/video-1.mp4
new file mode 100644
index 0000000..915e4be
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/video/video-1.mp4 differ
diff --git a/tests/functional-tests/test-extraction-data/video/video-2.expected b/tests/functional-tests/test-extraction-data/video/video-2.expected
new file mode 100644
index 0000000..a738c85
--- /dev/null
+++ b/tests/functional-tests/test-extraction-data/video/video-2.expected
@@ -0,0 +1,11 @@
+[TestFile]
+Filename=video-2.mov
+Bugzilla=NB#181112
+Comment=Produces a Critical in Gstreamer freeing a component.
+
+[Metadata]
+a=nmm:Video
+
+[Meego]
+nfo_height=144
+nfo_width=192
diff --git a/tests/functional-tests/test-extraction-data/video/video-2.mov b/tests/functional-tests/test-extraction-data/video/video-2.mov
new file mode 100644
index 0000000..6e8eaa7
Binary files /dev/null and b/tests/functional-tests/test-extraction-data/video/video-2.mov differ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]