-
Notifications
You must be signed in to change notification settings - Fork 758
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
Set up outline mechanism for testing Qt GUI components #4617
Comments
Thanks @claremacrae ! As I mentioned when we talked earlier, I'd love to work with you on this and integrate your work into the main repository. Based on the (relatively light) knowledge I have of the use of Qt in this codebase, the IDE ("scide") would be easier to test in isolation than the Qt-based objects and bindings in the supercollider language ("sclang"), as the latter involve an object proxy and metatype system for converting between C++ and supercollider types. (But perhaps that would be more interesting?) To help you with some quick navigation:
Both the IDE and sclang include a few source files from other parts of the repository as well, it's not quite as tidy as it could be. Any new tests for this project would probably go under I hope you will be able to make it to the developer call this weekend! (date/time still TBD) |
In preparation for this, and after discussion with @brianlheim last night, I have tried to divide the side build up so that it creates a static library, and then links that and a main to create the SuperCollider exe. It is sadly still a work in progress: On Mac, SuperCollider only links successfully when The full diffs of what I've done can be seen at: claremacrae/supercollider@develop...claremacrae:create_libscide Essentially, it is:
Please see the comments in the CMakeLists.txt change in claremacrae@434f7ea for the linker errors (missing symbols) when QtWebEngine is enabled. I've been staring at this for some hours now, so am sharing progress in the hope that anyone might be able to spot a fix for the error. |
The missing symbols linker error is reproducible on Linux too: The Mac CI build fails to find Qt for me - this happened with a previous push - I have not changed any CI files: |
I've found the cause of the linker error - it was my mistake: Next thing to fix: When running from a distribution, the program now runs, but the Post window has this output:
|
I fixed that "There is a discrepancy" message in claremacrae@f68d112 |
@brianlheim Status and questions I think that all the coding/testing that remains on the sc-ide static library change relates to this code: # final builds of the IDE seem to be broken atm
if(0 AND FINAL_BUILD)
CREATE_FINAL_FILE(scide_final.cpp ${ide_sources})
add_library( libscide STATIC scide_final.cpp ${ide_rc_sources} ${RES_FILES})
else()
add_library( libscide STATIC ${ide_sources} ${ide_rc_sources} ${RES_FILES})
endif()
add_executable( SuperCollider MACOSX_BUNDLE core/main_function.cpp ${AdditionalBundleSources}) I need to know whether either of
set(ide_rc_sources ${ide_moc_src} ${ide_forms_src} ${ide_rcc} ${translations}) I suspect that ${ide_moc_src} and ${ide_forms_src} need to go in the library, in order for any tests that link in the library to work. I don't I suspect that ${ide_rcc} and ${translations} need to go in the executable. Request What would be really, really helpful would be for someone who knows how to build and smoke-test the IDE on Windows to test the behaviours of my fork for all the relevant areas to confirm... This would be the code to checkout: https://github.com/claremacrae/supercollider/commits/create_libscide |
I can tell from a Windows build that I have downloaded that I have broken the icon of the exe in the Windows explorer - which confirms my guess about ide_rcc above, so I'll fix that: |
Confirmed by downloading a build, the windows icon is fixed now - by this: The main thing that still needs testing is the translations. |
All my attempts to test the translation mechanism in unmodified source code have failed - see #4619 |
An UpdateFor info, in case anyone would like to see progress so far... And mainly to get it out of my head... I've just pushed the https://github.com/claremacrae/supercollider/tree/topic/scide-test-experiments My current thinking is that I won't create a PR from this branch - it's mostly full of experiments I did to see what would work. Instead, I expect I'll create a new branch and PR later this month... There is a new folder: testsuite/editors/sc-ide/ With two temporary sub-directories:
These lines show the kind of expressiveness I would aspire to in any final tests - with all details hidden behind test fixtures and helper functions: TEST_CASE_METHOD(GoToLineToolFixture, "GoToLineTool emits signal when Go button clicked") {
// Arbitrary upper limit in number of lines.
// When used in the application, this would be obtained from the open docunent
setMaximumLineCount(27);
// Type a number, one digit at a time
typeCharacterIntoSpinner('1');
typeCharacterIntoSpinner('7');
checkActivatedSignalCount(0);
clickGoButton();
checkActivatedSignalCount(1);
checkActivatedSignalValue(17);
} Dependencies - Catch2The only new dependency is a single header copied in to [external_libraries/catch](https://github.com/claremacrae/supercollider/tree/topic/scide-test-experiments/external_libraries/catch} ApprovalTests.cpp.QtI am in the process of creating a new project, ApprovalTests.cpp.Qt, to hide a lot of the boiler-plate of creating Catch2 + Qt Test test suites... https://github.com/approvals/ApprovalTests.cpp.Qt It will end up being a single-header release that will depend on the similarly single-header https://github.com/approvals/ApprovalTests.cpp After my Meeting C++ talk, I'll pick this up again. |
@claremacrae thanks so much for the update and all the work! looking forward to more :) |
Motivation
I'm looking for a Qt desktop project that would like some help adding or improving its automated testing...
The immediate motivation is to help me have some examples to use in a talk I'm giving real soon now, at Meeting C++.
@brianlheim saw my mention of this, with a link to the following tweet, and suggested I look at this project...
https://twitter.com/ClareMacraeUK/status/1185887010554335232
Based on an initial conversation with Brian, I'd really like to contribute to its automated testing - my background is C++ and Qt.
Description of Proposed Feature
Well, that's up for discussion - with this ticket suggested as a place-holder for that...
Based on past experience of automated tests of Qt desktop applications, I'd mainly be wanting to test behaviour rather than appearance.
Plan for Implementation
Q: Who will implement this? How long will it take?
A: Me for setting up the initial outline - with a few initial passing tests, showing different types of testing approach... I would want to do some kind of handover to others, as I wouldn't want to be the single-point-of-future-maintenance!
I have about a working week to work on this, part-time... It will be my main focus.
I am hoping to be able to pair with someone early on, to get me up to speed with the code as soon as possible...
Re handover, one idea might be to do a run-through of my talk for any supercollider developers who were interested - to share how I had worked.. Feedback on the talk would be good too :-)
The text was updated successfully, but these errors were encountered: