Component testing method and device, electronic equipment and readable storage medium
Through automated component testing methods, decompress and copy code base files, parse configuration files and generate configuration modification commands, the high cost and low accuracy problems caused by manual operations are solved, and efficient and accurate component testing is achieved.
Patent Information
- Application Number
- CN202411835355.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-12
AI Technical Summary
In the prior art, component testing requires manual operation, resulting in a large number of configuration items, a lot of labor and time costs, and is prone to human errors, affecting the accuracy of the test results.
By obtaining the location path of the component version package to be tested and the engine test sample project, decompress and copy the code base file to the engine test sample project, parse the configuration file to obtain the configuration modification command, automatically modify the configuration file and package the component test application for testing.
It reduces labor and time costs, improves the accuracy of test results, and avoids the numerous configuration issues caused by manual operations.
Smart Images

Figure CN119807039A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a component testing method, device, electronic equipment and readable storage medium. Background Art
[0002] Unity engine is a widely used cross-platform game development engine that supports game and application development on multiple platforms. During the testing process, components developed based on the Unity engine often need to be integrated into UnityTestDemo (UnityTestDemo refers to a test sample program developed using the Unity engine that integrates FrameWork framework components), and various configurations need to be manually modified, and then packaged into an App and tested on Android / iOS devices.
[0003] However, this manual operation method has obvious disadvantages. First, there are many configuration items to be modified, which requires version testers to spend a lot of time to modify them one by one, increasing manpower and time costs. Second, manual operation requires testers to concentrate highly, otherwise human errors are prone to occur, directly or indirectly affecting the accuracy of test results. In addition, each test requires manual re-operation, resulting in high maintenance costs. Summary of the invention
[0004] The present invention provides a component testing method, device, electronic device and readable storage medium to solve the current problem that each test needs to be manually re-operated, resulting in high cost and low accuracy.
[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0006] In a first aspect, the present invention provides a component testing method, the method comprising:
[0007] Get the location path of the component version package to be tested and the engine test sample project;
[0008] Decompress the version package of the component to be tested to obtain a code base 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 base file and the configuration file to obtain several sets of configuration modification commands;
[0011] Modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects;
[0012] Several new engine test example projects are packaged separately to obtain several component test applications of the components to be tested.
[0013] Optionally, before obtaining the location path of the version package of the component to be tested and the engine test example project, the method further includes:
[0014] Get different versions of the engine and different types of operating systems;
[0015] For any operating system, different installation paths are set in the operating system for engines of different versions, and the installation path carries an operating system identifier and an engine identifier.
[0016] Optionally, after setting different installation paths for engines of different versions in any operating system, the method further includes:
[0017] Receiving a component test 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 test instruction carries a target operating system identifier and a target engine identifier;
[0018] By using the target operating system identifier and the target engine identifier, searching among the operating system identifier and the engine identifier in the installation path;
[0019] Determine the target installation path of the target engine in the target operating system in the target terminal device through the search results;
[0020] Get the location path of the engine test sample project;
[0021] The location path is combined with the target installation path to obtain an environment variable parameter.
[0022] Optionally, after decompressing the version package of the component to be tested and obtaining the code library file and configuration file containing the specified adapter, the method further includes:
[0023] Obtaining first configuration information about a specified adapter;
[0024] Acquire second configuration information about the adapter in the engine test example project;
[0025] Comparing the first configuration information with the second configuration information;
[0026] If they are consistent, it is determined that the specified adapter is a default adapter;
[0027] If they are inconsistent, the second configuration information is modified through the first configuration information.
[0028] Optionally, the configuration files in the engine test example project are modified respectively by using several sets of configuration modification commands to obtain several new engine test example projects, including:
[0029] Determine different configuration modes in the engine test example project through the configuration modification command, wherein the configuration modes include at least one of macro configuration, screen direction configuration, real-name configuration and module switch configuration;
[0030] Determine the modification of different configuration files in the engine test example project through different configuration modes;
[0031] Get the new engine test sample project by modifying the configuration file.
[0032] Optionally, the step of packaging several of the new engine test example projects respectively to obtain several component test applications of the component to be tested further includes:
[0033] Pre-installing an engine editor, wherein the engine editor includes a first operating system construction support module and a second operating system construction support module;
[0034] By building a support module for the first operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested;
[0035] By building a support module through the second operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested.
[0036] Optionally, after packaging the several new engine test example projects respectively to obtain several component test applications of the components to be tested, the method further includes:
[0037] Starting a target engine of a target terminal device through the target installation path;
[0038] The plurality of component test applications are tested by the target engine.
[0039] In a second aspect, the present invention provides a component testing device, the device comprising:
[0040] The first acquisition module is used to obtain the location path of the version package of the component to be tested and the engine test example project;
[0041] A second acquisition module is used to decompress the version package of the component to be tested and obtain a code library file and a configuration file containing a specified adapter;
[0042] A copy module, used for copying the code library file to the engine test example project through the location path of the engine test example project;
[0043] A third acquisition module is used to parse the code library file and the configuration file to obtain several sets of configuration modification commands;
[0044] A fourth acquisition module, used to modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects;
[0045] The packaging module is used to package several of the new engine test example projects respectively to obtain several component test applications of the components to be tested.
[0046] In a third aspect, 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 the program in the memory to implement and execute any of the above-mentioned component testing methods.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute any of the above-mentioned component testing methods.
[0049] In an embodiment of the present invention, the location paths of the version package of the component to be tested and the engine test example project are obtained, the version package of the component to be tested is decompressed, the code library file and the configuration file containing the specified adapter are obtained, the code library file is copied to the engine test example project through the location path of the engine test example project, the code library file and the configuration file are parsed, and several sets of configuration modification commands are obtained. The configuration files in the engine test example project are modified respectively through the several sets of configuration modification commands, several new engine test example projects are obtained, and the several new engine test example projects are packaged respectively to obtain several component test applications of the component to be tested. By modifying the configuration file in the engine test example project through the configuration modification command, the problem of wasting manpower and time costs due to the large number of configuration items modified during manual operation is avoided. By automatically modifying the configuration and packaging the component test application for testing, the problem of requiring the tester to concentrate highly and being prone to human errors, which directly or indirectly affects the accuracy of the test results, is avoided. By setting the component test automatically, time, manpower and maintenance costs are reduced, and the accuracy of the test results is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 is a scenario schematic diagram of a component testing method provided by an embodiment of the present invention;
[0052] Figure 2 is a flowchart of the steps of a component testing method provided by an embodiment of the present invention;
[0053] Figure 3 yes Figure 1 The flowchart of setting environment variable parameters in a component testing method provided by an embodiment of the present invention is shown;
[0054] Figure 4 yes Figure 1 The flowchart of step 105 in a component testing method provided by an embodiment of the present invention is shown;
[0055] Figure 5 yes Figure 1 The flowchart of modifying the configuration of an example engine test project in a component testing method provided by an embodiment of the present invention is shown;
[0056] Figure 6 yes Figure 1 The flowchart of an example project of packaging a new engine test in a component testing method provided by an embodiment of the present invention is shown;
[0057] Figure 7 yes Figure 1 A module timing diagram in a component testing method provided by an embodiment of the present invention is shown;
[0058] Figure 8 is a structural diagram of a component testing device provided by an embodiment of the present invention;
[0059] Fig. 9 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] App (Application) refers to the application program on a mobile terminal device.
[0062] FrameWork is a software framework for building applications, providing a series of tools, libraries, APIs and specifications to help developers develop and organize code more efficiently. In the embodiment of the present invention, it can be understood as an overall solution for App access, providing a unified interface encapsulation of many services (such as mobile QQ WeChat authentication, payment, relationship chain, data reporting, etc.) and basic components (such as download, location information, etc.) that are required in the app, and additional interface optimization is made for Unity3D (a cross-platform game engine and development tool) to make it more in line with the C# programming style, allowing developers to easily use these time-tested basic components.
[0063] Adapter is used to convert incompatible interfaces into compatible interfaces so that different systems or modules can work together. In the embodiment of the present invention, it specifically refers to the third-party SDK library encapsulated in FrameWork, which provides interface adaptation with the third-party SDK and simplifies the integration process between developers and the third-party SDK.
[0064] UnityTestDemo Chinese is an engine test sample project, developed using the Unity engine, which integrates the test sample programs of the components in FrameWork, so the sample programs cover the tests of each module and interface in FrameWork.
[0065] When testing components developed based on the Unity engine, you need to manually modify the configuration of the UnityTestDem o project and then manually package it. This process consumes a lot of time and labor costs, and is prone to human errors, resulting in low test result accuracy. Based on this, an embodiment of the present invention proposes a component testing method, such as Figure 1 As shown, the tester sends a simple command to realize automatic compilation and packaging of multiple terminal platforms through version packages and simple commands, and then obtains multiple APPs, which are tested in the terminal devices.
[0066] Reference Figure 2 , Figure 2 is a flowchart of a component testing method provided by an embodiment of the present invention. 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 components in the embodiment of the present invention needs to be carried out in a mobile terminal device (such as a smart phone, a tablet computer). Mobile terminal devices of different brands and models can be configured with different versions of engines and different types of operating systems. Among them, the version of the unity engine can be Unity2020.3.1f1, Unity2021.3.5f1, Unity4, Unity5, etc., and each version may have different functions and compatibility. Types of operating systems include Android and iOS. Setting different installation paths for different versions of the engine in each operating system can ensure that the engine is correctly loaded and used in different environments later. The specific steps include:
[0069] Get different versions of the engine and different types of operating systems;
[0070] For any operating system, different installation paths are set in the operating system for engines of different versions, and the installation path carries the operating system identifier and the engine identifier.
[0071] Furthermore, when the tester wants to test the component test application through the target terminal device, he needs to first identify the installation path of the target engine in the target terminal device, and then determine the environment variable parameters of the component test application based on this installation path. When identifying the installation path, the tester first needs to send some simple instructions, such as component test instructions, and parse the target operating system identifier and target engine identifier of the target operating system and target engine in the target terminal device through this instruction, such as iOS, Unity4. Because different installation paths have been set in the operating system for different versions of the engine, at this time, the target operating system identifier and target engine identifier can be used to search in the pre-configured installation path to find the installation path of the target engine in the target operating system. According to the search results, the installation path of the target engine in the target operating system is determined. Because the component test application is packaged in the engine test example project, the location path of the engine test example project (such as UnityTestDemo) must also be obtained, and then the two paths are combined to obtain the environment variable parameters of the component version package to be tested in the subsequent generation of the application. The specific steps include:
[0072] Receiving a component test 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 test instruction carries a target operating system identifier and a target engine identifier;
[0073] Search the operating system identifier and the engine identifier of the installation path through the target operating system identifier and the target engine identifier;
[0074] Determine the target installation path of the target engine in the target operating system in the target terminal device through the search results;
[0075] Get the location path of the engine test sample project;
[0076] Combine the location path with the target installation path to get the environment variable parameter.
[0077] For example, Figure 3 As shown, there are operating system types of Android and iOS, and engine versions of Unity4 and Unity5. First, the target operating system identifier is identified, and then the engine version is determined to be Unity4 or Unity5. If the target operating system identifier is Android and the target engine identifier is Unity4, the target installation path is determined to be the installation path for Android and Unity4. If the target operating system identifier is Android and the target engine identifier is Unity5, the target installation path is determined to be the installation path for Android and Unity5. If the target operating system identifier is iOS and the target engine identifier is Unity4, the target installation path is determined to be the installation path for iOS and Unity4. If the target operating system identifier is iOS and the target engine identifier is Unity5, the target installation path is determined to be the installation path for iOS and Unity5. After determining the target installation path, the location 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 settings, the operating system type and engine version in the terminal device can be automatically identified, and the engine installation path can also be determined, which facilitates the subsequent accurate startup of the engine.
[0079] Step 102: decompress the version package of the component to be tested, and obtain the code base file and configuration file containing the specified adapter.
[0080] The version package of the component to be tested in the embodiment of the present invention is usually a compressed file (such as .zip, .tar.gz). After decompressing it, the code library file containing the core logic and function implementation of the component can be obtained, such as C# scripts, C++ codes, Java codes, adapter (Adapter) codes, etc., and the configuration file containing the initialization parameters, function switches, resource paths, etc. of the component can also be obtained, such as: configuration.json, config.yaml, config.py; the dependency library file containing the third-party library or plug-in required by the component, such as: ThirdPartySDK.dll, lib1.so. Among them, the adapter is a component used to connect the component with an 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 has configuration information about the adapter. It is necessary to first determine whether the configuration information about the adapter also set 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] Obtaining first configuration information about a specified adapter;
[0083] Obtain second configuration information about the adapter in the engine test example project;
[0084] Comparing the first configuration information with the second configuration information;
[0085] If they are consistent, it is determined that the specified adapter is the default adapter;
[0086] If they are inconsistent, the second configuration information is modified through the first configuration information.
[0087] The first configuration information and the second configuration information may include information about the name and path of the adapter.
[0088] By modifying the configuration, the adapter in the code library file of the specified adapter can function correctly in the engine test sample project.
[0089] It should be noted that after unzipping 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 to avoid directly generating the code library file containing the specified adapter without modification, which makes the code library file containing the specified adapter unable to be used normally in the future.
[0090] Step 103: copy the code library file to the engine test example project through the location path of the engine test example project.
[0091] In the embodiment of the present invention, the location path of the engine test example project generally refers to the root directory of the UnityTestDemo project. For example, the location path of the engine test example project may be C:\Projects\UnityTestDemo. When the code library file is copied to the engine test example project according to the location path of the engine test example project, the path may be further set in the engine test example project, that is, the code library file is copied to a specified directory of the engine test example project (such as the Assets / Plugins directory).
[0092] After the copy is complete, you also need to check whether the code library file is successfully copied to the engine test sample project. This ensures that the code library file is correctly integrated into the engine test sample project to improve the efficiency and reliability of the test.
[0093] Step 104, parse the code base file and the configuration file to obtain several sets of configuration modification commands.
[0094] The code base file of the embodiment of the present invention usually contains the core logic and function implementation of the component, and may contain some configuration parameters or function switches, so the configuration parameters (such as function switches, initialization parameters) can be extracted from the code base file, and the configuration file usually contains the runtime parameters and function switches of the component, and the format may be JSON, YAML or INI. Therefore, the code base file and the configuration file can be parsed together.
[0095] Because components usually need to run under different configurations to verify their compatibility and stability in various scenarios, for example, testing the performance of components at different resolutions, testing the compatibility of components in different language environments, testing the stability of components under different network conditions, testing the performance of components on different devices (such as low-end devices and high-end devices), testing the compatibility of components on different operating system versions (such as Android 10 and Android 12), testing the functions and performance of components on Android devices, testing the functions and performance of components on iOS devices, testing the performance of components when a certain function is enabled or disabled, etc. These different testing requirements require the generation of different configuration modification commands.
[0096] Step 105 , modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects.
[0097] In the embodiment of the present invention, the configuration modification command may include multiple configuration methods. Common configuration methods include: macro configuration: enabling or disabling certain functions by defining macros (such as #define), for example: #define FEATURE_ENABLED; screen orientation configuration: configuring the screen orientation (such as landscape or portrait), for example: Screen.orientation = ScreenOrientation.Landscape; real-name system configuration: configuring parameters related to the real-name system (such as user authentication, identity verification), for example: UserAuthentication.enabled = true; module switch configuration: enabling or disabling certain modules (such as advertising module, payment module), for example: AdModule.enabled = true. By configuring the modification command, the configuration modification 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, such as Figure 4 As shown:
[0098] Step 1051, determining different configuration modes in the engine test example project through configuration modification commands, the configuration modes including at least one of macro configuration, screen direction configuration, real-name configuration and module switch configuration.
[0099] Step 1052, determining the modification of different configuration files in the engine test example project through different configuration methods.
[0100] Step 1053, obtain a new engine test example project by modifying the configuration file.
[0101] For example, Figure 5 As shown, macro configuration and screen direction configuration belong to unity project configuration, which can be determined by code base files, and real-name configuration and module switch configuration are determined by configuration files. When performing macro configuration and screen direction configuration, there is no need to modify the files in the engine test example project. When modifying the real-name configuration and module switch configuration, it is necessary to modify different configuration files in the engine test example project according to the different operating systems of the terminal platforms used later. For example, if it is an Android operating system, modify the .ini file in the engine test example project, and if it is an iOS operating system, modify the .plist file in the engine test example project. Among them, 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, you can ensure that components are configured correctly during the test process, improving the efficiency and reliability of the test.
[0103] Step 106 , respectively package several new engine test example projects to obtain several component test applications of the components to be tested.
[0104] In the embodiment of the present invention, after modifying the engine test example project, it is necessary to package the obtained new engine test example project into an App through Unity. When packaging, different packaging will be performed according to the different operating systems used by the subsequent component test applications. The specific steps include:
[0105] Pre-installing an engine editor, the engine editor including a first operating system building support module and a second operating system building support module;
[0106] By building a support module for the first operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested;
[0107] By building a support module through the second operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested.
[0108] The first operating system may be an Android operating system, the second operating system may be an iOS operating system, or the reverse may be performed. For example, when packaging according to different operating systems, Figure 6 As shown, if the package is packaged through the Android operating system, the first operating system building support module used is UnityToApk. Through UnityToApk, the new engine test sample project can be packaged into Apk. APK is the packaging format of Android applications and a form of APP. If the package is packaged through the iOS operating system, the second operating system building support module used is UnityToXCode. UnityToXCode first exports the new engine test sample project to an xcode project. Xcodebuild builds the xcode project into .app, and Xcrun packages the .app into .ipa. The .ipa file is the packaging format of the iOS application, similar to the Android .apk file. The .ipa file is a compressed and signed .app file that can be installed and run on iOS devices and is also a form of APP.
[0109] It should be noted that because test components often need to modify several different configurations and package them into apps for testing, when packaging, you can modify one set of configuration modification commands, then package them, and then continue with the next set, and so on, until all different configuration modifications and packaging are completed. This can avoid the problem of different sets of configuration modification commands affecting each other when modifying the configuration. In addition, after a set of configuration modification commands completes the configuration modification and packages the component test application, this set of configuration modification commands can be cleared or marked to avoid repeated use.
[0110] Furthermore, when generating a component test application, you can first copy it to the engine test sample project, and then when you modify the configuration of the engine test sample project, you can also limit the modification method of the engine test sample project according to the target operating system identifier and the target engine identifier. Finally, after generating the component test application, you can start the target engine according to the target installation path and test the component test application. The specific steps include:
[0111] Start the target engine of the target terminal device through the target installation path;
[0112] Several component test applications are tested via the target engine.
[0113] It should be noted that the above process can be implemented through four modules, namely, environment variable module, configuration packaging main module, configuration modification module and Unity packaging module. The timing diagram is as follows: Figure 7 As shown, 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 version package of the component to be tested, obtains the code library file and 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, parses the code library file and configuration file, obtains several sets of configuration modification commands, the configuration modification module modifies the configuration files in the engine test example project through several sets of configuration modification commands, obtains several new engine test example projects, and the Unity packaging module packages several new engine test example projects respectively to obtain several component test applications of the component to be tested.
[0114] In an embodiment of the present invention, the location paths of the version package of the component to be tested and the engine test example project are obtained, the version package of the component to be tested is decompressed, the code library file and the configuration file containing the specified adapter are obtained, the code library file is copied to the engine test example project through the location path of the engine test example project, the code library file and the configuration file are parsed, and several sets of configuration modification commands are obtained. The configuration files in the engine test example project are modified respectively through the several sets of configuration modification commands, several new engine test example projects are obtained, and the several new engine test example projects are packaged respectively to obtain several component test applications of the component to be tested. By modifying the configuration file in the engine test example project through the configuration modification command, the problem of wasting manpower and time costs due to the large number of configuration items modified during manual operation is avoided. By automatically modifying the configuration and packaging the component test application for testing, the problem of requiring the tester to concentrate highly and being prone to human errors, which directly or indirectly affects the accuracy of the test results, is avoided. By setting the component test automatically, time, manpower and maintenance costs are reduced, and the accuracy of the test results is improved.
[0115] Figure 8 : is a structural diagram of a component testing device provided by an embodiment of the present invention, and the device may include:
[0116] The first acquisition module 201 is used to acquire the location path of the version package of the component to be tested and the engine test example project.
[0117] The second acquisition module 202 is used to decompress the version package of the component to be tested and obtain the code library file and configuration file containing the specified adapter.
[0118] The copy module 203 is used to copy the code library file to the engine test example project through the location path of the engine test example project.
[0119] The third acquisition module 204 is used to parse the code library file and the configuration file to obtain several sets of configuration modification commands.
[0120] The fourth acquisition module 205 is used to modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects.
[0121] The packaging module 206 is used to package several new engine test example projects respectively to obtain several component test applications of the components to be tested.
[0122] Optionally, the component test device further comprises:
[0123] The fifth acquisition module is used to acquire engines of different versions and operating systems of different types.
[0124] The setting module is used to set different installation paths for different versions of engines in any operating system, and the installation path carries the operating system identifier and the engine identifier.
[0125] The receiving module is used to receive a component test instruction sent 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 test instruction carries a target operating system identifier and a target engine identifier.
[0126] The search module is used to search the operating system identifier and the engine identifier of the installation path through the target operating system identifier and the target engine identifier.
[0127] The first determination module is used 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 acquisition module is used to obtain the location path of the engine test example project.
[0129] The combination module is used to combine the location path with the target installation path to obtain the environment variable parameter.
[0130] The seventh acquisition module is used to acquire first configuration information about the specified adapter.
[0131] The eighth acquisition module is used to acquire the second configuration information about the adapter in the engine test example project.
[0132] The comparison module is used to compare the first configuration information with the second configuration information.
[0133] The second determination module is used to determine that the specified adapter belongs to the default adapter if they are consistent.
[0134] The modification module is used to modify the second configuration information through the first configuration information if there is inconsistency.
[0135] Optionally, the fourth acquisition module 205 specifically includes:
[0136] The first determination submodule is used to determine different configuration modes in the engine test example project through configuration modification commands, and the configuration modes include at least one of macro configuration, screen direction configuration, real-name configuration and module switch configuration.
[0137] The second determination submodule is used to determine the modification of different configuration files in the engine test example project through different configuration methods.
[0138] The first acquisition submodule is used to acquire a new engine test sample project by modifying a configuration file.
[0139] Optionally, the packaging module 206 specifically includes:
[0140] The installation submodule is used to pre-install an engine editor, wherein the engine editor includes a first operating system construction support module and a second operating system construction support module.
[0141] The first packaging submodule is used to package several new engine test example projects respectively through the first operating system construction support module to obtain several component test applications of the components to be tested.
[0142] The second packaging submodule is used to package several new engine test example projects respectively through the second operating system construction support module to obtain several component test applications of the components to be tested.
[0143] Optionally, the component test device further comprises:
[0144] The engine startup module is used to start the target engine of the target terminal device through the target installation path.
[0145] The test module is used to test the plurality of component test applications through a target engine.
[0146] In an embodiment of the present invention, the location paths of the version package of the component to be tested and the engine test example project are obtained, the version package of the component to be tested is decompressed, the code library file and the configuration file containing the specified adapter are obtained, the code library file is copied to the engine test example project through the location path of the engine test example project, the code library file and the configuration file are parsed, and several sets of configuration modification commands are obtained. The configuration files in the engine test example project are modified respectively through the several sets of configuration modification commands, several new engine test example projects are obtained, and the several new engine test example projects are packaged respectively to obtain several component test applications of the component to be tested. By modifying the configuration file in the engine test example project through the configuration modification command, the problem of wasting manpower and time costs due to the large number of configuration items modified during manual operation is avoided. By automatically modifying the configuration and packaging the component test application for testing, the problem of requiring the tester to concentrate highly and being prone to human errors, which directly or indirectly affects the accuracy of the test results, is avoided. By setting the component test automatically, time, manpower and maintenance costs are reduced, and the accuracy of the test results is improved.
[0147] The present invention also provides an electronic device, such as Fig. 9 As shown, it includes 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 communicate with each other through the communication bus 304.
[0148] Memory 303, used for storing computer programs;
[0149] The processor 301 is used to execute the program stored in the memory 303 to implement the following steps:
[0150] Get the location path of the component version package to be tested and the engine test sample 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] Copying the code library file to the engine test example project through the location path of the engine test example project;
[0153] Parsing the code base file and the configuration file to obtain several sets of configuration modification commands;
[0154] Modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects;
[0155] Several new engine test example projects are packaged separately to obtain several component test applications of the components to be tested.
[0156] The communication bus mentioned in the above terminal 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 ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0157] The communication interface is used for communication between the above terminal and other devices.
[0158] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0159] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0160] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the component testing method of the aforementioned embodiment.
[0161] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0162] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other equipment. According to the above description, it is obvious that the structure required for constructing such a system is. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is for disclosing the best mode of the present invention.
[0163] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0164] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0165] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0166] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0167] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0168] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0169] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0170] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0171] It should be noted that the various data-related processes in the embodiments of the present invention are all carried out in compliance with the corresponding data protection laws 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: Get the location path of the component version package to be tested and the engine test sample project; Decompress the version package of the component to be tested to obtain a code base file and a configuration file containing a specified adapter; Copying the code library file to the 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 several sets of configuration modification commands; Modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects; Several new engine test example projects are packaged separately to obtain several component test applications of the components to be tested.
2. The method according to claim 1, characterized in that: Before obtaining the location path of the component version package to be tested and the engine test example project, the following is also included: Get different versions of the engine and different types of operating systems; For any operating system, different installation paths are set in the operating system for engines of different versions, and the installation path carries an operating system identifier and an engine identifier.
3. The method according to claim 2, characterized in that: After setting different installation paths for engines of different versions in any operating system, the method further includes: Receiving a component test 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 test instruction carries a target operating system identifier and a target engine identifier; By using the target operating system identifier and the target engine identifier, searching among the operating system identifier and the engine identifier in the installation path; Determine the target installation path of the target engine in the target operating system in the target terminal device through the search results; Get the location path of the engine test sample project; The location path is combined with the target installation path to obtain an environment variable parameter.
4. The method according to claim 1, characterized in that: After decompressing the version package of the component to be tested and obtaining the code library file and configuration file containing the specified adapter, the method further includes: Obtaining first configuration information about a specified adapter; Acquire second configuration information about the adapter in the engine test example project; Comparing the first configuration information with the second configuration information; If they are consistent, it is determined that the specified adapter is a default adapter; If they are inconsistent, the second configuration information is modified through the first configuration information.
5. The method according to claim 1, characterized in that: The configuration files in the engine test example project are modified respectively by using several sets of configuration modification commands to obtain several new engine test example projects, including: Determine different configuration modes in the engine test example project through the configuration modification command, wherein the configuration modes include at least one of macro configuration, screen direction configuration, real-name configuration and module switch configuration; Determine the modification of different configuration files in the engine test example project through different configuration modes; Get the new engine test sample project by modifying the configuration file.
6. The method according to claim 1, characterized in that: The step of packaging the plurality of new engine test example projects respectively to obtain a plurality of component test applications of the component to be tested further includes: Pre-installing an engine editor, wherein the engine editor includes a first operating system construction support module and a second operating system construction support module; By building a support module for the first operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested; By building a support module through the second operating system, several new engine test example projects are packaged respectively to obtain several component test applications of the components to be tested.
7. The method according to claim 3, characterized in that: After packaging the several new engine test example projects respectively to obtain several component test applications of the components to be tested, the method includes: Starting a target engine of a target terminal device through the target installation path; The plurality of component test applications are tested by the target engine.
8. A component testing device, characterized in that: The device comprises: The first acquisition module is used to obtain the location path of the version package of the component to be tested and the engine test example project; A second acquisition module is used to decompress the version package of the component to be tested and obtain a code library file and a configuration file containing a specified adapter; A copy module, used for copying the code library file to the engine test example project through the location path of the engine test example project; A third acquisition module is used to parse the code library file and the configuration file to obtain several sets of configuration modification commands; A fourth acquisition module, used to modify the configuration files in the engine test example project respectively through several sets of configuration modification commands to obtain several new engine test example projects; The packaging module is used to package several of the new engine test example projects respectively to obtain several component test applications of the components to be tested.
9. An electronic device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the steps in the component testing method as claimed in any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that: When the stored program is executed by a processor, the steps of the component testing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Simulation verification method and device and electric equipment
CN107480327A
A method and apparatus for dynamically configuring test case parameters
CN109002390A
Test instruction generation method and system based on configuration file, terminal and medium
CN109783287A
Game automation test method and device, terminal and computer storage medium
CN110781085A
Low-code component processing method and device, medium and computing equipment
CN117785170A