[go: nahoru, domu]

Skip to content

Commit

Permalink
Automated testing with Google Test cagnulein#911 (cagnulein#1111)
Browse files Browse the repository at this point in the history
* cagnulein#911 new branch with a very basic google test. Needs google test downloaded into /google_test. Will probably set up another submodule at some point.

* cagnulein#911 added google test as a submodule

* Attempt to get lib and test project to build in action

* cagnulein#911 trying to get submodule checkout to work

* cagnulein#911 trying to get Linux build to happen

* cagnulein#911 added header include

* cagnulein#996 put the values from settings read for device discovery into a class

* cagnulein#996 moved the enormous if statement for device detection to a method.

* cagnulein#996 split device detection into detection and bluetoothdevice object creation

* cagnulein#996 return the created object (but don't use it)

* cagnulein#996 factored out starting of template managers into a single location

* cagnulein#911 beginning of 2 device detection tests using google test

* cagnulein#911 removed unnecessary #pragma once

* cagnulein#996 put new classes into separate files. Added exclusions to devicediscoveryinfo to replicate current production behaviour

* cagnulein#996 comments on functions

* cagnulein#911 latest work. Tests crash in Windows.

* cagnulein#911 2 device detection tests working

* cagnulein#911 added test data classes for remaining devices

* cagnulein#911 missed file

* cagnulein#911 tests build and run. Most fail due to incomplete config.

* cagnulein#911 filled in details for some of the device tests

* cagnulein#911 filled in vast majority of test data. Doesn't build, and some obscure situations yet to be done.

* cagnulein#911 use template method instead

* cagnulein#911 builds, some tests failing

* cagnulein#911 fixed some tests.

* cagnulein#911 device identification tests passing to the currently possible extent, pending feedback.

* cagnulein#911 start of work testing device object creation

* cagnulein#911 got bluetoothdevice object creation tests working

* cagnulein#911 added manufacturer data for m3i bike test, and fixed case sensitivity of m3i bike test.

* cagnulein#911 added ability to specify and test multiple settings configurations

* cagnulein#911 fixed typos

* cagnulein#911 parameterized version

* cagnulein#911 fixed file name to match class

* cagnulein#911 added version using typed tests. Refactored to share basic test code from original test suite.

* cagnulein#911 added googletest submodule to the documentation

* cagnulein#911 rework to match current functioning of the bluetooth class, instead of the result of current work on cagnulein#996.

* cagnulein#911 updated for changes in master. Still doesn't actually work.

* cagnulein#911 added configuration of test QSettings.

QSettings are probablly not set up properly, but the tests actually run now, but many fail.

* cagnulein#911 added test settings facility

This enables the developer to override the default QSettings for the life of a test suite.

* cagnulein#911 start tests with default settings.

* cagnulein#911 got exclusions working

At least, where the bluetoothdevice object can actually work.

* cagnulein#911 skip abstract devices

* cagnulein#911 removed some unused code

* cagnulein#911 removed unused file

* cagnulein#911 include app project in main project

* cagnulein#911 updated for latest device detection code

* cagnulein#911 added submodule checkout of googletest to Android build

* cagnulein#911 run qmake from the root in android build

* cagnulein#911 adjusted test names and made the test for the invalid bluetooth device info test with enabling and disabling settings.

* cagnulein#911 enabled the test for non-detection with invalid names

* cagnulein#911 fixed test

* cagnulein#911 updated comments

* cagnulein#911 moved devicediscoveryinfo to the testing project

* cagnulein#911 move devicediscoveryinfo to the test project

* cagnulein#911 removed a unused class

* cagnulein#911 removed unused file

* cagnulein#911 modify correct object

* cagnulein#911 modify correct object

* cagnulein#911 removed irrelevant comment

* adding ls to locate llvm-arm

* debugging github actions

* Update main.yml

* cagnulein#911 try being more specific about tst project dependency

* trying linking llvm-ar

* debugging llvm

* adding alias to llvm-ar

* enabling aliases

* Update main.yml

* maybe the last one for fixing CI?

* cagnulein#911 see how the CI builds go without the app project

* cagnulein#911 restored app project to root project

* trying to move the alias just before the make process

* trying to use NDK_LLVM_PATH

* trying set AR variable

* seems to be the right way

* fixing test m3i

* updating version aligned with the master

* cagnulein#911 moved some definitions to defaults.pri

* cagnulein#911 adjusted test case for adjusted detection rule

* cagnulein#911 adjusted relative path

* cagnulein#911 try adding toolchain/bin to path

* cagnulein#911 revert previous change and show the PATH

* cagnulein#911 fixed yml file

* cagnulein#911 restored previous working yml file

* cagnulein#911 show the PATH

* cagnulein#911 moved some android related content to the shared defaults.pri

* cagnulein#911 ignore the test and lib projects in an Android build

* cagnulein#911 restore yml without AR specified

* cagnulein#911 updated for the "TOORX" option for Horizon Treadmill

* cagnulein#911 added test for the new detection criteria for Horizon Treadmill (TOORX)

* cagnulein#911 added test for Kingsmith WR1 rowing device

* cagnulein#911 added test cases for Toorx experience etc

* cagnulein#911 added test case for FTMS Bike named KICKR CORE

* cagnulein#911 simplified setup of multiple detection configs

* cagnulein#911 further simplification of test config setup

* version aligned with master

Co-authored-by: Roberto Viola <cagnulein@gmail.com>
  • Loading branch information
drmason789 and cagnulein committed Jan 12, 2023
1 parent e10e7e5 commit c9ec71a
Show file tree
Hide file tree
Showing 117 changed files with 4,877 additions and 976 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ jobs:
repository: cagnulein/qmdnsengine
path: "src/qmdnsengine/"
ref: "zwift"

- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: google/googletest
path: "tst/googletest/"
ref: "release-1.12.1"

- uses: actions/checkout@v2
- name: Checkout submodule repo
Expand Down Expand Up @@ -70,14 +78,15 @@ jobs:

- name: Build
run: |
cd src
qmake
cd src
echo "#define STRAVA_SECRET_KEY ${{ secrets.strava_secret_key }}" > secret.h
echo "#define SMTP_USERNAME ${{ secrets.smtp_username }}" >> secret.h
echo "#define SMTP_PASSWORD ${{ secrets.smtp_password }}" >> secret.h
echo "#define SMTP_SERVER ${{ secrets.smtp_server }}" >> secret.h
cd ..
make -j8
cd debug
cd src/debug
mkdir output
mkdir appx
cp qdomyos-zwift.exe output/
Expand Down Expand Up @@ -217,6 +226,14 @@ jobs:
path: "src/qmdnsengine/"
ref: "zwift"

- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: google/googletest
path: "tst/googletest/"
ref: "release-1.12.1"

- name: Install packages required to run QZ inside workflow
run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

Expand All @@ -228,7 +245,7 @@ jobs:
modules: 'qtnetworkauth qtcharts'

- name: Compile Linux Desktop
run: cd src; qmake; make -j8
run: qmake; make -j8

- name: Archive linux-desktop binary
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -334,6 +351,14 @@ jobs:
repository: cagnulein/qmdnsengine
path: "src/qmdnsengine/"
ref: "zwift"

- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: google/googletest
path: "tst/googletest/"
ref: "release-1.12.1"

- name: Install packages required to run QZ inside workflow
run: sudo apt update -y && sudo apt-get install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtquickcontrols2-5-dev libqt5bluetooth5 libqt5widgets5 libqt5positioning5 libqt5xml5 qtconnectivity5-dev qtpositioning5-dev libqt5charts5-dev libqt5charts5 libqt5networkauth5-dev libqt5websockets5* libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev
Expand Down Expand Up @@ -382,7 +407,7 @@ jobs:
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '8'

- name: Set Android NDK 21 && build
run: |
# Install NDK 21 after GitHub update
Expand All @@ -393,9 +418,10 @@ jobs:
echo "y" | $SDKMANAGER "ndk;21.4.7075529"
export ANDROID_NDK="${ANDROID_SDK_ROOT}/ndk-bundle"
export ANDROID_NDK_ROOT="${ANDROID_NDK}"
ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK
rm -rf /usr/local/lib/android/sdk/ndk/25.1.8937393
cd src; qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' && make -j4 && make INSTALL_ROOT=${{ github.workspace }}/output/android/ install
qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' && make -j4 && make INSTALL_ROOT=${{ github.workspace }}/output/android/ install
- name: Build APK (not usable for production due to unpatched QT library)
run: cd src; androiddeployqt --input android-qdomyos-zwift-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-31 --gradle --aab
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ template-examples/train-program-saver/.eslintrc.js
template-examples/train-program-saver/.jshintrc
template-examples/train-program-saver/debug.js

google_test/*

# Qt-es
*.pro.user
*build-*
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
path = src/qmdnsengine
url = https://github.com/cagnulein/qmdnsengine.git
branch = zwift
[submodule "tst/googletest"]
path = tst/googletest
url = https://github.com/google/googletest.git
branch = tags/release-1.12.1
14 changes: 14 additions & 0 deletions defaults.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
QT += gui bluetooth widgets xml positioning quick networkauth websockets texttospeech location multimedia
QTPLUGIN += qavfmediaplayer
QT+= charts

unix:android: QT += androidextras gui-private

android: include(android_openssl/openssl.pri)

INCLUDEPATH += $$PWD/src/qmdnsengine/src/include

ANDROID_PACKAGE_SOURCE_DIR = $$PWD/src/android

ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64

2 changes: 2 additions & 0 deletions docs/10_Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $ git clone https://github.com/cagnulein/qdomyos-zwift.git
$ cd qdomyos-zwift
$ git submodule update --init src/smtpclient/
$ git submodule update --init src/qmdnsengine/
$ git submodule update --init tst/googletest/
$ cd src
$ qmake
$ make -j4
Expand Down Expand Up @@ -108,6 +109,7 @@ This operation takes a moment to complete.
`cd qdomyos-zwift`
`git submodule update --init src/smtpclient/`
`git submodule update --init src/qmdnsengine/`
`git submodule update --init tst/googletest/`
`cd src`
`qmake`
`make`
Expand Down
18 changes: 18 additions & 0 deletions qdomyos-zwift.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
TEMPLATE = subdirs
CONFIG+=ordered

!android: {
SUBDIRS = \
src/qdomyos-zwift-lib.pro \
src/qdomyos-zwift.pro \
tst/qdomyos-zwift-tests.pro

tst.depends = src/qdomyos-zwift-lib.pro
}

android: {
SUBDIRS = \
src/qdomyos-zwift.pro
}


Loading

0 comments on commit c9ec71a

Please sign in to comment.