[med-svn] [Git][med-team/orthanc-webviewer][master] 2 commits: We settled with the common name run-unit-test

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Oct 24 15:48:13 BST 2023



Andreas Tille pushed to branch master at Debian Med / orthanc-webviewer


Commits:
421d1db1 by Andreas Tille at 2023-10-24T15:17:46+02:00
We settled with the common name run-unit-test

- - - - -
34c8b4e9 by Andreas Tille at 2023-10-24T16:46:21+02:00
Attempt to build *just* UnitTest which ia not finished.  Not working yet.  Next step is to make

   orthanc-doc: /usr/share/doc/orthanc/OrthancPluginSamples/Common/OrthancPluginCppWrapper.h

available for the build process.

- - - - -


6 changed files:

- + debian/README.test
- + debian/docs
- + debian/examples
- debian/tests/control
- + debian/tests/run-unit-test
- − debian/tests/run-upstream-test


Changes:

=====================================
debian/README.test
=====================================
@@ -0,0 +1,8 @@
+Notes on how this package can be tested.
+────────────────────────────────────────
+
+This package can be tested by running the provided test:
+
+    sh run-unit-test
+
+in order to confirm its integrity.


=====================================
debian/docs
=====================================
@@ -0,0 +1,2 @@
+debian/tests/run-unit-test
+debian/README.test


=====================================
debian/examples
=====================================
@@ -0,0 +1,6 @@
+Plugin/Cache
+Plugin/ViewerToolbox.cpp
+Build/AUTOGENERATED/EmbeddedResources.*
+Plugin/SeriesInformationAdapter.*
+Plugin/ViewerToolbox.*
+UnitTestsSources/UnitTestsMain.cpp


=====================================
debian/tests/control
=====================================
@@ -1,3 +1,3 @@
-Tests: run-upstream-test
+Tests: run-unit-test
 Restrictions: allow-stderr
-Depends: @, cmake, libboost-all-dev, libgtest-dev, libjpeg-dev,libjs-jquery-ui, libjs-jquery-ui-theme-base, libjsoncpp-dev, liborthancframework-dev, libpng-dev, libsqlite3-dev, orthanc-dev (>= 0.9.5), unzip, uuid-dev,yui-compressor, zlib1g-dev, build-essential
\ No newline at end of file
+Depends: @, cmake, libboost-all-dev, libgtest-dev, libjpeg-dev,libjs-jquery-ui, libjs-jquery-ui-theme-base, libjsoncpp-dev, liborthancframework-dev, libpng-dev, libsqlite3-dev, orthanc-dev (>= 0.9.5), unzip, uuid-dev,yui-compressor, zlib1g-dev, build-essential


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,50 @@
+#!/bin/bash
+set -e
+
+pkg=orthanc-webviewer
+
+# FIXME: How to obtain the upstream version of the package inside autopkgtest
+ver=2.8
+
+# FIXME: How to specify any CPP in autopkgtest
+CPP=g++
+
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+#  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+find . -name "*.gz" -exec gunzip \{\} \;
+
+set -x
+sed -i 's#../Plugin/##' UnitTestsMain.cpp
+
+for cpp in $(find . -name "*.cpp") ; do
+    ${CPP} \
+	-DHAS_ORTHANC_EXCEPTION=1 -DORTHANC_PLUGIN_VERSION=\"${ver}\" -DORTHANC_STANDALONE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 \
+	-I/usr/include/jsoncpp -I/usr/include/orthanc-framework -I/usr/src/gtest \
+	-g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time \
+	-D_FORTIFY_SOURCE=2 -Wall -Wno-long-long -Wno-variadic-macros -c -o $(basename ${cpp} .cpp).o ${cpp}
+done
+
+${CPP} \
+	-DHAS_ORTHANC_EXCEPTION=1 -DORTHANC_PLUGIN_VERSION=\"${ver}\" -DORTHANC_STANDALONE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 \
+	-I/usr/include/jsoncpp -I/usr/include/orthanc-framework -I/usr/src/gtest \
+	-g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time \
+	-D_FORTIFY_SOURCE=2 -Wall -Wno-long-long -Wno-variadic-macros -o gtest-all.o -c /usr/src/googletest/googletest/src/gtest-all.cc
+
+${CPP} -g -O2 -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection \
+    -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wno-long-long -Wno-variadic-macros -Wl,-z,relro -Wl,-z,now -Wl,--as-needed \
+    $(find . -name *.o) -o UnitTests  -lpthread -lrt -ldl -Wl,-Bstatic \
+    -lOrthancFramework -Wl,-Bdynamic -lboost_filesystem -lboost_iostreams -lboost_locale -lboost_regex -lboost_thread \
+    -ljsoncpp -lpugixml -luuid -lsqlite3 
+
+# Build upstream test
+# make UnitTests
+
+# Run upstream executable test
+./UnitTests
+


=====================================
debian/tests/run-upstream-test deleted
=====================================
@@ -1,52 +0,0 @@
-#!/bin/bash
-set -e
-
-pkg=orthanc-webviewer
-CUR_DIR=`pwd`
-
-
-if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
-  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
-  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
-fi
-
-
-# cp ${CUR_DIR}/debian/tests/UnitTests* -a "${AUTOPKGTEST_TMP}"
-
-cp ${CUR_DIR}/* -a "${AUTOPKGTEST_TMP}"
-
-cd "${AUTOPKGTEST_TMP}"
-
-
-# Set JS dependencies for build
-
-mkdir -p Build/javascript-libs/fonts
-mkdir -p Build/javascript-libs/images
-cp /usr/share/javascript/jquery/jquery.min.js Build/javascript-libs/jquery.js
-yui-compressor debian/JS/jquery-ui-*/jquery-ui.js > Build/javascript-libs/jquery-ui.min.js
-yui-compressor debian/JS/jquery-ui-*/jquery-ui.css > Build/javascript-libs/jquery-ui.min.css
-yui-compressor debian/JS/jquery-ui-*/jquery-ui.theme.css > Build/javascript-libs/jquery-ui.theme.min.css
-cp debian/JS/jquery-ui-*/images/* Build/javascript-libs/images
-cp debian/JS/cornerstone-0.11.0/cornerstone.js Build/javascript-libs/cornerstone.min.js
-cp debian/JS/cornerstone-0.11.0/cornerstone.css Build/javascript-libs/cornerstone.css
-yui-compressor debian/JS/jsPanel-*/jquery.jspanel.js > Build/javascript-libs/jquery.jspanel.min.js
-yui-compressor debian/JS/jsPanel-*/jquery.jspanel.css > Build/javascript-libs/jquery.jspanel.min.css
-yui-compressor debian/JS/jsPanel-*/jquery.ui.touch-punch.js > Build/javascript-libs/jquery.ui.touch-punch.min.js
-yui-compressor debian/JS/jsPanel-*/mobile-detect.js > Build/javascript-libs/mobile-detect.min.js
-cp debian/JS/jsPanel-*/images/* Build/javascript-libs/images/
-cp debian/JS/jsPanel-*/fonts/* Build/javascript-libs/fonts/
-yui-compressor debian/JS/js-url-*/url.js > Build/javascript-libs/url.min.js
-yui-compressor debian/JS/pako-*/pako_inflate.js > Build/javascript-libs/pako_inflate.min.js
-
-
-cd Build
-
-# Run cmake for build
-cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_SKIP_RPATH:BOOL=ON -DSTATIC_BUILD:BOOL=OFF -DSTANDALONE_BUILD:BOOL=ON -DORTHANC_FRAMEWORK_SOURCE:STRING=system -DUSE_GOOGLE_TEST_DEBIAN_PACKAGE:BOOL=ON -DORTHANC_FRAMEWORK_USE_SHARED:BOOL=OFF "-DORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES=boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid sqlite3" -DCMAKE_BUILD_TYPE=None 
-
-# Build upstream test
-make UnitTests
-
-# Run upstream executable test
-./UnitTests
-



View it on GitLab: https://salsa.debian.org/med-team/orthanc-webviewer/-/compare/9e4a35b70a72bf72091f5038af6937c70e66722a...34c8b4e9bb405313236f64ee718203769fc7f8e5

-- 
View it on GitLab: https://salsa.debian.org/med-team/orthanc-webviewer/-/compare/9e4a35b70a72bf72091f5038af6937c70e66722a...34c8b4e9bb405313236f64ee718203769fc7f8e5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231024/565ecd9d/attachment-0001.htm>


More information about the debian-med-commit mailing list