Commit 21a3941b authored by Adam Reichold's avatar Adam Reichold

Include unit test cases from separate test repository

As the only users of the TESTDATADIR parameter seem to be the Qt5 frontend
unit tests, this change includes the test data necessary to run them and
hence `make test` successfully directly in this repository. The configuration
parameter is thereby removed. The data is marked as non-exportable to avoid
bloating the source tarballs.
parent e5aff4b4
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
*/.gitignore export-ignore */.gitignore export-ignore
*/*/.gitignore export-ignore */*/.gitignore export-ignore
regtest export-ignore regtest export-ignore
qt5/tests/unittestcases/ export-ignore
...@@ -68,25 +68,6 @@ option(EXTRA_WARN "Enable extra compile warnings" OFF) ...@@ -68,25 +68,6 @@ option(EXTRA_WARN "Enable extra compile warnings" OFF)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.")
if(NOT (EXISTS ${TESTDATADIR} AND EXISTS ${TESTDATADIR}/test-poppler.c))
message(WARNING "
No test data found in $testdatadir.
You will not be able to run 'make test' successfully.
The test data is not included in the source packages
and is also not part of the main git repository. Instead,
you can checkout the test data from its own git
repository with:
git clone git://git.freedesktop.org/git/poppler/test
You should checkout the test data as a sibling of your
poppler source folder or specify the location of your
checkout with -DTESTDATADIR=/path/to/checkoutdir/test.
")
endif()
if(WIN32) if(WIN32)
set(_default_fontconfiguration "win32") set(_default_fontconfiguration "win32")
elseif(ANDROID) elseif(ANDROID)
...@@ -721,7 +702,6 @@ show_end_message_yesno("use curl" ENABLE_LIBCURL) ...@@ -721,7 +702,6 @@ show_end_message_yesno("use curl" ENABLE_LIBCURL)
show_end_message_yesno("use libopenjpeg2" WITH_OPENJPEG) show_end_message_yesno("use libopenjpeg2" WITH_OPENJPEG)
show_end_message_yesno("use lcms2" USE_CMS) show_end_message_yesno("use lcms2" USE_CMS)
show_end_message_yesno("command line utils" ENABLE_UTILS) show_end_message_yesno("command line utils" ENABLE_UTILS)
show_end_message("test data dir" ${TESTDATADIR})
if(NOT ENABLE_SPLASH AND NOT CAIRO_FOUND) if(NOT ENABLE_SPLASH AND NOT CAIRO_FOUND)
message("Warning: There is no rendering backend enabled") message("Warning: There is no rendering backend enabled")
......
add_definitions(${Qt5Core_DEFINITIONS}) add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(-DTESTDATADIR=\"${TESTDATADIR}\") add_definitions(-DTESTDATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}\")
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
......
...@@ -55,7 +55,7 @@ static bool operator==( const FontInfo &f1, const FontInfo &f2 ) ...@@ -55,7 +55,7 @@ static bool operator==( const FontInfo &f1, const FontInfo &f2 )
void TestFontsData::checkNoFonts() void TestFontsData::checkNoFonts()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/image.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/image.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts(); QList<Poppler::FontInfo> listOfFonts = doc->fonts();
...@@ -67,7 +67,7 @@ void TestFontsData::checkNoFonts() ...@@ -67,7 +67,7 @@ void TestFontsData::checkNoFonts()
void TestFontsData::checkType1() void TestFontsData::checkType1()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/text.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/text.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts(); QList<Poppler::FontInfo> listOfFonts = doc->fonts();
...@@ -85,7 +85,7 @@ void TestFontsData::checkType1() ...@@ -85,7 +85,7 @@ void TestFontsData::checkType1()
void TestFontsData::checkType3() void TestFontsData::checkType3()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts(); QList<Poppler::FontInfo> listOfFonts = doc->fonts();
...@@ -136,10 +136,10 @@ void TestFontsData::checkFontIterator() ...@@ -136,10 +136,10 @@ void TestFontsData::checkFontIterator()
{ {
// loading a 1-page document // loading a 1-page document
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc ); QVERIFY( doc );
// loading a 6-pages document // loading a 6-pages document
Poppler::Document *doc6 = Poppler::Document::load(TESTDATADIR "/tests/cropbox.pdf"); Poppler::Document *doc6 = Poppler::Document::load(TESTDATADIR "/unittestcases/cropbox.pdf");
QVERIFY( doc6 ); QVERIFY( doc6 );
std::unique_ptr< Poppler::FontIterator > it; std::unique_ptr< Poppler::FontIterator > it;
...@@ -190,7 +190,7 @@ void TestFontsData::checkFontIterator() ...@@ -190,7 +190,7 @@ void TestFontsData::checkFontIterator()
void TestFontsData::checkSecondDocumentQuery() void TestFontsData::checkSecondDocumentQuery()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts(); QList<Poppler::FontInfo> listOfFonts = doc->fonts();
...@@ -205,7 +205,7 @@ void TestFontsData::checkSecondDocumentQuery() ...@@ -205,7 +205,7 @@ void TestFontsData::checkSecondDocumentQuery()
void TestFontsData::checkMultipleIterations() void TestFontsData::checkMultipleIterations()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = loadFontsViaIterator( doc ); QList<Poppler::FontInfo> listOfFonts = loadFontsViaIterator( doc );
...@@ -219,7 +219,7 @@ void TestFontsData::checkMultipleIterations() ...@@ -219,7 +219,7 @@ void TestFontsData::checkMultipleIterations()
void TestFontsData::checkIteratorFonts() void TestFontsData::checkIteratorFonts()
{ {
Poppler::Document *doc; Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/fonts.pdf"); doc = Poppler::Document::load(TESTDATADIR "/unittestcases/fonts.pdf");
QVERIFY( doc ); QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts(); QList<Poppler::FontInfo> listOfFonts = doc->fonts();
......
About the unit test sample files.
These files are added in here to support unit testing of Poppler
functionality.
orientation.pdf: a file containing one page in each major
orientation. The first page is portrait, the next is landscape
(portrait rotated 90 degrees clockwise), the next is upside down
(portrait rotated 180 degrees), and the final is seascape (portrait
rotated 90 degrees counterclockwise).
This file has permissions set, such that only low resolution printing
is allowed, inserting, deleting and rotating pages is allowed, copying
content is not allowed, and text reading is allowed for accessibility.
The password is "foo".
FullScreen.pdf, UseAttachments.pdf, UseNone.pdf, UseOC.pdf,
UseThumbs.pdf: simple files demonstrating various PageMode
options (where the name of the file matches the PageMode option).
PasswordEncrypted.pdf: single blank page, created with
Acrobat 7. This is encrypted with AES128. The password is "password".
WithAttachments.pdf: a simple file with two files attached/ embedded.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment