Hello, I am trying to launch test plugins but I faced some problems.
In particular, the test plugin id (given as argument to the test app by "/BlueBerry.testplugin=id.of.my.test.plugin", I am using ctest to launch it) is not retrieved by berry::UITestApplication::Start (plugin org.blueberry.uitest): the line "testPlugin = Platform::GetDebugOption(Platform::PROP_TESTPLUGIN).toString();" return an empty string.
I have tried adding a line "app.setProperty(mitk::BaseApplication::ARG_TESTPLUGIN, "id.of.my.test.plugin");" directly in the main() of my test application but it does not change nothing.
I suppose I am missing something in the test application or in the configuration of the test plugin. Is there exists an example of test application that address this problem?
Or is there someone that know how to fix it?Enclosed to this message is the code for my test application. The test plugin itself is an adapted copy of Testing\org.blueberry.core.runtime.tests
Notes, to make I works, I needed to do some modifications in the MITK code, maybe it is a being of explanation of linked problems:
* in the plugin "org.blueberry.core.runtime", class berry::ApplicationContainer, function RegisterAppDescriptors(), I have an "availableApps[i]->GetUniqueIdentifier()" that is empty so the call to CreateAppDescriptor(availableApps[i]) crash. I have added a test if (!availableApps[i]->GetUniqueIdentifier().isEmpty()) to protect the call.
*in the plugin "org.blueberry.uitest", berryPluginActivator.cpp, I needed to uncomment the line BERRY_REGISTER_EXTENSION_CLASS(UITestApplication, context)
* This uncomment produces a compilation error because the function UITestApplication::Start() has not the right signature, I have replaced it by "QVariant Start(IApplicationContext* context);"
Thank you, Yann -- Pollen Metrology Pollen Metrology Yann Zimmermann – Project Manager 9 rue du Rocher de Lorzier – 38430 Moirans – France Office: +33 (0)476657121www.pollen-metrology.com <http://www.pollen-metrology.com/> youtube <https://www.youtube.com/watch?v=pCj_L4ucxGk>linked-in <https://www.linkedin.com/company/pollen-technology>
/************************************************************************* * * Pollen Metrology CONFIDENTIAL * __________________ * * [2014-2016] Pollen Metrology * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the * property of Pollen Metrology. * The intellectual and technical concepts contained herein are * proprietary to Pollen Metrology and may be covered by French, * European and/or Foreign Patents, patents in process, and are * protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Pollen Metrology. * */ #include <mitkBaseApplication.h> #include "berryLog.h" #include <QVariant> int main(int argc, char** argv) { mitk::BaseApplication app(argc, argv); // arguments are here for (int i = 1; i < argc; ++i) { QString arg(QString::fromLocal8Bit(argv[i])); BERRY_INFO << "arg : " << arg; } // does not change nothing app.setProperty(mitk::BaseApplication::PROP_TESTAPPLICATION, "id.of.the.test.plugin"); // does not change nothing app.setProperty(mitk::BaseApplication::ARG_TESTPLUGIN, "id.of.the.test.plugin"); // if I forget it, it does not work app.setProperty(mitk::BaseApplication::PROP_APPLICATION, "org.blueberry.uitest"); // Run the workbench return app.run(); } /* First line of output: 30: Test command: C:\path\to\my\test\app.exe "/BlueBerry.application=uitestapplication" "/BlueBerry.testapplication=id.of.the.test.plugin" "/BlueBerry.testplugin=id.of.the.test.plugin" 30: Test timeout computed to be: 1500 30: Sun Jul 3 19:20:04 2016 30: 0.01 BlueBerry: arg : /BlueBerry.application=uitestapplication 30: 0.01 BlueBerry: arg : /BlueBerry.testapplication=id.of.the.test.plugin 30: 0.01 BlueBerry: arg : /BlueBerry.testplugin=id.of.the.test.plugin */
<<attachment: yann_zimmermann.vcf>>
------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape
_______________________________________________ mitk-users mailing list mitk-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mitk-users