Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. google unit test qwebview engine.

google unit test qwebview engine.

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 702 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rafael
    wrote on last edited by
    #1

    I setup a project with a library, main gui , and a unit test.
    I want to unit test the library functionality mainly that i am getting the right values from the qwebengineview.
    in my main gui i get the correct output in the console.
    but when in the unit test i dont get any output. i think i have a problem with the event loop.

    could you please let me know what i am doing wrong.

    #include <gtest/gtest.h>
    #include <gmock/gmock-matchers.h>
    
    #include "rotationtestlibrary.h"
    #include <QDebug>
    #include <QLibrary>
    
    using namespace testing;
    
    
    
    TEST(FirstTest, HelloWorld)
    {
        QWidget *widget = new QWidget();
        RotationTestLibrary *rl = new RotationTestLibrary(widget);
    
        // rl is getWelcome is always empty
        EXPECT_EQ(rl->getWelcome(),QString("Header"));
    
        delete widget;
    }
    
    #include "tst_rotationtest.h"
    
    #include <gtest/gtest.h>
    #include "rotationtestlibrary.h"
    #include <QApplication>
    
    
    int main(int argc, char *argv[])
    {
        ::testing::InitGoogleTest(&argc, argv);
    
        QApplication app(argc,argv);
        return RUN_ALL_TESTS();
        app.exec();
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved