Component testing method and device, electronic equipment and readable storage medium

By automating the processing of code repositories and configuration files, generating configuration modification commands, and packaging component testing applications, the high cost and accuracy issues caused by manual operations in Unity engine component testing are resolved, achieving a more efficient testing process.

CN119807039BActive Publication Date: 2025-12-19CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411835355.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-12-19
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

In existing technologies, component testing based on the Unity engine requires manual modification of multiple configurations, resulting in high time and manpower costs, and is prone to human error, affecting the accuracy of test results.

Method used

This paper provides a component testing method that automates the acquisition and parsing of code library files and configuration files, generates configuration modification commands, and automates the packaging and testing of component applications, reducing human intervention.

Benefits of technology

It reduced labor and time costs, improved the accuracy of test results, and reduced the occurrence of human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807039B_ABST
    Figure CN119807039B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of component test method, device, electronic equipment and readable storage medium, comprising: obtaining the location path of the version package of the component to be tested and engine test example project;The code base file and configuration file containing specified adapter are obtained by decompressing the version package of the component to be tested;Code base file is copied to engine test example project by the location path of engine test example project;A number of sets of configuration modification commands are obtained by parsing code base file and configuration file;A number of new engine test example projects are obtained by respectively modifying the configuration file in engine test example project through a number of sets of configuration modification commands;A number of component test applications of the component to be tested are obtained by respectively packing a number of new engine test example projects, the present application is set up by the automation of component test, reduce time, manpower and maintenance cost, while improving the accuracy of test result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computers, and particularly relates to a component testing method and device, electronic equipment and a readable storage medium. BACKGROUND

[0002] The Unity engine is a widely used cross-platform game development engine that supports game and application development on multiple platforms. Components developed based on the Unity engine often need to be integrated into UnityTestDemo (UnityTestDemo refers to a test example program developed using the Unity engine and integrating FrameWork framework components) during testing, and various different configurations need to be manually modified, and then packaged into an App and tested on an Android / iOS device.

[0003] However, this manual operation method has obvious disadvantages. First, the modified configuration items are numerous, and a large amount of time is required for version testers to modify them one by one, increasing the labor and time costs. Second, manual operation requires testers to be highly focused, otherwise human errors are likely to occur, directly or indirectly affecting the accuracy of the test results. In addition, each test requires re-manual operation, resulting in high maintenance costs. SUMMARY

[0004] The present application provides a component testing method, device, electronic equipment and readable storage medium, in order to solve the problem of high cost and low accuracy caused by the need for re-manual operation for each test.

[0005] In order to solve the above technical problems, the present application is implemented as follows:

[0006] In a first aspect, the present application provides a component testing method, which comprises:

[0007] Obtaining the location path of a component version package to be tested and an engine test example project;

[0008] Decompressing the component version package to be tested to obtain a code library file and a configuration file containing a specified adapter;

[0009] Copying the code library file to the engine test example project through the location path of the engine test example project;

[0010] Parsing the code library file and the configuration file to obtain a plurality of sets of configuration modification commands;

[0011] Modifying the configuration file in the engine test example project through the plurality of sets of configuration modification commands to obtain a plurality of new engine test example projects;

[0012] The new engine test example projects are packaged respectively to obtain a plurality of component test applications of the component to be tested.

[0013] Optionally, before the location path of the engine test example project is obtained, the method further comprises:

[0014] Different versions of the engine and different types of operating systems are obtained.

[0015] For any operating system, different installation paths of different versions of the engine in the operating system are set, and the installation paths carry operating system identifiers and engine identifiers.

[0016] Optionally, after the different installation paths of different versions of the engine in the operating system are set for any operating system, the method further comprises:

[0017] A component test instruction issued by a user through a target terminal device is received, wherein the target terminal device comprises a target operating system and a target engine, and the component test instruction carries a target operating system identifier and a target engine identifier.

[0018] The target operating system identifier and the target engine identifier are searched in the operating system identifiers and the engine identifiers of the installation paths.

[0019] The target installation path of the target engine in the target operating system in the target terminal device is determined according to the search result.

[0020] A location path of the engine test example project is obtained.

[0021] The location path and the target installation path are combined to obtain an environment variable parameter.

[0022] Optionally, after the code library file and the configuration file containing the specified adapter are obtained by decompressing the component version package to be tested, the method further comprises:

[0023] First configuration information about the specified adapter is obtained.

[0024] Second configuration information about the adapter in the engine test example project is obtained.

[0025] The first configuration information and the second configuration information are compared.

[0026] If the first configuration information and the second configuration information are consistent, it is determined that the specified adapter belongs to a default adapter.

[0027] If the first configuration information and the second configuration information are inconsistent, the second configuration information is modified according to the first configuration information.

[0028] Optionally, the configuration modification commands are used to modify the configuration files in the engine test example project to obtain a plurality of new engine test example projects, comprising:

[0029] The configuration modification commands are used to determine different configuration modes in the engine test example project, wherein the configuration modes comprise at least one of macro configuration, screen orientation configuration, real-name configuration and module switch configuration.

[0030] The different configuration modes are used to determine the modification of different configuration files in the engine test example project.

[0031] The configuration files are modified to obtain new engine test example projects.

[0032] Optionally, the plurality of new engine test example projects are packaged to obtain a plurality of component test applications of the component to be tested, further comprising:

[0033] An engine editor is pre-installed, wherein the engine editor comprises a first operating system construction support module and a second operating system construction support module.

[0034] The first operating system construction support module is used to package the plurality of new engine test example projects to obtain a plurality of component test applications of the component to be tested.

[0035] The second operating system construction support module is used to package the plurality of new engine test example projects to obtain a plurality of component test applications of the component to be tested.

[0036] Optionally, after the plurality of new engine test example projects are packaged to obtain a plurality of component test applications of the component to be tested, comprising:

[0037] The target engine of the target terminal device is started through the target installation path.

[0038] The plurality of component test applications are tested through the target engine.

[0039] In a second aspect, the application provides a component testing device, comprising:

[0040] A first obtaining module is configured to obtain a location path of a component version package and an engine test example project.

[0041] A second obtaining module is configured to decompress the component version package to obtain a code library file and a configuration file containing a specified adapter.

[0042] The copy module is used to copy the code library files to the engine test example project according to the location path of the engine test example project;

[0043] The third acquisition module is used to parse the code library files and configuration files to obtain several sets of configuration modification commands;

[0044] The fourth acquisition module is used to modify the configuration files in the engine test example project through several sets of configuration modification commands to acquire several new engine test example projects.

[0045] The packaging module is used to package several new engine test example projects separately to obtain several component test applications of the component to be tested.

[0046] Thirdly, the present invention provides an electronic device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;

[0047] The processor is used to read programs from memory to execute any of the component testing methods described above.

[0048] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform any of the component testing methods described above.

[0049] In this embodiment of the invention, the location paths of the component version package to be tested and the engine test example project are obtained. The component version package to be tested is decompressed to obtain the code library file and configuration file containing the specified adapter. The code library file is copied to the engine test example project according to its location path. The code library file and configuration file are parsed to obtain several sets of configuration modification commands. The configuration files in the engine test example project are modified using these commands to obtain several new engine test example projects. These new engine test example projects are then packaged to obtain several component test applications for the component to be tested. Modifying the configuration files in the engine test example project using configuration modification commands avoids the problem of excessive manpower and time costs caused by manually modifying numerous configuration items. By automatically modifying the configuration and packaging the component test applications for testing, the problem of requiring testers to concentrate highly is avoided, which is prone to human error and directly or indirectly affects the accuracy of test results. By automating the component testing settings, time, manpower, and maintenance costs are reduced, while improving the accuracy of test results. Attached Figure Description

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0051] Figure 1 is a scene schematic diagram of a component test method provided by an embodiment of the present application;

[0052] Figure 2 is a step flow chart of a component test method provided by an embodiment of the present application;

[0053] Figure 3 is Figure 1 is a flow chart of setting an environment variable parameter in a component test method provided by an embodiment of the present application;

[0054] Figure 4 is Figure 1 is a flow chart of step 105 in a component test method provided by an embodiment of the present application;

[0055] Figure 5 is Figure 1 is a flow chart of configuring and modifying an engine test sample project in a component test method provided by an embodiment of the present application;

[0056] Figure 6 is Figure 1 is a flow chart of packaging a new engine test sample project in a component test method provided by an embodiment of the present application;

[0057] Figure 7 is Figure 1 is a module timing diagram in a component test method provided by an embodiment of the present application;

[0058] Figure 8 is a structural diagram of a component test device provided by an embodiment of the present application;

[0059] Figure 9 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0061] App (Application) refers to applications on mobile devices.

[0062] A Framework is a software architecture for building applications, providing a series of tools, libraries, APIs, and specifications to help developers develop and organize code more efficiently. In this invention, it can be understood as a comprehensive solution for App integration, providing unified interface encapsulation for many essential services in an app (such as QQ / WeChat authentication, payment, relationship chains, data reporting, etc.) and basic components (such as downloads, location information, etc.). Furthermore, it has made additional interface optimizations for Unity3D (a cross-platform game engine and development tool), making it more consistent with C# programming style, allowing developers to easily use these proven basic components.

[0063] An Adapter is used to convert incompatible interfaces into compatible interfaces so that different systems or modules can work together. In this embodiment of the invention, it specifically refers to a third-party SDK library encapsulated in the Framework. Its function is to provide interface adaptation with third-party SDKs and simplify the integration process between developers and third-party SDKs.

[0064] UnityTestDemo is an engine test example project developed using the Unity engine. It integrates test example programs for components in the Framework, so the example programs cover tests for various modules and interfaces in the Framework.

[0065] Components developed using the Unity engine require manual modification of the UnityTestDem project configuration and manual packaging during testing. This process is time-consuming and labor-intensive, and prone to human error, resulting in low test accuracy. Therefore, this invention proposes a component testing method, such as... Figure 1 As shown, testers send simple commands to automate the compilation and packaging of multiple terminal platforms through version packages and simple commands, resulting in multiple apps, which are then tested on terminal devices.

[0066] Reference Figure 2 , Figure 2 This is a flowchart of the steps of a component testing method provided in an embodiment of the present invention, as follows: Figure 2 As shown, the method may include:

[0067] Step 101: Obtain the location path of the version package of the component to be tested and the engine test example project.

[0068] The test application of the component in the embodiment of the application needs to be performed in a mobile terminal device (such as a smart phone or a tablet computer), and different versions of engines and different types of operating systems can be configured in mobile terminal devices of different brands and models. The version of the unity engine can be Unity2020.3.1f1, Unity2021.3.5f1, Unity4, Unity5, etc., and each version can have different functions and compatibility. The types of operating systems include Android and iOS. Different installation paths are set for different versions of engines in each operating system, which can ensure that the engine is correctly loaded and used in different environments subsequently. The specific steps include:

[0069] Different versions of engines and different types of operating systems are obtained.

[0070] For any operating system, different installation paths are set for different versions of engines in the operating system, and the installation paths carry operating system identifiers and engine identifiers.

[0071] Further, when a tester wants to perform a test of a component test application through a target terminal device, the tester needs to identify the installation path of a target engine in the target terminal device first, and then determine the environment variable parameter of the component test application according to the installation path. When identifying the installation path, the tester first needs to send some simple instructions, such as a component test instruction, to parse the target operating system identifier and the target engine identifier of the target operating system and the target engine in the target terminal device, such as iOS and Unity4. Because different installation paths have been set for different versions of engines in the operating system, the target operating system identifier and the target engine identifier can be used to search in the preconfigured installation paths to find the installation path of the target engine in the target operating system. The installation path of the target engine in the target operating system is determined through the search result. Because the component test application is packaged in the engine test sample project, the location path of the engine test sample project (such as UnityTestDemo) is also obtained, and then the two paths are combined to obtain the environment variable parameter of the to-be-tested component version package in the subsequent generated application. The specific steps include:

[0072] A component test instruction issued by a user through a target terminal device is received, wherein the target terminal device includes a target operating system and a target engine, and the component test instruction carries a target operating system identifier and a target engine identifier.

[0073] The target operating system identifier and the target engine identifier are used to search in the operating system identifiers and the engine identifiers of the installation paths.

[0074] The target installation path of the target engine in the target terminal device is determined through the search result;

[0075] The position path of the engine test example project is acquired;

[0076] The position path is combined with the target installation path to obtain an environment variable parameter.

[0077] As shown in the example, Figure 3 As shown in the example, there are operating system types of Android and iOS, and engine versions of Unity4 and Unity5, first, the target operating system identifier is identified, then it is judged whether the engine version is Unity4 or Unity5, if the target operating system identifier is Android and the target engine identifier is Unity4, it is determined that the target installation path is the installation path for Android and Unity4, if the target operating system identifier is Android and the target engine identifier is Unity5, it is determined that the target installation path is the installation path for Android and Unity5, if the target operating system identifier is iOS and the target engine identifier is Unity4, it is determined that the target installation path is the installation path for iOS and Unity4, if the target operating system identifier is iOS and the target engine identifier is Unity5, it is determined that the target installation path is the installation path for iOS and Unity5. After the target installation path is determined, the position path of the engine test example project is combined with the target installation path of each case to obtain a complete environment variable parameter.

[0078] Through the above setting, the operating system type and the engine version in the terminal device can be automatically identified, and the installation path of the engine can also be determined, which is convenient for accurate start of the engine subsequently.

[0079] In step 102, the to-be-tested component version package is decompressed to obtain a code library file and a configuration file containing a specified adapter.

[0080] The to-be-tested component version package of the embodiment of the application is usually a compressed file (such as.zip,.tar.gz), and after being decompressed, a code library file containing the core logic and function implementation of the component can be obtained, for example, C# script, C++ code, Java code, adapter (Adapter) code, and a configuration file containing the initialization parameters, function switch, resource path, etc. of the component can also be obtained, for example: config.json, config.yaml, config.py; a dependent library file containing the third-party library or plug-in required by the component, for example: ThirdPartySDK.dll, lib1.so. Among them, the adapter is a kind of component, which is used to connect the component and the external system or platform.

[0081] It should be noted that, because the code library file containing the specified adapter in the decompressed file needs to be stored in the engine test example project, the adapter in this file has configuration requirements, and the engine test example project also sets configuration information about the adapter, it is necessary to first determine whether the configuration information about the adapter in the engine test example project meets the configuration requirements of the specified adapter in the component version package to be tested. If it does not meet the requirements, the second configuration information about the adapter in the engine test example project needs to be modified until the configuration requirements are met. The specific steps include:

[0082] Obtain the first configuration information about the specified adapter;

[0083] Obtain the second configuration information about the adapter in the engine test example project;

[0084] Compare the first configuration information and the second configuration information;

[0085] If they are consistent, it is determined that the specified adapter belongs to the default adapter;

[0086] If they are not consistent, the second configuration information is modified through the first configuration information.

[0087] Among them, the first configuration information and the second configuration information can include information about the name, path, etc. of the adapter.

[0088] By modifying the configuration, the adapter in the code library file of the specified adapter can correctly function in the engine test example project.

[0089] It should be noted that after decompressing the version package, the second configuration information about the adapter in the engine test example project is first determined, and then the code library file containing the specified adapter is generated, so as to avoid directly generating the code library file containing the specified adapter without modification, so that the code library file containing the specified adapter cannot be normally used subsequently.

[0090] Step 103, copy the code library file to the engine test example project through the position path of the engine test example project.

[0091] The position path of the engine test example project in the embodiment of the application usually refers to the root directory of the UnityTestDemo project. For example, the position path of the engine test example project can be C:\Projects\UnityTestDemo. When copying the code library file to the engine test example project according to the position path of the engine test example project, the path in the engine test example project can be further set, that is, the code library file is copied to the specified directory (such as Assets / Plugins directory) of the engine test example project.

[0092] After the copying is completed, it is also necessary to check whether the code library file is successfully copied into the engine test example project. In this way, it is ensured that the code library file is correctly integrated into the engine test example project, and the efficiency and reliability of the test are improved.

[0093] In step 104, the code library file and the configuration file are parsed to obtain a plurality of sets of configuration modification commands.

[0094] The code library file of the embodiment of the application generally contains the core logic and functional implementation of the component, and can contain some configuration parameters or functional switches, so the configuration parameters (such as functional switches and initialization parameters) can be extracted from the code library file. The configuration file generally contains the runtime parameters and functional switches of the component, and the format can be JSON, YAML or INI. Therefore, the code library file and the configuration file can be parsed together.

[0095] In addition, the component usually needs to be run under different configurations to verify its compatibility and stability in various scenarios, such as testing the performance of the component under different resolutions, testing the compatibility of the component under different language environments, testing the stability of the component under different network conditions, testing the performance of the component on different devices (such as low-end devices and high-end devices), testing the compatibility of the component on different operating system versions (such as Android 10 and Android 12), testing the functionality and performance of the component on Android devices, testing the functionality and performance of the component on iOS devices, testing the performance of the component when a certain function is enabled or disabled, and the like. These different test requirements require different configuration modification commands to be generated.

[0096] In step 105, the configuration file in the engine test example project is modified by a plurality of sets of configuration modification commands respectively to obtain a plurality of new engine test example projects.

