Skip to content

Unit tests for DiagramContainer#32

Open
sberegszaszi wants to merge 6 commits into
KGergo88:masterfrom
sberegszaszi:NewUnitTests
Open

Unit tests for DiagramContainer#32
sberegszaszi wants to merge 6 commits into
KGergo88:masterfrom
sberegszaszi:NewUnitTests

Conversation

@sberegszaszi
Copy link
Copy Markdown
Collaborator

@sberegszaszi sberegszaszi commented Jul 22, 2020

Tests added for DiagramContainer. Coverage is not complete.

Details:
  - Debug function call fixed in DiagramContainer constructor
  - "new_backend" parameter name deleted in deleted DiagramContainer and Element constructors
  - source and header files added to test.pro file
Details:
  - Switching to test fixture
  - ParentReferencingWorks test is failing, printing additional information
Details:
  - Bug fix in DiagramContainer::parent function
…tDiagramContainer

Details:
  - Using QSignalSpy class, testlib added to Qt components in test.pro
@sberegszaszi sberegszaszi linked an issue Jul 22, 2020 that may be closed by this pull request
Details:
    - test.pro file now includes every cpp and header file
    - backend and serial_port tests create an object
@sberegszaszi sberegszaszi changed the title New unit tests Unit tests for DiagramContainer Aug 5, 2020
@KGergo88 KGergo88 added the enhancement New, or improved functionality label Aug 30, 2020
@sberegszaszi
Copy link
Copy Markdown
Collaborator Author

@KGergo88 I've been trying to improve the coverage but checking Coveralls results for the diagram_container.cpp and hpp files the analytics seems to be off. Seems to me like random lines are marked as uncovered (example lines 160-169 in diagram_container.cpp). Checking other files I found some other lines marked uncovered that seem inaccurate (example measurement_data_protocoll.hpp lines 53/54/65, diagram.hpp line 59).

I've tried looking into it but could not find the cause yet. Any ideas?

Should I open a separate issue for this and carry on with finishing up this PR regardless?

@KGergo88
Copy link
Copy Markdown
Owner

KGergo88 commented Sep 2, 2020

@KGergo88 I've been trying to improve the coverage but checking Coveralls results for the diagram_container.cpp and hpp files the analytics seems to be off. Seems to me like random lines are marked as uncovered (example lines 160-169 in diagram_container.cpp). Checking other files I found some other lines marked uncovered that seem inaccurate (example measurement_data_protocoll.hpp lines 53/54/65, diagram.hpp line 59).

I've tried looking into it but could not find the cause yet. Any ideas?

Should I open a separate issue for this and carry on with finishing up this PR regardless?

Yep, that is odd. You can also try to generate coverage locally with this script: https://github.com/KGergo88/RDB_Diplomaterv_Monitor/blob/master/tests/test_coverage.py

If that says ok, then we could merge it.

@sberegszaszi
Copy link
Copy Markdown
Collaborator Author

Yep, that is odd. You can also try to generate coverage locally with this script: https://github.com/KGergo88/RDB_Diplomaterv_Monitor/blob/master/tests/test_coverage.py

Great, thanks! :) This does give me some different numbers and the line-by-line analysis is more usable so I can refine the tests.
Screenshot_2020-09-02_22-14-17

@KGergo88
Copy link
Copy Markdown
Owner

KGergo88 commented Sep 8, 2020

Strange, this should be more or less the same. Maybe the Coveralls data is created wrong? See last line here: https://github.com/KGergo88/RDB_Diplomaterv_Monitor/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New, or improved functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests to the project

2 participants