From b51471793c3992ed643eade30da80c640b93aa16 Mon Sep 17 00:00:00 2001
From: xiaoming <2014500726@smail.xtu.edu.cn>
Date: Mon, 14 Aug 2023 18:20:30 +0800
Subject: [PATCH] test:update test case
Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn>
---
.github/workflows/test_archlinux.yml | 77 ++++++++++++++++++++++++++++
build_deb.sh | 5 +-
src/YUVviewer.cpp | 1 -
3 files changed, 80 insertions(+), 3 deletions(-)
create mode 100644 .github/workflows/test_archlinux.yml
diff --git a/.github/workflows/test_archlinux.yml b/.github/workflows/test_archlinux.yml
new file mode 100644
index 0000000..7506784
--- /dev/null
+++ b/.github/workflows/test_archlinux.yml
@@ -0,0 +1,77 @@
+name: test_archlinux
+
+on:
+ push:
+ branches: [ test_archlinux ]
+ paths-ignore:
+ - 'doc/**'
+ - 'README.md'
+ - 'README_zh_CN.md'
+ - 'DEVELOPNOTE.md'
+ - '.readthedocs.yaml'
+ pull_request:
+ branches: [ test_archlinux ]
+ paths-ignore:
+ - 'doc/**'
+ - 'README.md'
+ - 'README_zh_CN.md'
+ - 'DEVELOPNOTE.md'
+ - '.readthedocs.yaml'
+ workflow_dispatch:
+
+jobs:
+ ubuntu-2004:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v3.3.0
+ with:
+ version: '6.2.0'
+
+ - name: Setup OpenCV
+ uses: Dovyski/setup-opencv-action@v1.1
+ with:
+ opencv-version: 4.0.0
+ opencv-extra-modules: false
+
+ - name: Install prerequisites
+ run: |
+ sudo apt update
+ sudo apt install -y make gcc patchelf chrpath qt5-default
+
+ - name: Build all
+ run: |
+ git fetch --tags --force
+ git describe --always --long --dirty --abbrev=10 --tags | awk '{print "\""$0"\""}' > git_tag.inc
+ sed -i 's/git_tag.inc/git_tag.ci.inc/g' YUVviewer.pro
+ sed -i 's/QT_DIR=\/opt\/Qt6.2.0\/6.2.0\/gcc_64/QT_DIR=$(cd "$(dirname "$0")";pwd)\/..\/Qt\/6.2.0\/gcc_64/g' build_deb.sh
+ sed -i 's/\/home\/xiaoming\/Desktop\/opencv/\/usr\/local/g' build_deb.sh
+ sed -i 's/\/home\/xiaoming\/Desktop\/opencv/\/usr\/local/g' partform_unix.pri
+ ./build_deb.sh
+
+ - uses: addnab/docker-run-action@v3
+ with:
+ image: m0rf30/arch-yay:latest
+ options: -v ${{ github.workspace }}:/work
+ run: |
+ yay -Syu --noconfirm gdb
+ yay -Syu --noconfirm yuvviewer-bin
+ echo "test ldd yuvviewer E"
+ ldd /opt/YUVviewer/YUVviewer
+ echo "test ldd yuvviewer X"
+ echo ".................................................."
+ echo "test run yuvviewer E"
+ echo "run" > ~/.gdbinit
+ cp /work/out_arch/YUVviewer /opt/YUVviewer/YUVviewer
+ gdb --args /opt/YUVviewer/YUVviewer --version
+ echo "test run yuvviewer X"
+
+ - name: Upload build asserts
+ uses: actions/upload-artifact@v3.1.2
+ with:
+ name: out_arch
+ path: |
+ ./out_arch
+
\ No newline at end of file
diff --git a/build_deb.sh b/build_deb.sh
index 0847a16..84f806f 100755
--- a/build_deb.sh
+++ b/build_deb.sh
@@ -23,7 +23,7 @@ YUVVIEWER_VERSION="V"$YUVVIEWER_MAJARVERSION$YUVVIEWER_SUBVERSION$YUVVIEWER_REVI
# 编译
rm -rf .qmake.stash Makefile
lrelease ./YUVviewer.pro
-qmake ./YUVviewer.pro -spec linux-g++ CONFIG+=qtquickcompiler
+qmake ./YUVviewer.pro -spec linux-g++ CONFIG+=qtquickcompiler CONFIG+=debug
make clean
make -j8
# clean打包目录
@@ -52,6 +52,7 @@ InstalledSize=$SIZE
sed -i "s/#SIZE#/$InstalledSize/g" ./dpkg/YUVviewer_Linux_"$YUVVIEWER_VERSION"_x86_64/DEBIAN/control
chmod 755 ./dpkg/YUVviewer_Linux_"$YUVVIEWER_VERSION"_x86_64/* -R
# 打包
-dpkg -b ./dpkg/YUVviewer_Linux_"$YUVVIEWER_VERSION"_x86_64 ./dpkg/YUVviewer_Linux_"$YUVVIEWER_VERSION"_x86_64.deb
+mkdir out_arch
+cp ./dpkg/YUVviewer_Linux_"$YUVVIEWER_VERSION"_x86_64/* ./out_arch
echo build success!
###############################################################################
diff --git a/src/YUVviewer.cpp b/src/YUVviewer.cpp
index c53583f..7baa115 100644
--- a/src/YUVviewer.cpp
+++ b/src/YUVviewer.cpp
@@ -17,7 +17,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see .
*/
-#include
#include
#include
#include