Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add display unit-test #171

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@justforlxz
Copy link
Member

commented Apr 19, 2019

添加显示模块调整缩放的转换函数测试单元。

@justforlxz justforlxz requested review from BLumia, hualet and zccrs Apr 19, 2019

@justforlxz

This comment has been minimized.

Copy link
Member Author

commented Apr 19, 2019

测试成功情况

image

[ctest] Test project /home/justforlxz/Projects/Deepin/dde-control-center/build
[ctest]     Start 1: unit-test
[ctest] 1/1 Test #1: unit-test ........................   Passed    0.06 sec
[ctest] 
[ctest] 100% tests passed, 0 tests failed out of 1
[ctest] 
[ctest] Total Test time (real) =   0.06 sec
[ctest] CTest finished with return code 0

测试失败情况

将其中一项的值修改为错误值

image

[ctest] Test project /home/justforlxz/Projects/Deepin/dde-control-center/build
[ctest]     Start 1: unit-test
[ctest] 1/1 Test #1: unit-test ........................***Failed    0.06 sec
[ctest] ********* Start testing of DisplayTest *********
[ctest] Config: Using QtTest library 5.10.1, Qt 5.10.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.3.0)
[ctest] PASS   : DisplayTest::initTestCase()
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] FAIL!  : DisplayTest::testSliderValue(converToSlider) Compared values are not the same
[ctest]    Actual   (DisplayWidget::convertToSlider(value)): 7
[ctest]    Expected (result)                               : 17
[ctest]    Loc: [/home/justforlxz/Projects/Deepin/dde-control-center/build/tests/unit-test_autogen/EWIEGA46WW/../../../../tests/display_test.h(34)]
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::testSliderValue(converToSlider)
[ctest] PASS   : DisplayTest::cleanupTestCase()
[ctest] Totals: 10 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
[ctest] ********* Finished testing of DisplayTest *********
[ctest] QFileSystemWatcher::removePaths: list is empty
[ctest] QFileSystemWatcher::removePaths: list is empty
[ctest] 
[ctest] 
[ctest] 0% tests passed, 1 tests failed out of 1
[ctest] 
[ctest] Total Test time (real) =   0.06 sec
[ctest] 
[ctest] The following tests FAILED:
[ctest] 	  1 - unit-test (Failed)
[ctest] Errors while running CTest
[ctest] CTest finished with return code 8

@justforlxz justforlxz force-pushed the justforlxz:feat/master/unit-test_display branch 3 times, most recently from c254821 to ef1654f Apr 19, 2019

@BLumia
Copy link
Member

left a comment

大王让我来-1

@hualet

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

这个提交主要是写cmake的吧?写了一大堆cmake,最后测试还不到100行 😂

@justforlxz justforlxz force-pushed the justforlxz:feat/master/unit-test_display branch 2 times, most recently from d7b21ff to c887074 May 23, 2019

@justforlxz justforlxz requested a review from BLumia May 23, 2019

@justforlxz justforlxz force-pushed the justforlxz:feat/master/unit-test_display branch from c887074 to 433b0a3 May 23, 2019

@justforlxz justforlxz force-pushed the justforlxz:feat/master/unit-test_display branch from 433b0a3 to 6ab93f8 May 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.