...
 
Commits (2)
  • Adam Reichold's avatar
    Include unit test cases from separate test repository · 21a3941b
    Adam Reichold authored
    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.
    21a3941b
  • Adam Reichold's avatar
    Do not fetch test data for CI runs · 580f0d8e
    Adam Reichold authored
    Since the unit test data is now included in the main repository, we do not
    need to fetch this for the CI jobs which was a frequent source of spurious
    build failures.
    
    This also sets up per-job caches so that GCC and Clang builds do not share
    a cache and hence the cache that has to be fetched for each job is smaller.
    580f0d8e
......@@ -3,3 +3,4 @@
*/.gitignore export-ignore
*/*/.gitignore export-ignore
regtest export-ignore
qt5/tests/unittestcases/ export-ignore
......@@ -22,8 +22,7 @@ build:
stage: build
script:
- mkdir -p build && cd build
- curl https://gitlab.freedesktop.org/poppler/test/-/archive/master/test-master.tar.gz | tar xz
- cmake -G Ninja -DTESTDATADIR=$PWD/test-master ..
- cmake -G Ninja ..
- ninja
- ctest --output-on-failure
......@@ -31,8 +30,7 @@ build_clang_libcpp:
stage: build
script:
- mkdir -p build && cd build
- curl https://gitlab.freedesktop.org/poppler/test/-/archive/master/test-master.tar.gz | tar xz
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/test-master ..
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ ..
- ninja
- ctest --output-on-failure
......
......@@ -68,25 +68,6 @@ option(EXTRA_WARN "Enable extra compile warnings" OFF)
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)
set(_default_fontconfiguration "win32")
elseif(ANDROID)
......@@ -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 lcms2" USE_CMS)
show_end_message_yesno("command line utils" ENABLE_UTILS)
show_end_message("test data dir" ${TESTDATADIR})
if(NOT ENABLE_SPLASH AND NOT CAIRO_FOUND)
message("Warning: There is no rendering backend enabled")
......
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(-DTESTDATADIR=\"${TESTDATADIR}\")
add_definitions(-DTESTDATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}\")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
......
......@@ -55,7 +55,7 @@ static bool operator==( const FontInfo &f1, const FontInfo &f2 )
void TestFontsData::checkNoFonts()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/image.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/image.pdf");
QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts();
......@@ -67,7 +67,7 @@ void TestFontsData::checkNoFonts()
void TestFontsData::checkType1()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/text.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/text.pdf");
QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts();
......@@ -85,7 +85,7 @@ void TestFontsData::checkType1()
void TestFontsData::checkType3()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts();
......@@ -136,10 +136,10 @@ void TestFontsData::checkFontIterator()
{
// loading a 1-page document
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc );
// 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 );
std::unique_ptr< Poppler::FontIterator > it;
......@@ -190,7 +190,7 @@ void TestFontsData::checkFontIterator()
void TestFontsData::checkSecondDocumentQuery()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = doc->fonts();
......@@ -205,7 +205,7 @@ void TestFontsData::checkSecondDocumentQuery()
void TestFontsData::checkMultipleIterations()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/type3.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/type3.pdf");
QVERIFY( doc );
QList<Poppler::FontInfo> listOfFonts = loadFontsViaIterator( doc );
......@@ -219,7 +219,7 @@ void TestFontsData::checkMultipleIterations()
void TestFontsData::checkIteratorFonts()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/tests/fonts.pdf");
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/fonts.pdf");
QVERIFY( doc );
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.