[0097] The configuration modification command in the embodiment of the present application can contain multiple configuration methods. Common configuration methods include: macro configuration, screen orientation configuration, real-name system configuration, and module switch configuration. The macro configuration enables or disables certain functions by defining a macro (such as #define), for example: #define FEATURE_ENABLED. The screen orientation configuration configures the screen orientation (such as landscape or portrait), for example: Screen.orientation = ScreenOrientation.Landscape. The real-name system configuration configures parameters related to the real-name system (such as user authentication and identity authentication), for example: UserAuthentication.enabled = true. The module switch configuration enables or disables certain modules (such as an advertising module or a payment module), for example: AdModule.enabled = true. By using the configuration modification command, the modification configuration method is determined. A set of configuration modification commands can have multiple configuration methods. Different configuration methods have different modification methods in the engine test example project. Specifically, step 105, as shown in Figure 4

[0098] Step 1051, by using the configuration modification command, determine different configuration methods in the engine test example project. The configuration methods include at least one of macro configuration, screen orientation configuration, real-name system configuration, and module switch configuration.

[0099] Step 1052, by using different configuration methods, determine the modification of different configuration files in the engine test example project.

[0100] Step 1053, by modifying the configuration file, obtain a new engine test example project.

[0101] As shown in Figure 5 , the macro configuration and the screen orientation configuration belong to the unity project configuration and can be determined by the code library file. The real-name system configuration and the module switch configuration are determined by the configuration file. When performing macro configuration and screen orientation configuration, the files in the engine test example project do not need to be modified. When modifying the real-name system configuration and the module switch configuration, different configuration files in the engine test example project need to be modified according to the different operating systems of the terminal platform used subsequently. For example, if the Android operating system is used, the.ini file in the engine test example project is modified. If the iOS operating system is used, the.plist file in the engine test example project is modified. The cross-platform scripting language Python is used to implement the modification of various configurations (including ini / plist configuration and unity project configuration).

[0102] In this way, it can be ensured that the components are correctly configured during testing, and the efficiency and reliability of testing are improved.

[0103] ​Step 106: Package several new engine test example projects separately to obtain several component test applications of the component to be tested.

[0104] In this embodiment of the invention, after modifying the engine test example project, the resulting new engine test example project needs to be packaged into an App using Unity. During packaging, different packaging methods will be used depending on the operating system used by the subsequent component test application. Specific steps include:

[0105] The engine editor is pre-installed, and the engine editor includes a first operating system build support module and a second operating system build support module;

[0106] By building support modules through the first operating system, several new engine test example projects are packaged separately to obtain several component test applications of the component to be tested;

[0107] By building support modules through a second operating system, several new engine test example projects are packaged separately to obtain several component test applications of the components to be tested.

[0108] The first operating system can be Android, the second can be iOS, or vice versa. For example, when packaging based on different operating systems, such as... Figure 6 As shown, if packaging is done through the Android operating system, the primary operating system build support module used is UnityToApk. UnityToApk can package the new engine test sample project into an APK. APK is the packaging format for Android applications, a type of app. If packaging is done through the iOS operating system, the secondary operating system build support module used is UnityToXCode. UnityToXCode first exports the new engine test sample project as an Xcode project. Xcodebuild builds the Xcode project into a .app file, and Xcrun packages the .app into a .ipa file. The .ipa file is the packaging format for iOS applications, similar to the .apk file for Android. The .ipa file is a compressed and signed .app file that can be installed and run on iOS devices, and is also a type of app.

[0109] It should be noted that because the test component often needs to modify several different configurations and package into an App for testing, when packaging, a set of configuration modification commands can be modified, and then packaged, and then the next set is continued, and so on, until all different configuration modification and packaging are completed. In this way, the problem of mutual influence of different sets of configuration modification commands when modifying the configuration can be avoided. In addition, after a set of configuration modification commands completes configuration modification and packages the component test application, the set of configuration modification commands can be cleared or marked to avoid repeated use.

[0110] Further, when generating the component test application, the engine test example project in the engine test example project can be copied first, and then when the engine test example project is configured and modified, the modification method of the engine test example project can be limited according to the target operating system identifier and the target engine identifier. Finally, after generating the component test application, the target engine can be started according to the target installation path to test the component test application. The specific steps include:

[0111] Starting the target engine of the target terminal device through the target installation path;

[0112] Testing the several component test applications through the target engine.

[0113] It should be noted that the above process can be implemented through four modules, an environment variable module, a configuration packaging main module, a configuration modification module, and a Unity packaging module, as shown in the timing diagram Figure 7 The environment variable module determines the installation path of the engine and the location path of the engine test example project, the configuration packaging main module decompresses the component version package to be tested, obtains the code library file and the configuration file containing the specified adapter, copies the code library file to the engine test example project through the location path of the engine test example project, analyzes the code library file and the configuration file, obtains several sets of configuration modification commands, the configuration modification module modifies the configuration file in the engine test example project through the several sets of configuration modification commands, obtains several new engine test example projects, and the Unity packaging module packages the several new engine test example projects respectively to obtain the several component test applications of the component to be tested.

[0114] In the embodiment of the present application, the location path of the to-be-tested component version package and the engine test example project is acquired, the to-be-tested component version package is decompressed, the code base file and the configuration file containing the specified adapter are acquired, the code base file is copied to the engine test example project through the location path of the engine test example project, the code base file and the configuration file are parsed, a plurality of sets of configuration modification commands are acquired, the configuration file in the engine test example project is modified through the plurality of sets of configuration modification commands respectively, a plurality of new engine test example projects are acquired, and the plurality of new engine test example projects are packaged respectively to obtain a plurality of component test applications of the to-be-tested component. The configuration file in the engine test example project is modified through the configuration modification command, thereby avoiding the problem that a large number of configuration items are modified manually, resulting in high labor and time costs. The component test application is tested by automatically modifying the configuration and packaging, thereby avoiding the problem that the tester needs to concentrate on the work, human errors are prone to occur, and the accuracy of the test result is directly or indirectly affected. The automation of the component test is set, thereby reducing the time, labor and maintenance costs, and improving the accuracy of the test result.

[0115] Figure 8 is a structural diagram of a component test device provided by the embodiment of the present application. The device can include:

[0116] The first acquisition module 201 is configured to acquire the location path of the to-be-tested component version package and the engine test example project.

[0117] The second acquisition module 202 is configured to decompress the to-be-tested component version package to acquire the code base file and the configuration file containing the specified adapter.

[0118] The copy module 203 is configured to copy the code base file to the engine test example project through the location path of the engine test example project.

[0119] The third acquisition module 204 is configured to parse the code base file and the configuration file to acquire a plurality of sets of configuration modification commands.

[0120] The fourth acquisition module 205 is configured to modify the configuration file in the engine test example project through the plurality of sets of configuration modification commands respectively to acquire a plurality of new engine test example projects.

[0121] The packaging module 206 is configured to package the plurality of new engine test example projects respectively to obtain a plurality of component test applications of the to-be-tested component.

[0122] Optionally, the component test device further includes:

[0123] The fifth acquisition module is configured to acquire different versions of the engine and different types of operating systems.

[0124] The setting module is configured to set different installation paths for different versions of the engine in the operating system for any operating system, the installation path carrying an operating system identifier and an engine identifier.

[0125] The receiving module is configured to receive a component test instruction issued by a user through a target terminal device, the target terminal device including a target operating system and a target engine, the component test instruction carrying a target operating system identifier and a target engine identifier.

[0126] The searching module is configured to search in the operating system identifiers and the engine identifiers of the installation paths through the target operating system identifier and the target engine identifier.

[0127] The first determining module is configured to determine the target installation path of the target engine in the target operating system in the target terminal device through the search result.

[0128] The sixth obtaining module is configured to obtain a location path of the engine test sample project.

[0129] The combining module is configured to combine the location path and the target installation path to obtain an environment variable parameter.

[0130] The seventh obtaining module is configured to obtain first configuration information about a specified adapter.

[0131] The eighth obtaining module is configured to obtain second configuration information about the adapter in the engine test sample project.

[0132] The comparing module is configured to compare the first configuration information and the second configuration information.

[0133] The second determining module is configured to determine that the specified adapter belongs to a default adapter if the first configuration information and the second configuration information are consistent.

[0134] The modifying module is configured to modify the second configuration information through the first configuration information if the first configuration information and the second configuration information are inconsistent.

[0135] Optionally, the fourth obtaining module 205 specifically includes:

[0136] The first determining submodule is configured to determine different configuration manners in the engine test sample project through the configuration modification command, the configuration manner including at least one of a macro configuration, a screen direction configuration, a real-name system configuration, and a module switch configuration.

[0137] The second determining submodule is configured to determine modification of different configuration files in the engine test sample project through the different configuration manners.

[0138] The first obtaining submodule is configured to obtain a new engine test sample project through the modified configuration file.

[0139] Optionally, the packaging module 206 specifically comprises:

[0140] The installation sub-module is used for pre-installing the engine editor, and the engine editor comprises the first operating system construction support module and the second operating system construction support module.

[0141] The first packaging sub-module is used for packaging the new engine test example projects by the first operating system construction support module, so as to obtain the component test applications of the to-be-tested components.

[0142] The second packaging sub-module is used for packaging the new engine test example projects by the second operating system construction support module, so as to obtain the component test applications of the to-be-tested components.

[0143] Optionally, the component testing device further comprises:

[0144] The starting engine module is used for starting the target engine of the target terminal device through the target installation path.

[0145] The testing module is used for testing the component test applications by the target engine.

[0146] In the embodiment of the application, the position path of the to-be-tested component version package and the engine test example project is acquired, the to-be-tested component version package is decompressed, the code base file and the configuration file containing the specified adapter are acquired, the code base file is copied into the engine test example project through the position path of the engine test example project, the code base file and the configuration file are parsed, a plurality of sets of configuration modification commands are acquired, the configuration file in the engine test example project is modified through the plurality of sets of configuration modification commands, a plurality of new engine test example projects are acquired, the plurality of new engine test example projects are packaged, and a plurality of component test applications of the to-be-tested components are obtained. The configuration file in the engine test example project is modified through the configuration modification command, so that the problem of high labor cost and time cost caused by too many modified configuration items in manual operation is avoided, the configuration is automatically modified and the component test application is packaged for testing, so that the problem of human error caused by the high concentration of the test personnel, which directly or indirectly affects the accuracy of the test result, is avoided, the time, labor and maintenance cost are reduced through the automatic setting of the component test, and the accuracy of the test result is improved.

[0147] The application further provides an electronic device, such as Figure 9 As shown in the figure, the electronic device comprises a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 complete mutual communication through the communication bus 304,

[0148] The memory 303 is configured to store a computer program.

[0149] The processor 301 is configured to implement the following steps when executing the program stored in the memory 303:

[0150] Obtain a location path of a version package of a component to be tested and an engine test example project;

[0151] Decompress the version package of the component to be tested to obtain a code base file and a configuration file containing a specified adapter;

[0152] Copy the code base file to the engine test example project through the location path of the engine test example project;

[0153] Parse the code base file and the configuration file to obtain a plurality of sets of configuration modification commands;

[0154] Modify the configuration file in the engine test example project through the plurality of sets of configuration modification commands to obtain a plurality of new engine test example projects;

[0155] Package the plurality of new engine test example projects to obtain a plurality of component test applications of the component to be tested.

[0156] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into a physical address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0157] The communication interface is configured to communicate between the terminal and other devices.

[0158] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0159] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0160] The application further provides a readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the component test method of the foregoing embodiments.

[0161] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts are referred to the part of the description of the method embodiments.

[0162] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Structural requirements of such systems to perform the operations described above are apparent to those skilled in the art from the description herein. Furthermore, the application is not intended to be limited to any particular programming language. It will be appreciated that there are many programming languages that can be used to implement the teachings of the application described herein, and any such programming language can be used to implement the application. The description above is intended to be illustrative of the best mode of the application and is not intended to limit the scope of the application.

[0163] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this specification.

[0164] Similarly, it is to be understood that the embodiments of the application can be over-simplified for the sake of brevity and clarity and that the individual features of the application should not be construed as being more important than other features. The disclosure is not, therefore, to be construed as reflecting a failure to appreciate such implied features.

[0165] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than that of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and furthermore can be split into multiple sub-modules or sub-units or sub-components. Any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and any method or process or steps of an embodiment so disclosed, can be made unless it is explicitly stated otherwise. Each feature disclosed in the specification (including the accompanying claims, abstract and drawings), can be replaced by alternative features providing the same, equivalent or similar functionality unless it is explicitly stated otherwise.

[0166] Embodiments of the various components of the application can be implemented in hardware, or as software modules running in one or more processors, or combinations thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality of some or all of the components in the sequencing apparatus according to the application. The application can also be implemented as a program for executing one or more parts of the methods described herein on a device or apparatus. Such a program can be stored on a computer readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier medium, or in any other form.

