How to use _create_module method in autotest

Best Python code snippet using autotest_python

conanfile.py

Source:conanfile.py Github

copy

Full Screen

...594 reqs = []595 for r in requires:596 reqs.append(r if "::" in r else "qt%s" % r)597 return reqs598 def _create_module(module, requires=[]):599 componentname = "qt%s" % module600 assert componentname not in self.cpp_info.components, "Module %s already present in self.cpp_info.components" % module601 self.cpp_info.components[componentname].names["cmake_find_package"] = module602 self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module603 self.cpp_info.components[componentname].libs = ["Qt6%s%s" % (module, libsuffix)]604 self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", "Qt%s" % module)]605 self.cpp_info.components[componentname].defines = ["QT_%s_LIB" % module.upper()]606 if module != "Core" and "Core" not in requires:607 requires.append("Core")608 self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires)609 def _create_plugin(pluginname, libname, type, requires):610 componentname = "qt%s" % pluginname611 assert componentname not in self.cpp_info.components, "Plugin %s already present in self.cpp_info.components" % pluginname612 self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname613 self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname614 if not self.options.shared:615 self.cpp_info.components[componentname].libs = [libname + libsuffix]616 self.cpp_info.components[componentname].libdirs = [os.path.join("res", "archdatadir", "plugins", type)]617 self.cpp_info.components[componentname].includedirs = []618 if "Core" not in requires:619 requires.append("Core")620 self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires)621 core_reqs = ["zlib::zlib"]622 if self.options.with_pcre2:623 core_reqs.append("pcre2::pcre2")624 if self.options.with_doubleconversion:625 core_reqs.append("double-conversion::double-conversion")626 if self.options.get_safe("with_icu", False):627 core_reqs.append("icu::icu")628 if self.options.with_zstd:629 core_reqs.append("zstd::zstd")630 _create_module("Core", core_reqs)631 if self.settings.compiler == "Visual Studio":632 self.cpp_info.components["qtCore"].exelinkflags.append("-ENTRY:mainCRTStartup")633 self.cpp_info.components["qtPlatform"].names["cmake_find_package"] = "Platform"634 self.cpp_info.components["qtPlatform"].names["cmake_find_package_multi"] = "Platform"635 if tools.Version(self.version) < "6.1.0":636 self.cpp_info.components["qtCore"].libs.append("Qt6Core_qobject%s" % libsuffix)637 if self.options.gui:638 gui_reqs = []639 if self.options.with_dbus:640 gui_reqs.append("DBus")641 if self.options.with_freetype:642 gui_reqs.append("freetype::freetype")643 if self.options.with_libpng:644 gui_reqs.append("libpng::libpng")645 if self.options.get_safe("with_fontconfig", False):646 gui_reqs.append("fontconfig::fontconfig")647 if self.settings.os in ["Linux", "FreeBSD"]:648 gui_reqs.append("xorg::xorg")649 if not tools.cross_building(self, skip_x64_x86=True):650 gui_reqs.append("xkbcommon::xkbcommon")651 if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no":652 gui_reqs.append("opengl::opengl")653 if self.options.get_safe("with_vulkan", False):654 gui_reqs.append("vulkan-loader::vulkan-loader")655 if self.options.with_harfbuzz:656 gui_reqs.append("harfbuzz::harfbuzz")657 if self.options.with_libjpeg == "libjpeg-turbo":658 gui_reqs.append("libjpeg-turbo::libjpeg-turbo")659 if self.options.with_libjpeg == "libjpeg":660 gui_reqs.append("libjpeg::libjpeg")661 _create_module("Gui", gui_reqs)662 if self.options.with_sqlite3:663 _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"])664 if self.options.with_pq:665 _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"])666 if self.options.with_odbc:667 if self.settings.os != "Windows":668 _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"])669 networkReqs = []670 if self.options.openssl:671 networkReqs.append("openssl::openssl")672 if self.options.with_brotli:673 networkReqs.append("brotli::brotli")674 _create_module("Network", networkReqs)675 _create_module("Sql")676 _create_module("Test")677 if self.options.widgets:678 _create_module("Widgets", ["Gui"])679 if self.options.gui and self.options.widgets:680 _create_module("PrintSupport", ["Gui", "Widgets"])681 if self.options.get_safe("opengl", "no") != "no" and self.options.gui:682 _create_module("OpenGL", ["Gui"])683 if self.options.widgets and self.options.get_safe("opengl", "no") != "no":684 _create_module("OpenGLWidgets", ["OpenGL", "Widgets"])685 if self.options.with_dbus:686 _create_module("DBus")687 _create_module("Concurrent")688 _create_module("Xml")689 if self.options.qt5compat:690 _create_module("Core5Compat")691 if self.options.qtdeclarative:692 _create_module("Qml", ["Network"])693 self.cpp_info.components["qtQml"].build_modules["cmake_find_package"].append(self._cmake_qt6_private_file("Qml"))694 self.cpp_info.components["qtQml"].build_modules["cmake_find_package_multi"].append(self._cmake_qt6_private_file("Qml"))695 _create_module("QmlModels", ["Qml"])696 self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers697 self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner"698 self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"])699 if self.options.gui:700 _create_module("Quick", ["Gui", "Qml", "QmlModels"])701 if self.options.widgets:702 _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"])703 _create_module("QuickShapes", ["Gui", "Qml", "Quick"])704 _create_module("QmlWorkerScript", ["Qml"])705 _create_module("QuickTest", ["Test"])706 if self.options.qttools and self.options.gui and self.options.widgets:707 self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools"708 self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools"709 _create_module("UiPlugin", ["Gui", "Widgets"])710 self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only711 self.cpp_info.components["qtUiPlugin"].libdirs = []712 _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"])713 _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"])714 _create_module("Help", ["Gui", "Sql", "Widgets"])715 if self.options.qtquick3d and self.options.gui:716 _create_module("Quick3DUtils", ["Gui"])717 _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DUtils"])718 _create_module("Quick3DRuntimeRender", ["Gui", "Quick", "Quick3DAssetImport", "Quick3DUtils", "ShaderTools"])719 _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"])720 if self.options.qtquickcontrols2 and self.options.gui:721 _create_module("QuickControls2", ["Gui", "Quick"])722 _create_module("QuickTemplates2", ["Gui", "Quick"])723 if self.options.qtshadertools and self.options.gui:724 _create_module("ShaderTools", ["Gui"])725 if self.options.qtsvg and self.options.gui:726 _create_module("Svg", ["Gui"])727 if self.options.widgets:728 _create_module("SvgWidgets", ["Gui", "Svg", "Widgets"])729 if self.options.qtwayland and self.options.gui:730 _create_module("WaylandClient", ["Gui", "wayland::wayland-client"])731 _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"])732 if self.options.get_safe("qtactiveqt") and self.settings.os == "Windows":733 _create_module("AxBase", ["Gui", "Widgets"])734 _create_module("AxServer", ["AxBase"])735 self.cpp_info.components["qtAxServer"].system_libs.append("shell32")736 self.cpp_info.components["qtAxServer"].defines.append("QAXSERVER")737 _create_module("AxContainer", ["AxBase"])738 if self.options.get_safe("qtcharts"):739 _create_module("Charts", ["Gui", "Widgets"])740 if self.options.get_safe("qtdatavis3d"):741 _create_module("DataVisualization", ["Gui", "OpenGL", "Qml", "Quick"])742 if self.options.get_safe("qtlottie"):743 _create_module("Bodymovin", ["Gui"])744 if self.options.get_safe("qtscxml"):745 _create_module("StateMachine")746 _create_module("StateMachineQml", ["StateMachine", "Qml"])747 _create_module("Scxml")748 _create_plugin("QScxmlEcmaScriptDataModelPlugin", "qscxmlecmascriptdatamodel", "scxmldatamodel", ["Scxml", "Qml"])749 _create_module("ScxmlQml", ["Scxml", "Qml"])750 if self.options.get_safe("qtvirtualkeyboard"):751 _create_module("VirtualKeyboard", ["Gui", "Qml", "Quick"])752 _create_plugin("QVirtualKeyboardPlugin", "qtvirtualkeyboardplugin", "platforminputcontexts", ["Gui", "Qml", "VirtualKeyboard"])753 _create_plugin("QtVirtualKeyboardHangulPlugin", "qtvirtualkeyboard_hangul", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"])754 _create_plugin("QtVirtualKeyboardMyScriptPlugin", "qtvirtualkeyboard_myscript", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"])755 _create_plugin("QtVirtualKeyboardThaiPlugin", "qtvirtualkeyboard_thai", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"])756 if self.options.get_safe("qt3d"):757 _create_module("3DCore", ["Gui", "Network"])758 _create_module("3DRender", ["3DCore", "OpenGL"])759 _create_module("3DAnimation", ["3DCore", "3DRender", "Gui"])760 _create_module("3DInput", ["3DCore", "Gui"])761 _create_module("3DLogic", ["3DCore", "Gui"])762 _create_module("3DExtras", ["Gui", "3DCore", "3DInput", "3DLogic", "3DRender"])763 _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"])764 _create_plugin("fbxGeometryLoaderPlugin", "fbxgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"])765 _create_module("3DQuick", ["3DCore", "Gui", "Qml", "Quick"])766 _create_module("3DQuickAnimation", ["3DAnimation", "3DCore", "3DQuick", "3DRender", "Gui", "Qml"])767 _create_module("3DQuickExtras", ["3DCore", "3DExtras", "3DInput", "3DQuick", "3DRender", "Gui", "Qml"])768 _create_module("3DQuickInput", ["3DCore", "3DInput", "3DQuick", "Gui", "Qml"])769 _create_module("3DQuickRender", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"])770 _create_module("3DQuickScene2D", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"])771 if self.options.get_safe("qtimageformats"):772 _create_plugin("ICNSPlugin", "qicns", "imageformats", ["Gui"])773 _create_plugin("QJp2Plugin", "qjp2", "imageformats", ["Gui"])774 _create_plugin("QMacHeifPlugin", "qmacheif", "imageformats", ["Gui"])775 _create_plugin("QMacJp2Plugin", "qmacjp2", "imageformats", ["Gui"])776 _create_plugin("QMngPlugin", "qmng", "imageformats", ["Gui"])777 _create_plugin("QTgaPlugin", "qtga", "imageformats", ["Gui"])778 _create_plugin("QTiffPlugin", "qtiff", "imageformats", ["Gui"])779 _create_plugin("QWbmpPlugin", "qwbmp", "imageformats", ["Gui"])780 _create_plugin("QWebpPlugin", "qwebp", "imageformats", ["Gui"])781 if self.options.get_safe("qtnetworkauth"):782 _create_module("NetworkAuth", ["Network"])783 if self.options.get_safe("qtcoap"):784 _create_module("Coap", ["Network"])785 if self.options.get_safe("qtmqtt"):786 _create_module("Mqtt", ["Network"])787 if self.options.get_safe("qtopcua"):788 _create_module("OpcUa", ["Network"])789 _create_plugin("QOpen62541Plugin", "open62541_backend", "opcua", ["Network", "OpcUa"])790 _create_plugin("QUACppPlugin", "uacpp_backend", "opcua", ["Network", "OpcUa"])791 if self.settings.os != "Windows":792 self.cpp_info.components["qtCore"].cxxflags.append("-fPIC")793 if not self.options.shared:794 if self.settings.os == "Windows":795 self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library796 self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library797 self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library798 self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library799 self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library800 self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library801 self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi")802 if self.settings.os == "Macos":...

Full Screen

Full Screen

cpp.py

Source:cpp.py Github

copy

Full Screen

...21 lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)22 return lib, os.path.basename(lib_path[0])23_LIB, _LIB_NAME = _load_lib()24_init_api_prefix("topi.cpp", "topi")25def _create_module(name):26 fullname = __name__ + "." + name27 mod = _new_module(fullname)28 sys.modules[fullname] = mod29 return mod30# pylint: disable-msg=C010331nn = _create_module("nn")32_init_api_prefix("topi.cpp.nn", "topi.nn")33generic = _create_module("generic")34_init_api_prefix("topi.cpp.generic", "topi.generic")35cuda = _create_module("cuda")36_init_api_prefix("topi.cpp.cuda", "topi.cuda")37rocm = _create_module("rocm")38_init_api_prefix("topi.cpp.rocm", "topi.rocm")39x86 = _create_module("x86")40_init_api_prefix("topi.cpp.x86", "topi.x86")41vision = _create_module("vision")42_init_api_prefix("topi.cpp.vision", "topi.vision")43yolo = _create_module("vision.yolo")44_init_api_prefix("topi.cpp.vision.yolo", "topi.vision.yolo")45image = _create_module("image")...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful