Skip to content

Commit cc63d4d

Browse files
committed
Merge branch 'windows-command-line-release-mode'
2 parents 8aadd17 + 65ef364 commit cc63d4d

File tree

10 files changed

+32
-31
lines changed

10 files changed

+32
-31
lines changed

.appveyor.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ before_build:
2323
cmake ..
2424
-G "Visual Studio 12 2013"
2525
-DUseQtFive=ON
26-
-DDownloadTestPDF=ON
26+
-DUsePrerenderedPDF=ON
2727
-DBoostStaticLink=ON
2828
-DWindowsStaticLink=OFF
2929
-DRunDualScreenTests=OFF
@@ -49,8 +49,12 @@ before_test:
4949
- cmd: SET PATH=%PATH%;C:\dspdf\popplerDyn\poppler\bin
5050
- cmd: SET PATH=%PATH%;C:\qt\5.5\msvc2013\bin
5151
- cmd: if exist Testing\Debug copy C:\dspdf\popplerDyn\poppler\bin\poppler-qt5d.dll Testing\Debug\poppler-qt5.dll
52-
- cmd: if exist Testing\Debug copy C:\dspdf\popplerDyn\poppler\bin\poppler-qt5d.dll Testing\poppler-qt5.dll
52+
- cmd: if exist Testing\Debug copy C:\dspdf\popplerDyn\poppler\bin\poppler-qt5d.dll Debug\poppler-qt5.dll
53+
- cmd: if exist Testing\Debug windeployqt Testing\Debug\
54+
- cmd: if exist Testing\Debug windeployqt Debug\
5355
- cmd: SET CTEST_OUTPUT_ON_FAILURE=1
56+
- cmd: if exist Testing\Release windeployqt Testing\Release\
57+
- cmd: if exist Testing\Release windeployqt Release\
5458

5559
after_test:
5660
- cmd: msbuild RUN_TESTS.vcxproj

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Changes in behaviour:
1919
environment does not have that pass -DRunDualScreenTests=OFF at
2020
CMake time. This can be useful if you run the test suite under
2121
XvFB.
22+
* Instead of offering pre-rendered PDFs for download, they are now
23+
included in the source tree. The option `DownloadTestPDF` has
24+
been replaced with `UsePrerenderedPDF` accordingly.
2225

2326
New features:
2427
* Memory usage now configurable

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ option(BuildTests "Build unit tests (this requires pdflatex or internet access a
3838
option(RunDualScreenTests "Also run tests that require two screens to be connected" ON)
3939
option(BoostStaticLink "Link statically against the boost libraries" OFF)
4040
option(WindowsStaticLink "Windows/MSVC only: Link statically against the dependencies and set /MT instead of /MD" ON)
41-
option(DownloadTestPDF "Download test PDFs from http://danny-edel.de, rather then building them using latex-beamer" OFF)
41+
option(UsePrerenderedPDF "Use prerendered PDFs included in the source for testing, instead of building with pdflatex" OFF)
4242
option(CodeCoverage "Add coverage analysis code to the program. Will slow it down. A lot. Only supported on GCC right now." OFF)
4343

4444
include(cmake/platforms.cmake)

_travis/configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ CMAKE_PARAMETERS+=" -DCMAKE_BUILD_TYPE=Debug"
1313

1414
# OSX specific stuff
1515
if [ "$TRAVIS_OS_NAME" = "osx" ] ; then
16-
# Download Test PDF,
16+
# Use prerendered PDF
1717
# rather than install pdflatex
18-
CMAKE_PARAMETERS+=" -DDownloadTestPDF=ON"
18+
CMAKE_PARAMETERS+=" -DUsePrerenderedPDF=ON"
1919

2020
# Skip dual screen tests since we don't have
2121
# xvfb-run

main.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,17 @@
2929
#include <QTranslator>
3030
#include <QLibraryInfo>
3131

32-
#if defined ( _WIN32 ) && defined ( NDEBUG )
33-
#pragma comment(linker, "/SUBSYSTEM:windows")
34-
#include <Windows.h>
32+
#if defined ( _WIN32 )
33+
#pragma comment(linker, "/ENTRY:mainCRTStartup")
3534

36-
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
37-
{
38-
int argc = __argc;
39-
#define argv __argv
35+
#if defined( NDEBUG )
36+
#pragma comment(linker, "/SUBSYSTEM:windows")
37+
#endif
4038

41-
#else
39+
#endif
4240

4341
int main(int argc, char** argv)
4442
{
45-
46-
#endif
4743
QApplication app(argc, argv);
4844

4945
app.setApplicationName( QString::fromUtf8("dspdfviewer") );

testing/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
*.log
44
*.nav
55
*.out
6-
*.pdf
76
*.snm
87
*.toc

testing/CMakeLists.txt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@ list(APPEND PDFFILENAMES
1515
)
1616

1717
if(DownloadTestPDF)
18-
file(DOWNLOAD http://danny-edel.de/colored-rectangles.pdf ${CMAKE_CURRENT_BINARY_DIR}/colored-rectangles.pdf
19-
TIMEOUT 30
20-
SHOW_PROGRESS
21-
EXPECTED_MD5 de9617fb1c00d6185e90314124e2c2f5
22-
)
23-
file(DOWNLOAD http://danny-edel.de/images.pdf ${CMAKE_CURRENT_BINARY_DIR}/images.pdf
24-
TIMEOUT 30
25-
SHOW_PROGESS
26-
EXPECTED_MD5 5c72e0954d457e3e9a1287ff299e307a
27-
)
28-
file(DOWNLOAD http://danny-edel.de/many-many-pages.pdf ${CMAKE_CURRENT_BINARY_DIR}/many-many-pages.pdf
29-
TIMEOUT 30
30-
SHOW_PROGRESS
31-
EXPECTED_MD5 22d934fbc13a93adc5e91bfec866229e
32-
)
18+
message(WARNING "DownloadTestPDF option has been deprectated, since "
19+
"prerendered PDFs are now included in the source. Use the option
20+
-DUsePrerenderedPDF=ON from now on.")
21+
set(UsePrerenderedPDF ON)
22+
endif()
23+
24+
if(UsePrerenderedPDF)
25+
foreach(pdffile IN LISTS PDFFILENAMES)
26+
file(
27+
COPY "pdfs/${pdffile}"
28+
DESTINATION .
29+
)
30+
message(STATUS "Using pre-rendered ${pdffile}")
31+
endforeach()
3332
else()
3433
# Compile from source
3534
find_program(PDFLATEX

testing/pdfs/colored-rectangles.pdf

19.8 KB
Binary file not shown.

testing/pdfs/images.pdf

25.4 KB
Binary file not shown.

testing/pdfs/many-many-pages.pdf

171 KB
Binary file not shown.

0 commit comments

Comments
 (0)