[0167] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the system claims enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the word 'at least' followed by a list of one or more items means that any item in the list can be present or there can be none of them. The use of the terms 'first','second' and 'third', etc. does not limit the quantity and / or order of those terms. These terms are used to distinguish between two entities or steps involved with the process.

[0168] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the system, device and unit described above can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.

[0169] The above merely describes preferred embodiments of the present application, and is not intended to limit the present application, and any modification, equivalent replacement, and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.

[0170] The above merely describes preferred embodiments of the present application, and is not intended to limit the present application, and any modification, equivalent replacement, and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.

[0171] It should be noted that the acquisition of various data related processes in the embodiments of the present application is performed under the premise of complying with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization given by the corresponding device owner.

Claims

1. A component testing method, the method comprising: obtaining a location path of a component version package to be tested and an engine test example project; decompressing the component version package to be tested to obtain a code base file containing a specified adapter and a configuration file; copying the code base file to an engine test example project through the location path of the engine test example project; parsing the code base file and the configuration file to obtain a plurality of sets of configuration modification commands; modifying the configuration file in the engine test example project through the plurality of sets of configuration modification commands to obtain a plurality of new engine test example projects, including: determining different configuration modes in the engine test example project through the configuration modification commands, the configuration modes including at least one of a macro configuration, a screen orientation configuration, a real-name system configuration, and a module switch configuration; determining modification of different configuration files in the engine test example project through the different configuration modes; and obtaining a new engine test example project through the modified configuration file; packaging the plurality of new engine test example projects to obtain a plurality of component testing applications of the component to be tested.

