From 310adb9aa1b6db4d238dd22aa2119ce5fbabdea7 Mon Sep 17 00:00:00 2001
From: ababi <albert.babi@savoirfairelinux.com>
Date: Fri, 6 Nov 2020 18:04:10 +0100
Subject: [PATCH] cqfd: add Ubuntu 20.10 Dockerfile and other test fixes

- add Ubuntu 20.10 Dockerfile to build with cqfd
- set symlink to Ubuntu 20.10 Dockerfile instead of Debian 11
- fix packages on Debian Dockerfile
- add subdirectory tests and dummy_test to CMakeLists.txt

Change-Id: I13d21e2b9e53d456ec1d7a53962860912397d9c7
---
 CMakeLists.txt                 |  2 +
 docker/Dockerfile              |  2 +-
 docker/Dockerfile_debian_11    |  6 +--
 docker/Dockerfile_ubuntu_20.10 | 86 ++++++++++++++++++++++++++++++++++
 tests/CMakeLists.txt           |  4 +-
 5 files changed, 95 insertions(+), 5 deletions(-)
 create mode 100644 docker/Dockerfile_ubuntu_20.10

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 405f2b320..a7945e95a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,3 +147,5 @@ target_link_libraries(jami-qt
     ${QML_LIBS}
     ${ringclient}
     ${qrencode})
+
+add_subdirectory(tests)
diff --git a/docker/Dockerfile b/docker/Dockerfile
index d4a498043..4b0a8f260 120000
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1 +1 @@
-Dockerfile_debian_11
\ No newline at end of file
+Dockerfile_ubuntu_20.10
\ No newline at end of file
diff --git a/docker/Dockerfile_debian_11 b/docker/Dockerfile_debian_11
index 759d4a015..514676f39 100644
--- a/docker/Dockerfile_debian_11
+++ b/docker/Dockerfile_debian_11
@@ -1,4 +1,4 @@
-FROM debian:bullseye-20200908
+FROM debian:bullseye
 
 ENV DEBIAN_FRONTEND noninteractive
 ENV QT_QUICK_BACKEND software
@@ -6,7 +6,7 @@ ENV QT_QPA_PLATFORM offscreen
 
 RUN apt-get clean
 RUN apt-get update
-RUN apt-get install -y -o Acquire::Retires=10 \
+RUN apt-get install -y -o Acquire::Retries=10 \
         python3 \
         git \
         autoconf \
@@ -74,7 +74,7 @@ RUN apt-get install -y qtmultimedia5-dev \
         qml-module-qtquick-privatewidgets \
         qml-module-qtquick-shapes \
         qml-module-qtquick-window2 \
-        qml-module-qtquick-templates2
+        qml-module-qtquick-templates2 \
         qml-module-qt-labs-platform \
         qml-module-qtwebengine \
         qml-module-qtwebchannel \
diff --git a/docker/Dockerfile_ubuntu_20.10 b/docker/Dockerfile_ubuntu_20.10
new file mode 100644
index 000000000..5de5df784
--- /dev/null
+++ b/docker/Dockerfile_ubuntu_20.10
@@ -0,0 +1,86 @@
+FROM ubuntu:20.10
+
+ENV DEBIAN_FRONTEND noninteractive
+ENV QT_QUICK_BACKEND software
+ENV QT_QPA_PLATFORM offscreen
+
+RUN apt-get clean
+RUN apt-get update && \
+    apt-get install -y devscripts equivs
+
+RUN apt-get install -y -o Acquire::Retries=10 \
+        python3 \
+        git \
+        autoconf \
+        automake \
+        autopoint \
+        cmake \
+        libtool \
+        libdbus-1-dev \
+        libdbus-c++-dev \
+        libargon2-0-dev \
+        libcanberra-gtk3-dev \
+        libclutter-gtk-1.0-dev \
+        libclutter-1.0-dev \
+        libglib2.0-dev \
+        libgtk-3-dev \
+        libnotify-dev \
+        qtbase5-dev \
+        qttools5-dev \
+        qttools5-dev-tools \
+        yasm \
+        nasm \
+        autotools-dev \
+        gettext \
+        libpulse-dev \
+        libasound2-dev \
+        libexpat1-dev \
+        libpcre3-dev \
+        libyaml-cpp-dev \
+        libboost-dev \
+        libxext-dev \
+        libxfixes-dev \
+        libspeex-dev \
+        libspeexdsp-dev \
+        uuid-dev \
+        libavcodec-dev \
+        libavutil-dev \
+        libavformat-dev \
+        libswscale-dev \
+        libavdevice-dev \
+        libopus-dev \
+        libudev-dev \
+        libgsm1-dev \
+        libjsoncpp-dev \
+        libmsgpack-dev \
+        libnatpmp-dev \
+        libappindicator3-dev \
+        libqrencode-dev \
+        libnm-dev \
+        libwebkit2gtk-4.0-dev \
+        libcrypto++-dev \
+        libva-dev \
+        libvdpau-dev \
+        libssl-dev
+RUN apt-get install -y qtmultimedia5-dev \
+        libqt5svg5-dev \
+        qtwebengine5-dev \
+        qtdeclarative5-dev \
+        qtquickcontrols2-5-dev \
+        libqt5svg5-dev \
+        qml-module-qtquick2 \
+        qml-module-qtquick-controls \
+        qml-module-qtquick-controls2 \
+        qml-module-qtquick-dialogs \
+        qml-module-qtquick-layouts \
+        qml-module-qtquick-privatewidgets \
+        qml-module-qtquick-shapes \
+        qml-module-qtquick-window2 \
+        qml-module-qtquick-templates2 \
+        qml-module-qt-labs-platform \
+        qml-module-qtwebengine \
+        qml-module-qtwebchannel \
+        qml-module-qttest \
+        pandoc \
+        googletest \
+        libgtest-dev
\ No newline at end of file
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 59dcd7e56..0b8c64269 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -6,7 +6,8 @@ set(QMLTEST_LIBS ${QML_LIBS} Qt5::QuickTest)
 
 set(TESTS_INCLUDES
     ${CMAKE_SOURCE_DIR}/src
-    ${CMAKE_SOURCE_DIR}/tests/qml)
+    ${CMAKE_SOURCE_DIR}/tests/qml
+    ${CMAKE_SOURCE_DIR}/tests/unittests)
 
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}
     ${CMAKE_SOURCE_DIR}/src
@@ -43,6 +44,7 @@ add_test(NAME QmlTests COMMAND qml_tests -input ${PROJECT_SOURCE_DIR}/tests/qml/
 # Unittests
 add_executable(unittests
     ${CMAKE_SOURCE_DIR}/tests/unittests/main_unittests.cpp
+    ${CMAKE_SOURCE_DIR}/tests/unittests/dummy_unittest.cpp
     ${QML_RESOURCES}
     ${QML_RESOURCES_QML}
     $<TARGET_OBJECTS:test_common_obj>)
-- 
GitLab