Skip to content

Commit

Permalink
C++ tests from Qt6.5 branch, modified for Qt5
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell committed Jul 21, 2023
1 parent bd944af commit a6b0054
Show file tree
Hide file tree
Showing 55 changed files with 2,297 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/scripts/cpp_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -euxo pipefail
export CAMCOPS_QT6_BASE_DIR=${RUNNER_WORKSPACE}
cd ${CAMCOPS_QT6_BASE_DIR}
mkdir -p eigen
cd eigen
EIGEN_VERSION=3.3.3
wget --retry-on-http-error=429 --waitretry=300 --tries=20 https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/eigen-${EIGEN_VERSION}.tar.gz
tar xzf eigen-${EIGEN_VERSION}.tar.gz
cd ${GITHUB_WORKSPACE}
mkdir build-qt5-tests
cd build-qt5-tests
qmake ../tablet_qt/tests
make
export QT_DEBUG_PLUGINS=1

find . -path '*/bin/*' -type f -exec {} \;
35 changes: 35 additions & 0 deletions .github/workflows/cpp-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# yamllint disable rule:line-length
name: C++ tests
# yamllint disable-line rule:truthy
on:
push:
paths:
- '**.cpp'
- '**.h'
- .github/scripts/add_apt_sources.sh
- .github/scripts/change_apt_mirror.sh
- .github/scripts/cpp_tests.sh
- .github/workflows/cpp-tests.yml
jobs:
cpp-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.1
arch: gcc_64
modules: qtmultimedia
- name: Ubuntu prerequisites
run: |
set -eux -o pipefail
${GITHUB_WORKSPACE}/.github/scripts/change_apt_mirror.sh
${GITHUB_WORKSPACE}/.github/scripts/add_apt_sources.sh
sudo apt-get -y install libxcb-icccm4 libxcb-xkb1 libxcb-icccm4 libxcb-image0 libxcb-render-util0 libxcb-randr0 libxcb-keysyms1 libxcb-xinerama0 libxcb-xinput-dev libxcb-cursor0
sudo apt-get -y install xvfb x11-xserver-utils
- name: C++ tests
run: |
set -eux -o pipefail
xvfb-run --auto-servernum ${GITHUB_WORKSPACE}/.github/scripts/cpp_tests.sh
25 changes: 25 additions & 0 deletions docs/source/autodoc/tablet_qt/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,31 @@ tablet_qt
taskxtra/photosequencephoto.h.rst
taskxtra/satisfactioncommon.cpp.rst
taskxtra/satisfactioncommon.h.rst
tests/auto/auto.pro.rst
tests/auto/db/db.pro.rst
tests/auto/db/field/field.pro.rst
tests/auto/db/field/testfield.cpp.rst
tests/auto/graphics/graphics.pro.rst
tests/auto/graphics/graphicsfunc/graphicsfunc.pro.rst
tests/auto/graphics/graphicsfunc/testgraphicsfunc.cpp.rst
tests/auto/layouts/flowlayouthfw/flowlayouthfw.pro.rst
tests/auto/layouts/flowlayouthfw/testflowlayouthfw.cpp.rst
tests/auto/layouts/layouts.pro.rst
tests/auto/lib/convert/convert.pro.rst
tests/auto/lib/convert/testconvert.cpp.rst
tests/auto/lib/filefunc/filefunc.pro.rst
tests/auto/lib/filefunc/testfilefunc.cpp.rst
tests/auto/lib/lib.pro.rst
tests/auto/lib/margins/margins.pro.rst
tests/auto/lib/margins/testmargins.cpp.rst
tests/auto/lib/soundfunc/soundfunc.pro.rst
tests/auto/lib/soundfunc/testsoundfunc.cpp.rst
tests/auto/lib/stringfunc/stringfunc.pro.rst
tests/auto/lib/stringfunc/teststringfunc.cpp.rst
tests/auto/questionnairelib/namevalueoptions/namevalueoptions.pro.rst
tests/auto/questionnairelib/namevalueoptions/testnamevalueoptions.cpp.rst
tests/auto/questionnairelib/questionnairelib.pro.rst
tests/tests.pro.rst
tools/build_client_translations.py.rst
tools/build_qt.py.rst
tools/chord.py.rst
Expand Down
29 changes: 29 additions & 0 deletions docs/source/autodoc/tablet_qt/tests/auto/auto.pro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/auto.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/auto.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../tablet_qt/tests/auto/auto.pro
:language: none
29 changes: 29 additions & 0 deletions docs/source/autodoc/tablet_qt/tests/auto/db/db.pro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/db/db.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/db/db.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../tablet_qt/tests/auto/db/db.pro
:language: none
29 changes: 29 additions & 0 deletions docs/source/autodoc/tablet_qt/tests/auto/db/field/field.pro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/db/field/field.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/db/field/field.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/db/field/field.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/db/field/testfield.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/db/field/testfield.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/db/field/testfield.cpp
:language: C++
29 changes: 29 additions & 0 deletions docs/source/autodoc/tablet_qt/tests/auto/graphics/graphics.pro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/graphics/graphics.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/graphics/graphics.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../tablet_qt/tests/auto/graphics/graphics.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/graphics/graphicsfunc/graphicsfunc.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/graphics/graphicsfunc/graphicsfunc.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/graphics/graphicsfunc/graphicsfunc.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/graphics/graphicsfunc/testgraphicsfunc.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/graphics/graphicsfunc/testgraphicsfunc.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/graphics/graphicsfunc/testgraphicsfunc.cpp
:language: C++
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/layouts/flowlayouthfw/flowlayouthfw.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/layouts/flowlayouthfw/flowlayouthfw.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/layouts/flowlayouthfw/flowlayouthfw.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/layouts/flowlayouthfw/testflowlayouthfw.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/layouts/flowlayouthfw/testflowlayouthfw.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/layouts/flowlayouthfw/testflowlayouthfw.cpp
:language: C++
29 changes: 29 additions & 0 deletions docs/source/autodoc/tablet_qt/tests/auto/layouts/layouts.pro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/layouts/layouts.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal (rnc1001@cam.ac.uk).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/layouts/layouts.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../tablet_qt/tests/auto/layouts/layouts.pro
:language: none

0 comments on commit a6b0054

Please sign in to comment.