From 9485eb8a1e2046f26d2410290bc6dc4a850c5471 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 20 Jul 2017 21:02:10 +0200 Subject: Add a rendering test platform --- CMakeLists.txt | 2 + testfiles/CMakeLists.txt | 3 +- .../expected_rendering/test-empty-large.png | Bin 0 -> 69082 bytes .../expected_rendering/test-empty.png | Bin 0 -> 6920 bytes testfiles/rendering_tests/test-empty.svg | 65 +++++++++++++++++++++ testfiles/rendering_tests/test.sh | 65 +++++++++++++++++++++ 6 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 testfiles/rendering_tests/expected_rendering/test-empty-large.png create mode 100644 testfiles/rendering_tests/expected_rendering/test-empty.png create mode 100644 testfiles/rendering_tests/test-empty.svg create mode 100755 testfiles/rendering_tests/test.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 094ebacab..1060a350e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,6 +256,8 @@ if(GMOCK_PRESENT) set(CMAKE_CTEST_ENV INKSCAPE_DATADIR=${CMAKE_CURRENT_SOURCE_DIR}/share) add_subdirectory(testfiles EXCLUDE_FROM_ALL) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS tests) + add_dependencies(check inkscape) + add_dependencies(check ALL) endif() # Canonicalize the flags to speed up recompilation using ccache/etc. diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 388a04b11..637a7a8cd 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -28,4 +28,5 @@ foreach(source ${TEST_SOURCES}) add_test(NAME ${source} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${source}) set_tests_properties(${source} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) add_dependencies(tests ${source}) -endforeach() \ No newline at end of file +endforeach() +add_test(NAME "rendering_test" COMMAND test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests ) diff --git a/testfiles/rendering_tests/expected_rendering/test-empty-large.png b/testfiles/rendering_tests/expected_rendering/test-empty-large.png new file mode 100644 index 000000000..34acf1f26 Binary files /dev/null and b/testfiles/rendering_tests/expected_rendering/test-empty-large.png differ diff --git a/testfiles/rendering_tests/expected_rendering/test-empty.png b/testfiles/rendering_tests/expected_rendering/test-empty.png new file mode 100644 index 000000000..2e0a5fe1d Binary files /dev/null and b/testfiles/rendering_tests/expected_rendering/test-empty.png differ diff --git a/testfiles/rendering_tests/test-empty.svg b/testfiles/rendering_tests/test-empty.svg new file mode 100644 index 000000000..24b396e21 --- /dev/null +++ b/testfiles/rendering_tests/test-empty.svg @@ -0,0 +1,65 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh new file mode 100755 index 000000000..aaaa1527d --- /dev/null +++ b/testfiles/rendering_tests/test.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +### HOWTO ### +# Add a rendering test: +# - create the svg file +# - inkscape .svg -d 96 -e expected_rendering/.png +# - inkscape .svg -d 384 -e expected_rendering/-large.png +# - add the test in the list below +# - use stable if possible to generate the reference png files +# - git add .svg expected_rendering/-large.png expected_rendering/.png +# +# Fix a failing test (due to a change in code): +# - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ +# - fix your code if possible +# - IF you change introduces a greater compatibility with css or browsers +# - AND you cannot reasonably "update" files from older versions to match the appearance +# - AND inkscape-devel@ has a consensus that it's the only way +# -> do as you must +# - manually double check the changes +# Fix a failing test (due to a change in pixman or cairo): +# - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK +# - manually check appearances +############# + +### test list ### + +tests="\ + test-empty\ + " + +### script ### + + + +if [ "$#" -lt 1 ]; then + echo "pass the path of the inkscape executable as parameter" $# + exit 1 +fi +INKSCAPE_EXE=$1 +exit_status=0 +for test in $tests +do + ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png 2>/dev/null >/dev/null + compare -metric AE ${test}.png expected_rendering/${test}.png ${test}-compare.png 2> .tmp + test1=`cat .tmp` + echo $test1 + if [ $test1 == 0 ]; then + echo ${test} "PASSED" + rm ${test}.png ${test}-compare.png + else + echo ${test} "FAILED" + exist_status=1 + fi + ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png 2>/dev/null >/dev/null + compare -metric AE ${test}-large.png expected_rendering/${test}-large.png ${test}-compare-large.png 2>.tmp + test2=`cat .tmp` + if [ $test2 == 0 ]; then + echo ${test}-large "PASSED" + rm ${test}-large.png ${test}-compare-large.png + else + echo ${test}-large "FAILED" + fi +done +rm .tmp +exit $exit_status -- cgit v1.2.3 From 79c6106c32a2241f403d8d8a513eb3de87dcdbcd Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 20 Jul 2017 21:04:29 +0200 Subject: add make install to test[F --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9860f4f0f..dcff3ebf5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,6 +81,7 @@ test:linux: - inkscape:linux script: - cd build + - make install - make test # uploads the clang scan to user.gitlab.io/inkscape/ -- cgit v1.2.3 From 4f560761c53e0b07568f21bd57221b3431bf0840 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 21 Jul 2017 00:19:57 +0200 Subject: remove add_dependency --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1060a350e..e9575055a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,7 +257,6 @@ if(GMOCK_PRESENT) add_subdirectory(testfiles EXCLUDE_FROM_ALL) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS tests) add_dependencies(check inkscape) - add_dependencies(check ALL) endif() # Canonicalize the flags to speed up recompilation using ccache/etc. -- cgit v1.2.3 From 734bece3601812301f295e47db6ed40c49f90466 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 21 Jul 2017 00:25:40 +0200 Subject: Try to fix CI --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b4356059..86f69b469 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,9 +19,10 @@ inkscape:linux: - export CCACHE_BASEDIR=${PWD} - export CCACHE_DIR=${PWD}/ccache script: - - mkdir -p build + - mkdir -p build/conf + - ln -s . share/inkscape - cd build - - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$PWD/../ - make -j3 - make -j3 tests - cd .. @@ -84,7 +85,6 @@ test:linux: - inkscape:linux script: - cd build - - make install - make test # uploads the clang scan to user.gitlab.io/inkscape/ -- cgit v1.2.3 From 3251180aabf000cd4ad9d291183c9ec1f8281568 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 21 Jul 2017 01:27:59 +0200 Subject: try verbose tests --- .gitlab-ci.yml | 1 + testfiles/rendering_tests/test.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 86f69b469..b9e276e5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,6 +86,7 @@ test:linux: script: - cd build - make test + - ctest -V # uploads the clang scan to user.gitlab.io/inkscape/ pages: diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh index aaaa1527d..c77b5ef0f 100755 --- a/testfiles/rendering_tests/test.sh +++ b/testfiles/rendering_tests/test.sh @@ -40,7 +40,7 @@ INKSCAPE_EXE=$1 exit_status=0 for test in $tests do - ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png 2>/dev/null >/dev/null + ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png #2>/dev/null >/dev/null compare -metric AE ${test}.png expected_rendering/${test}.png ${test}-compare.png 2> .tmp test1=`cat .tmp` echo $test1 @@ -51,7 +51,7 @@ do echo ${test} "FAILED" exist_status=1 fi - ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png 2>/dev/null >/dev/null + ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png #2>/dev/null >/dev/null compare -metric AE ${test}-large.png expected_rendering/${test}-large.png ${test}-compare-large.png 2>.tmp test2=`cat .tmp` if [ $test2 == 0 ]; then -- cgit v1.2.3 From 53f15fe0567c380f6542607b8d5bdc01685f9d53 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 00:05:24 +0200 Subject: fix typo, update CI --- .gitlab-ci.yml | 5 +++-- testfiles/rendering_tests/test.sh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b9e276e5c..5ca127707 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,8 +22,8 @@ inkscape:linux: - mkdir -p build/conf - ln -s . share/inkscape - cd build - - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$PWD/../ - - make -j3 + - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$PWD/install_dir/ + - make -j3 install - make -j3 tests - cd .. artifacts: @@ -84,6 +84,7 @@ test:linux: dependencies: - inkscape:linux script: + - apt-get update -yqq && apt-get install -y imagemagick - cd build - make test - ctest -V diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh index c77b5ef0f..153f3a5e9 100755 --- a/testfiles/rendering_tests/test.sh +++ b/testfiles/rendering_tests/test.sh @@ -49,7 +49,7 @@ do rm ${test}.png ${test}-compare.png else echo ${test} "FAILED" - exist_status=1 + exit_status=1 fi ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png #2>/dev/null >/dev/null compare -metric AE ${test}-large.png expected_rendering/${test}-large.png ${test}-compare-large.png 2>.tmp @@ -59,6 +59,7 @@ do rm ${test}-large.png ${test}-compare-large.png else echo ${test}-large "FAILED" + exit_status=1 fi done rm .tmp -- cgit v1.2.3 From bd3340b72407443600dee776dc4ba2a8385b2ad8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 00:48:48 +0200 Subject: make test fail for CI testing --- testfiles/rendering_tests/test-empty.svg | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/testfiles/rendering_tests/test-empty.svg b/testfiles/rendering_tests/test-empty.svg index 24b396e21..eb157fa82 100644 --- a/testfiles/rendering_tests/test-empty.svg +++ b/testfiles/rendering_tests/test-empty.svg @@ -25,16 +25,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="-360" - inkscape:cy="537.14286" + inkscape:zoom="0.7" + inkscape:cx="132.86611" + inkscape:cy="438.52092" inkscape:document-units="mm" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" - inkscape:window-height="1006" - inkscape:window-x="0" - inkscape:window-y="25" + inkscape:window-height="1055" + inkscape:window-x="1920" + inkscape:window-y="0" inkscape:window-maximized="1" /> @@ -61,5 +61,12 @@ y="46.023808" rx="6.6565199" ry="6.6565199" /> + -- cgit v1.2.3 From 7176bbc1faf080a425cd3ec4a34fd10bf9652863 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 00:49:21 +0200 Subject: undo --- testfiles/rendering_tests/test-empty.svg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/testfiles/rendering_tests/test-empty.svg b/testfiles/rendering_tests/test-empty.svg index eb157fa82..3b5ee5a4a 100644 --- a/testfiles/rendering_tests/test-empty.svg +++ b/testfiles/rendering_tests/test-empty.svg @@ -61,12 +61,5 @@ y="46.023808" rx="6.6565199" ry="6.6565199" /> - -- cgit v1.2.3 From c6e348a272ed1f7f15b6a8ffbd0a257eceb1d022 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 12:41:58 +0200 Subject: refactor a bit --- testfiles/CMakeLists.txt | 2 +- testfiles/README | 24 +++++++++++++++++ testfiles/rendering_tests/CMakeLists.txt | 7 +++++ testfiles/rendering_tests/test.sh | 45 ++++++-------------------------- 4 files changed, 40 insertions(+), 38 deletions(-) create mode 100644 testfiles/README create mode 100644 testfiles/rendering_tests/CMakeLists.txt diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 637a7a8cd..e7198a39f 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -29,4 +29,4 @@ foreach(source ${TEST_SOURCES}) set_tests_properties(${source} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) add_dependencies(tests ${source}) endforeach() -add_test(NAME "rendering_test" COMMAND test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests ) +add_subdirectory(rendering_tests) diff --git a/testfiles/README b/testfiles/README new file mode 100644 index 000000000..e395d828c --- /dev/null +++ b/testfiles/README @@ -0,0 +1,24 @@ +HOWTO + +# Add a rendering test: + - create the svg file + - inkscape .svg -d 96 -e expected_rendering/.png + - inkscape .svg -d 384 -e expected_rendering/-large.png + - add the test in the list below + - use stable if possible to generate the reference png files + - git add .svg expected_rendering/-large.png expected_rendering/.png + +# Fix a failing test (due to a change in code): + - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ + - fix your code if possible + - IF you change introduces a greater compatibility with css or browsers + - AND you cannot reasonably "update" files from older versions to match the appearance + - AND inkscape-devel@ has a consensus that it's the only way + -> do as you must + - manually double check the changes + +# Fix a failing test (due to a change in pixman or cairo): + - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK + - manually check appearances + + diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt new file mode 100644 index 000000000..0e0f43b99 --- /dev/null +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -0,0 +1,7 @@ +set(RENDERING_TESTS + test-empty +) +foreach(rendering_test ${RENDERING_TESTS}) + add_test(NAME ${rendering_test} COMMAND test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests ) +endforeach() + diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh index 153f3a5e9..2a8adf42c 100755 --- a/testfiles/rendering_tests/test.sh +++ b/testfiles/rendering_tests/test.sh @@ -1,45 +1,16 @@ #!/bin/bash -### HOWTO ### -# Add a rendering test: -# - create the svg file -# - inkscape .svg -d 96 -e expected_rendering/.png -# - inkscape .svg -d 384 -e expected_rendering/-large.png -# - add the test in the list below -# - use stable if possible to generate the reference png files -# - git add .svg expected_rendering/-large.png expected_rendering/.png -# -# Fix a failing test (due to a change in code): -# - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ -# - fix your code if possible -# - IF you change introduces a greater compatibility with css or browsers -# - AND you cannot reasonably "update" files from older versions to match the appearance -# - AND inkscape-devel@ has a consensus that it's the only way -# -> do as you must -# - manually double check the changes -# Fix a failing test (due to a change in pixman or cairo): -# - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK -# - manually check appearances -############# - -### test list ### - -tests="\ - test-empty\ - " - -### script ### - - - -if [ "$#" -lt 1 ]; then - echo "pass the path of the inkscape executable as parameter" $# +if [ "$#" -lt 2 ]; then + echo "pass the path of the inkscape executable as parameter then the name of the test" $# exit 1 fi + +command -v compare >/dev/null 2>&1 || { echo >&2 "I require ImageMagick's 'compare' but it's not installed. Aborting."; exit 1; } + INKSCAPE_EXE=$1 exit_status=0 -for test in $tests -do +test=$2 + ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png #2>/dev/null >/dev/null compare -metric AE ${test}.png expected_rendering/${test}.png ${test}-compare.png 2> .tmp test1=`cat .tmp` @@ -61,6 +32,6 @@ do echo ${test}-large "FAILED" exit_status=1 fi -done + rm .tmp exit $exit_status -- cgit v1.2.3 From 38b4ec1505424af256a127b1a0fddb1b94e7c191 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 12:46:06 +0200 Subject: small fix --- testfiles/README | 24 ------------------------ testfiles/rendering_tests/CMakeLists.txt | 4 ++++ testfiles/rendering_tests/README | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 24 deletions(-) delete mode 100644 testfiles/README create mode 100644 testfiles/rendering_tests/README diff --git a/testfiles/README b/testfiles/README deleted file mode 100644 index e395d828c..000000000 --- a/testfiles/README +++ /dev/null @@ -1,24 +0,0 @@ -HOWTO - -# Add a rendering test: - - create the svg file - - inkscape .svg -d 96 -e expected_rendering/.png - - inkscape .svg -d 384 -e expected_rendering/-large.png - - add the test in the list below - - use stable if possible to generate the reference png files - - git add .svg expected_rendering/-large.png expected_rendering/.png - -# Fix a failing test (due to a change in code): - - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ - - fix your code if possible - - IF you change introduces a greater compatibility with css or browsers - - AND you cannot reasonably "update" files from older versions to match the appearance - - AND inkscape-devel@ has a consensus that it's the only way - -> do as you must - - manually double check the changes - -# Fix a failing test (due to a change in pixman or cairo): - - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK - - manually check appearances - - diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt index 0e0f43b99..786771374 100644 --- a/testfiles/rendering_tests/CMakeLists.txt +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -1,6 +1,10 @@ + +#add your test here (do not put the .svg extension) set(RENDERING_TESTS test-empty ) + + foreach(rendering_test ${RENDERING_TESTS}) add_test(NAME ${rendering_test} COMMAND test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests ) endforeach() diff --git a/testfiles/rendering_tests/README b/testfiles/rendering_tests/README new file mode 100644 index 000000000..92cf95ef6 --- /dev/null +++ b/testfiles/rendering_tests/README @@ -0,0 +1,24 @@ +HOWTO + +# Add a rendering test: + - create the svg file + - inkscape .svg -d 96 -e expected_rendering/.png + - inkscape .svg -d 384 -e expected_rendering/-large.png + - add the test in CMakeLists.txt + - use stable if possible to generate the reference png files + - git add .svg expected_rendering/-large.png expected_rendering/.png + +# Fix a failing test (due to a change in code): + - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ + - fix your code if possible + - IF you change introduces a greater compatibility with css or browsers + - AND you cannot reasonably "update" files from older versions to match the appearance + - AND inkscape-devel@ has a consensus that it's the only way + -> do as you must + - manually double check the changes + +# Fix a failing test (due to a change in pixman or cairo): + - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK + - manually check appearances + + -- cgit v1.2.3 From 33982890ab0b02e837ca87a61329175a0af4546e Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 18:55:22 +0200 Subject: Small fixes suggested by @Ede123 --- testfiles/rendering_tests/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt index 786771374..72cc61f4f 100644 --- a/testfiles/rendering_tests/CMakeLists.txt +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -6,6 +6,7 @@ set(RENDERING_TESTS foreach(rendering_test ${RENDERING_TESTS}) - add_test(NAME ${rendering_test} COMMAND test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests ) + add_test(NAME ${rendering_test} COMMAND sh test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) + set_tests_properties(${rendering_test} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) endforeach() -- cgit v1.2.3 From a068eeea42b2c04c25b0d851cf254bda0cfef17d Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 19:06:27 +0200 Subject: Small fix --- testfiles/rendering_tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt index 72cc61f4f..7013aefdb 100644 --- a/testfiles/rendering_tests/CMakeLists.txt +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -6,7 +6,7 @@ set(RENDERING_TESTS foreach(rendering_test ${RENDERING_TESTS}) - add_test(NAME ${rendering_test} COMMAND sh test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) + add_test(NAME ${rendering_test} COMMAND sh ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests/test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) set_tests_properties(${rendering_test} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) endforeach() -- cgit v1.2.3 From 5be4e6e8e707941627f238b91728b9693b66cd81 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 19:46:14 +0200 Subject: Fix for out of source tests --- testfiles/rendering_tests/CMakeLists.txt | 2 +- testfiles/rendering_tests/test.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt index 7013aefdb..3f838628a 100644 --- a/testfiles/rendering_tests/CMakeLists.txt +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -6,7 +6,7 @@ set(RENDERING_TESTS foreach(rendering_test ${RENDERING_TESTS}) - add_test(NAME ${rendering_test} COMMAND sh ${CMAKE_SOURCE_DIR}/testfiles/rendering_tests/test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) + add_test(NAME ${rendering_test} COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${CMAKE_CURRENT_SOURCE_DIR}/${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) set_tests_properties(${rendering_test} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) endforeach() diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh index 2a8adf42c..8184a894a 100755 --- a/testfiles/rendering_tests/test.sh +++ b/testfiles/rendering_tests/test.sh @@ -10,9 +10,11 @@ command -v compare >/dev/null 2>&1 || { echo >&2 "I require ImageMagick's 'compa INKSCAPE_EXE=$1 exit_status=0 test=$2 +EXPECTED=$(dirname $test)"/expected_rendering/"$(basename $test) + ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png #2>/dev/null >/dev/null - compare -metric AE ${test}.png expected_rendering/${test}.png ${test}-compare.png 2> .tmp + compare -metric AE ${test}.png ${EXPECTED}.png ${test}-compare.png 2> .tmp test1=`cat .tmp` echo $test1 if [ $test1 == 0 ]; then @@ -23,7 +25,7 @@ test=$2 exit_status=1 fi ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png #2>/dev/null >/dev/null - compare -metric AE ${test}-large.png expected_rendering/${test}-large.png ${test}-compare-large.png 2>.tmp + compare -metric AE ${test}-large.png ${EXPECTED}-large.png ${test}-compare-large.png 2>.tmp test2=`cat .tmp` if [ $test2 == 0 ]; then echo ${test}-large "PASSED" -- cgit v1.2.3 From 03fb73451da54e9cfa930479d10ba266940488b4 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 18:55:33 +0000 Subject: Remove IM after adding it to dockerfile --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ca127707..928357de1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,7 +84,6 @@ test:linux: dependencies: - inkscape:linux script: - - apt-get update -yqq && apt-get install -y imagemagick - cd build - make test - ctest -V -- cgit v1.2.3 From efaca78af08ff41d15eb09a0d0c0c5a9b84f28af Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 29 Jul 2017 21:44:10 +0200 Subject: *Actually* run tests out of source --- testfiles/rendering_tests/test.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh index 8184a894a..a9738e69a 100755 --- a/testfiles/rendering_tests/test.sh +++ b/testfiles/rendering_tests/test.sh @@ -11,27 +11,28 @@ INKSCAPE_EXE=$1 exit_status=0 test=$2 EXPECTED=$(dirname $test)"/expected_rendering/"$(basename $test) +testname=$(basename $test) - ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${test}.png #2>/dev/null >/dev/null - compare -metric AE ${test}.png ${EXPECTED}.png ${test}-compare.png 2> .tmp + ${INKSCAPE_EXE} -z ${test}.svg -d 96 -e ${testname}.png #2>/dev/null >/dev/null + compare -metric AE ${testname}.png ${EXPECTED}.png ${testname}-compare.png 2> .tmp test1=`cat .tmp` echo $test1 if [ $test1 == 0 ]; then - echo ${test} "PASSED" - rm ${test}.png ${test}-compare.png + echo ${testname} "PASSED" + rm ${testname}.png ${testname}-compare.png else - echo ${test} "FAILED" + echo ${testname} "FAILED" exit_status=1 fi - ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${test}-large.png #2>/dev/null >/dev/null - compare -metric AE ${test}-large.png ${EXPECTED}-large.png ${test}-compare-large.png 2>.tmp + ${INKSCAPE_EXE} -z ${test}.svg -d 384 -e ${testname}-large.png #2>/dev/null >/dev/null + compare -metric AE ${testname}-large.png ${EXPECTED}-large.png ${testname}-compare-large.png 2>.tmp test2=`cat .tmp` if [ $test2 == 0 ]; then - echo ${test}-large "PASSED" - rm ${test}-large.png ${test}-compare-large.png + echo ${testname}-large "PASSED" + rm ${testname}-large.png ${testname}-compare-large.png else - echo ${test}-large "FAILED" + echo ${testname}-large "FAILED" exit_status=1 fi -- cgit v1.2.3