2. The method of claim 1, wherein, Before the obtaining of the location path of the component version package to be tested and the engine test example project, the method further comprises: obtaining different versions of engines and different types of operating systems; for any operating system, setting different installation paths for different versions of engines in the operating system, the installation paths carrying operating system identifiers and engine identifiers.

3. The method of claim 2, wherein, After the setting of the different installation paths for the different versions of engines in the operating system for any operating system, the method further comprises: receiving a component testing instruction issued by a user through a target terminal device, wherein the target terminal device includes a target operating system and a target engine, and the component testing instruction carries a target operating system identifier and a target engine identifier; searching for the target operating system identifier and the target engine identifier in the operating system identifiers and the engine identifiers of the installation paths; determining a target installation path of the target engine in the target operating system in the target terminal device through the search result; obtaining a location path of the engine test example project; combining the location path with the target installation path to obtain an environment variable parameter.

4. The method of claim 1, wherein, After the decompression of the component version package to be tested to obtain the code base file containing the specified adapter and the configuration file, the method further comprises: obtaining first configuration information about the specified adapter; obtaining second configuration information about the adapter in the engine test example project; comparing the first configuration information and the second configuration information; if the first configuration information and the second configuration information are consistent, determining that the specified adapter belongs to a default adapter; if the first configuration information and the second configuration information are inconsistent, modifying the second configuration information through the first configuration information.

5. The method of claim 1, wherein, The packaging of the plurality of new engine test example projects to obtain the plurality of component testing applications of the component to be tested further comprises: pre-installing an engine editor, the engine editor including a first operating system construction support module and a second operating system construction support module; The first operating system construction support module packs the new engine test example projects to obtain component test applications of the to-be-tested components; The second operating system construction support module packs the new engine test example projects to obtain component test applications of the to-be-tested components.

6. The method of claim 3, wherein, After the new engine test example projects are packed to obtain the component test applications of the to-be-tested components, the method further includes: Starting the target engine of the target terminal device through the target installation path; Testing the component test applications through the target engine.

7. An assembly testing device, characterized by The apparatus includes: A first obtaining module that obtains a location path of a to-be-tested component version package and an engine test example project; A second obtaining module that decompresses the to-be-tested component version package to obtain code library files and configuration files containing a specified adapter; A copying module that copies the code library files to the engine test example project through the location path of the engine test example project; A third obtaining module that analyzes the code library files and the configuration files to obtain a plurality of sets of configuration modification commands; A fourth obtaining module that modifies the configuration files in the engine test example project through the plurality of sets of configuration modification commands to obtain a plurality of new engine test example projects, and the fourth obtaining module specifically includes: a first determining submodule that determines different configuration modes in the engine test example project through the configuration modification commands, the configuration modes including at least one of a macro configuration, a screen direction configuration, a real-name system configuration, and a module switch configuration; a second determining submodule that determines modification of different configuration files in the engine test example project through the different configuration modes; and a first obtaining submodule that obtains new engine test example projects through the modified configuration files; A packing module that packs the new engine test example projects to obtain component test applications of the to-be-tested components.

8. An electronic device, comprising: The apparatus includes: A transceiver, a memory, a processor, and a program stored in the memory and executable on the processor; The processor reads the program in the memory to implement the steps in the component test method according to any one of claims 1-6.

9. A readable storage medium for storing a program, characterized in that, The program stored in the memory is executed by the processor to implement the steps in the component test method according to any one of claims 1-6.

Citation Information

Patent Citations

  • A method and apparatus for dynamically configuring test case parameters

    CN109002390A

  • Low-code component processing method and device, medium and computing equipment

    CN117785170A