Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jun 3, 2019
1 parent 2b15320 commit 776a7bb
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 21 deletions.
2 changes: 1 addition & 1 deletion App/App.pro
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ win32 {

# install icons
icon.target = icon
icon.files = Resource/image/calendar.png
icon.files = Resource/image/LunarCalendar.png
icon.path = $${PREFIX}/share/pixmaps
icon.CONFIG = directory no_check_exist
INSTALLS += DESKTOP_FILE icon
Expand Down
2 changes: 1 addition & 1 deletion App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ INSTALL(FILES ${OTHER_FILES} DESTINATION ".")

if(UNIX)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/debian/LunarCalendar.desktop DESTINATION "share/applications")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/image/calendar.png DESTINATION "share/pixmaps")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/image/LunarCalendar.png DESTINATION "share/pixmaps")
endif()

IF("Release" STREQUAL CMAKE_BUILD_TYPE AND WIN32)
Expand Down
2 changes: 1 addition & 1 deletion App/Resource/Resource.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/image">
<file alias="Calendar">image/calendar.png</file>
<file alias="Calendar">image/LunarCalendar.png</file>
</qresource>
</RCC>
File renamed without changes
1 change: 1 addition & 0 deletions LunarCalendar.pro
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ OTHER_FILES += appveyor.yml \
Install/* \
Update/* \
debian/* \
test/* \
build_debpackage.sh
31 changes: 15 additions & 16 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,24 @@ esac

if [ "${BUILD_TARGERT}" = "unix" ]; then
cd $SOURCE_DIR
if [ "$BUILD_DOWNLOAD" = "TRUE" ]; then
bash build_debpackage.sh ${QT_ROOT}
else
bash build_debpackage.sh ${QT_ROOT}
if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/debian/lunarcalendar/opt/LunarCalendar/bin
MD5=`md5sum ../lunarcalendar*_amd64.deb|awk '{print $1}'`
echo "MD5:${MD5}"
./debian/lunarcalendar/opt/LunarCalendar/bin/LunarCalendarApp \
bash build_debpackage.sh ${QT_ROOT}

sudo dpkg -i ../lunarcalendar*_amd64.deb
$SOURCE_DIR/test/test_linux.sh

if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/debian/lunarcalendar/opt/LunarCalendar/bin
MD5=`md5sum ../lunarcalendar*_amd64.deb|awk '{print $1}'`
echo "MD5:${MD5}"
./debian/lunarcalendar/opt/LunarCalendar/bin/LunarCalendarApp \
-f "`pwd`/update_linux.xml" \
--md5 ${MD5}
export UPLOADTOOL_BODY="Release LunarCalendar-${VERSION}"
#export UPLOADTOOL_PR_BODY=
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh ../lunarcalendar*_amd64.deb update_linux.xml
fi

export UPLOADTOOL_BODY="Release LunarCalendar-${VERSION}"
#export UPLOADTOOL_PR_BODY=
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh ../lunarcalendar*_amd64.deb update_linux.xml
fi

if [ "$TRAVIS_TAG" != "" -a "${QT_VERSION_DIR}" = "512" ]; then
cd debian/lunarcalendar/opt/LunarCalendar

Expand Down
2 changes: 1 addition & 1 deletion debian/LunarCalendar.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Comment=Lunar calendar
Name[zh_CN]=日历
GenericName[zh_CN]=日历
Comment[zh_CN]=日历(包含农历)
Icon=calendar
Icon=LunarCalendar
Exec=/opt/LunarCalendar/bin/LunarCalendarApp
Terminal=false
StartupNotify=true
Expand Down
2 changes: 1 addition & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ case "$1" in
if [ ! -d /usr/share/pixmaps ]; then
mkdir -p /usr/share/pixmaps
fi
ln -s /opt/LunarCalendar/share/pixmaps/calendar.png /usr/share/pixmaps/calendar.png
ln -s /opt/LunarCalendar/share/pixmaps/LunarCalendar.png /usr/share/pixmaps/LunarCalendar.png
fi
echo "/opt/LunarCalendar/lib" > /etc/ld.so.conf.d/LunarCalendar.conf
echo "/opt/LunarCalendar/bin" >> /etc/ld.so.conf.d/LunarCalendar.conf
Expand Down
36 changes: 36 additions & 0 deletions test/test_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

EXIT_CODE=0
PROJECT_NAME="LunarCalendar"

if [ -n "$1" ]; then
echo "$PROJECT_NAME"
PROJECT_NAME=$1
fi

if [ ! -f /opt/share/applications/${PROJECT_NAME}.desktop ]; then
echo "There are not /opt/share/applications/${PROJECT_NAME}.desktop"
EXIT_CODE=$[EXIT_CODE+1]
fi

if [ ! -f /usr/share/applications/${PROJECT_NAME}.desktop ]; then
echo "There are not /usr/share/applications/${PROJECT_NAME}.desktop"
EXIT_CODE=$[EXIT_CODE+1]
fi

if [ ! -f /opt/share/pixmaps/${PROJECT_NAME}.png ]; then
echo "There are not /opt/share/pixmaps/${PROJECT_NAME}.png"
EXIT_CODE=$[EXIT_CODE+1]
fi

if [ ! -f /usr/share/pixmaps/${PROJECT_NAME}.png ]; then
echo "There are not /usr/share/pixmaps/${PROJECT_NAME}.png"
EXIT_CODE=$[EXIT_CODE+1]
fi

if [ ! -f /etc/ld.so.conf.d/LunarCalendar.conf ]; then
echo "There are not /etc/ld.so.conf.d/${PROJECT_NAME}.conf"
EXIT_CODE=$[EXIT_CODE+1]
fi

exit $EXIT_CODE

0 comments on commit 776a7bb

Please sign in to comment.