CN115080382A - Code testing method, device, equipment and medium - Google Patents

Code testing method, device, equipment and medium Download PDF

Info

Publication number
CN115080382A
CN115080382A CN202210472290.4A CN202210472290A CN115080382A CN 115080382 A CN115080382 A CN 115080382A CN 202210472290 A CN202210472290 A CN 202210472290A CN 115080382 A CN115080382 A CN 115080382A
Authority
CN
China
Prior art keywords
code
branch
new bios
bios
compatibility test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210472290.4A
Other languages
Chinese (zh)
Inventor
张严
张文强
辛显慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dawning Information Industry Co Ltd
Original Assignee
Dawning Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dawning Information Industry Co Ltd filed Critical Dawning Information Industry Co Ltd
Priority to CN202210472290.4A priority Critical patent/CN115080382A/en
Publication of CN115080382A publication Critical patent/CN115080382A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention discloses a code testing method, a device, equipment and a medium. The method comprises the following steps: acquiring a code merging request input by a user, wherein the code merging request carries a new BIOS branch source code; sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code; and if the test is passed, merging the new BIOS branch source code into the BIOS main body source code to generate the new BIOS main body source code. The embodiment of the invention carries out compatibility test before code merging, realizes the prevention of the compatibility problem of the BIOS main stem source code, prevents the compatibility problem from flowing into the code main stem, reduces the dependence of the compatibility test process on a physical machine, improves the portability of the test environment and reduces the test cost.

Description

Code testing method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a code testing method, apparatus, device, and medium.
Background
The Basic Input Output System (BIOS) code of the electronic device includes the most important basic Input Output program, System setting information, a self-test program after power-on, and a System self-start program of the electronic device. After the BIOS source code is developed, the BIOS source code is compiled through a compiler to obtain the BIOS code. The BIOS code is then burned into a chip of the electronic device so that the BIOS code provides the bottom most, most direct hardware settings and control for the electronic device. By performing Standard Compatibility Testing (SCT) on the BIOS codes, codes which do not meet the specification in the BIOS codes can be screened out and modified in time.
In the related art, the test scheme of the BIOS code is: developers complete code development of new functions of the BIOS on the branches, and the latest BIOS branch source codes are regularly merged into the BIOS main source codes to generate new BIOS main source codes. Compiling the new BIOS main source code to obtain a new BIOS code. And then updating the new BIOS code to the electronic equipment, and carrying out standard compatibility test on the new BIOS code on the electronic equipment.
The related art has disadvantages in that: although compatibility problems can be discovered for new BIOS code, it is not possible to prevent compatibility problems from flowing into the BIOS backbone source code in advance. In addition, the compatibility test of the new BIOS code on the electronic equipment occupies a large amount of hardware resources, and the test cost is increased.
Disclosure of Invention
The invention provides a code testing method, a device, equipment and a medium, which are used for solving the problems that a testing scheme of a BIOS code in the related technology can not prevent the compatibility problem from flowing into a BIOS main source code in advance, a large amount of hardware resources are occupied, and the testing cost is increased.
According to an aspect of the present invention, there is provided a code testing method, including:
acquiring a code merging request input by a user, wherein the code merging request carries a new BIOS branch source code;
sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code;
and if the compatibility test result fed back by the compatibility test process is that the test is passed, merging the new BIOS branch source code into the BIOS main source code to generate a new BIOS main source code.
According to another aspect of the present invention, there is provided a code testing apparatus including:
the request acquisition module is used for acquiring a code merging request input by a user, wherein the code merging request carries a new BIOS branch source code;
the code testing module is used for sending a control instruction to a compatibility testing process, indicating the compatibility testing process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility testing on the new BIOS branch code in a simulator, and feeding back a compatibility testing result of the new BIOS branch code;
and the code merging module is used for merging the new BIOS branch source code into the BIOS main source code to generate a new BIOS main source code if the compatibility test result fed back by the compatibility test process is that the test is passed.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the code testing method according to any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a code testing method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, a code merging request input by a user is obtained, and the code merging request carries a new BIOS branch source code; then sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code; if the compatibility test result is that the test is passed, the new BIOS branch source code is merged into the BIOS main source code to generate the new BIOS main source code, thereby solving the problems that the test scheme of the BIOS code in the related technology can not prevent the standard compatibility problem from flowing into the BIOS main source code in advance, occupying a large amount of hardware resources and improving the test cost, obtaining the compatibility test before code merging, realizing the prevention of the compatibility problem of the BIOS main source code, preventing the compatibility problem from flowing into the code main, really solving the compatibility problem of the BIOS code before the problem occurs, greatly reducing the influence possibly brought by the compatibility problem, meanwhile, the compatibility test is carried out under the simulator, so that the dependence of the compatibility test process on a physical machine is reduced, the transportability of the test environment is improved, and the beneficial effect of the test cost is also reduced; the compatibility test process is indicated by sending the control instruction to the compatibility test process, and the compatibility test is carried out on the new BIOS branch code under the simulator, so that the dependence of the compatibility test process on a physical machine is reduced, the transportability of a test environment is improved, and the test cost is also reduced; under the condition that the compiling of the new BIOS branch source code fails, directly determining that the testing of the new BIOS branch code fails, improving the testing efficiency and avoiding the defective new BIOS branch source code from being merged into the BIOS main source code; under the condition that the new BIOS branch code does not pass the compatibility test, the new BIOS branch code test failure is directly determined, the test efficiency is improved, the new BIOS branch source code with the compatibility defect is prevented from being combined into the BIOS main source code, and the compatibility problem is prevented from flowing into the BIOS main source code; under the condition that the test of the new BIOS branch code fails, automatically blocking the new BIOS branch source code from being combined into the BIOS main source code, avoiding the new BIOS branch source code with compatibility defect from being combined into the BIOS main source code, and preventing the compatibility problem from flowing into the BIOS main source code; the code merging request input by the user can be acquired in real time based on the interactive operation with the user, so that the user request is determined to merge the new BIOS branch source code into the BIOS main source code; and storing the preset compatibility test script to a preset storage position so that the compatibility test process calls the preset compatibility test script in real time, and automatically performing compatibility test on the new BIOS branch code to improve the test efficiency.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a code testing method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a code testing method according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a code testing method according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a code testing apparatus according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device implementing the code testing method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "object," "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a code testing method according to an embodiment of the present invention, where this embodiment is applicable to performing a standard compatibility test on a new BIOS source code corresponding to a new BIOS trunk source code before the new BIOS branch source code is incorporated into the BIOS trunk source code, so as to prevent a situation in which a standard compatibility problem flows into the BIOS trunk source code in advance. As shown in fig. 1, the method includes:
step 101, a code merging request input by a user is obtained, wherein the code merging request carries a new BIOS branch source code.
Optionally, the BIOS main source code is a BIOS source code that has been developed and put into use. And compiling the BIOS source code through a compiler to obtain the BIOS code. The BIOS code is burnt into a chip of the appointed electronic equipment, and the bottommost and most direct hardware setting and control can be provided for the appointed electronic equipment through the BIOS code.
Alternatively, the user may be a developer. The new BIOS branch source code is newly developed by developers and needs to be incorporated into the BIOS main source code, so that the new BIOS source code with the new BIOS function is added. And (4) merging the new BIOS branch source code into the BIOS main source code, and updating the BIOS source code. Then compiling the updated BIOS source code to obtain a new BIOS code added with a certain BIOS new function.
Optionally, the code merge request is used to request that a new BIOS branch source code be merged into the BIOS trunk source code.
Optionally, the obtaining of the code merging request input by the user, where the code merging request carries a new BIOS branch source code, includes: and acquiring a code merging request input by a user through a code merging page, wherein the code merging request carries a new BIOS branch source code.
Optionally, the code merge page is a page used for interacting with a user, acquiring various information input by the user and related to the BIOS source code, and displaying various information related to the BIOS source code to the user. The user enters a code merge request by filling in or selecting a new BIOS branch source code in a code merge page.
Therefore, the code merging request input by the user can be acquired in real time based on the interactive operation with the user, so that the user is determined to request to merge the new BIOS branch source code into the BIOS main source code.
And 102, sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code.
Optionally, the compatibility test process is a preset process for performing a compatibility test on the new BIOS branch code. The control instruction is used for indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code. And after acquiring the code merging request input by the user, sending a control instruction to a compatibility test process.
Optionally, the indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code includes: instructing the compatibility test process to perform the following operations: compiling the new BIOS branch source code through a compiler; if the compiling is successful, obtaining a new BIOS branch code, operating the new BIOS branch code in a simulator, and calling a preset compatibility test script to perform compatibility test on the new BIOS branch code in the operating process of the new BIOS branch code; and if the new BIOS branch code passes the compatibility test, determining that the compatibility test result of the new BIOS branch code passes the test, and feeding back the compatibility test result of the new BIOS branch code.
Optionally, the new BIOS branch source code is compiled by a compiler. If the compiling is successful, a new BIOS branch code can be obtained. The new BIOS branch code is a BIOS code obtained by compiling the new BIOS branch source code.
Optionally, the pre-established runtime environment including the BIOS code in the emulator may run various types of BIOS code in the emulator.
Optionally, the preset compatibility test script is a script for performing a standard compatibility test on the new BIOS branch code. The standard compatibility test is used for detecting whether the code content of various interface codes in the new BIOS branch codes conforms to the corresponding interface code rules.
Optionally, after the preset compatibility test script is called, in the running process of the new BIOS branch code, the running of various interface codes in the new BIOS branch code is monitored. When monitoring that various interface codes run, the preset compatibility test script detects whether the code content of the various interface codes conforms to the corresponding interface code rule. And if all interface codes in the new BIOS branch codes accord with the corresponding interface code rules, determining that the compatibility test is passed. And if one interface code in the new BIOS branch code does not accord with the corresponding interface code rule, determining that the compatibility test is not passed.
Therefore, the compatibility test process is indicated by sending the control instruction to the compatibility test process, and the compatibility test is carried out on the new BIOS branch code under the simulator, so that the dependence of the compatibility test process on a physical machine is reduced, the portability of a test environment is improved, and the test cost is also reduced.
Optionally, after the compiling the new BIOS branch source code by the compiler, the method further includes: and if the compiling fails, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
Therefore, under the condition that the compiling of the new BIOS branch source code fails, the testing failure of the new BIOS branch code is directly determined, the testing efficiency is improved, and the defect new BIOS branch source code is prevented from being merged into the BIOS main source code.
Optionally, after the preset compatibility test script is called to perform the compatibility test on the new BIOS branch code, the method further includes: and if the new BIOS branch code does not pass the compatibility test, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
Therefore, under the condition that the new BIOS branch code does not pass the compatibility test, the new BIOS branch code test failure is directly determined, the test efficiency is improved, the new BIOS branch source code with the compatibility defect is prevented from being combined into the BIOS main source code, and the compatibility problem is prevented from flowing into the BIOS main source code.
Optionally, before acquiring the code merge request input by the user, the method further includes: the method comprises the steps of obtaining a preset compatibility test script uploaded by a user, and storing the preset compatibility test script to a preset storage position. And uploading the preset compatibility test script to the electronic equipment by the user. And the electronic equipment stores the preset compatibility test script to a preset storage position. The predetermined storage location may be a memory or other storage device in the electronic device.
Therefore, the preset compatibility test script is stored to the preset storage position, so that the compatibility test process calls the preset compatibility test script in real time, the compatibility test is automatically carried out on the new BIOS branch code, and the test efficiency is improved.
And 103, if the compatibility test result fed back by the compatibility test process is that the test is passed, merging the new BIOS branch source code into the BIOS main source code to generate a new BIOS main source code.
Optionally, the compatibility test result fed back by the compatibility test process is that the test is passed, which indicates that there is no compatibility problem in the new BIOS branch source code, and the new BIOS branch source code is incorporated into the BIOS main source code to generate a new BIOS main source code.
Optionally, after the new BIOS branch source code is merged into the BIOS trunk source code to generate a new BIOS trunk source code, the method further includes: compiling the new BIOS main source code through a compiler to obtain a new BIOS code; and burning the new BIOS code into a chip of the appointed electronic equipment. The lowest level, most direct hardware settings and control for a given electronic device are provided by the new BIOS code.
Optionally, after sending a control instruction to a compatibility test process, instructing the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing a compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code, the method further includes: if the compatibility test result fed back by the compatibility test process is test failure, providing the merging failure prompt information to the user; and the merging failure prompt message is used for prompting that the merging of the new BIOS branch source code and the BIOS main source code fails, and re-inputting a code merging request after the new BIOS branch source code is modified.
Optionally, if the compatibility test result fed back by the compatibility test process is a test failure, which indicates that there is a compatibility problem in the new BIOS branch source code, the new BIOS branch source code is automatically blocked from being incorporated into the BIOS trunk source code, and a merge failure prompt message is provided to the user, so that the user determines: and when the new BIOS branch source code is modified, re-inputting a code merging request.
Therefore, under the condition that the test of the new BIOS branch code fails, the new BIOS branch source code is automatically blocked from being combined into the BIOS main source code, the new BIOS branch source code with compatibility defect is prevented from being combined into the BIOS main source code, and the compatibility problem is prevented from flowing into the BIOS main source code.
According to the technical scheme of the embodiment of the invention, a code merging request input by a user is obtained, and the code merging request carries a new BIOS branch source code; then sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code; if the compatibility test result is that the test is passed, the new BIOS branch source code is merged into the BIOS main source code to generate the new BIOS main source code, thereby solving the problems that the test scheme of the BIOS code in the related technology can not prevent the standard compatibility problem from flowing into the BIOS main source code in advance, occupying a large amount of hardware resources and improving the test cost, obtaining the compatibility test before code merging, realizing the prevention of the compatibility problem of the BIOS main source code, preventing the compatibility problem from flowing into the code main, really solving the compatibility problem of the BIOS code before the problem occurs, greatly reducing the influence possibly brought by the compatibility problem, meanwhile, the compatibility test is carried out under the simulator, so that the dependence of the compatibility test process on a physical machine is reduced, the transportability of the test environment is improved, and the test cost is reduced.
Example two
Fig. 2 is a flowchart of a code testing method according to a second embodiment of the present invention, which may be combined with various alternatives in one or more of the above embodiments. As shown in fig. 2, the method includes:
step 201, a code merging request input by a user is obtained, and the code merging request carries a new BIOS branch source code.
Step 202, sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code.
And 203, if the compatibility test result fed back by the compatibility test process is a test failure, providing a merging failure prompt message to the user.
And the merging failure prompt message is used for prompting that the merging of the new BIOS branch source code and the BIOS main source code fails, and re-inputting a code merging request after the new BIOS branch source code is modified.
Optionally, if the compatibility test result fed back by the compatibility test process is a test failure, which indicates that there is a compatibility problem in the new BIOS branch source code, the new BIOS branch source code is automatically blocked from being incorporated into the BIOS trunk source code, and a merge failure prompt message is provided to the user, so that the user determines: and the new BIOS branch source code and the BIOS main source code fail to be merged, and the code merging request is input again after the new BIOS branch source code is modified.
Therefore, under the condition that the test of the new BIOS branch source code fails, the new BIOS branch source code is automatically blocked from being merged into the BIOS main source code, the new BIOS branch source code with compatibility defects is prevented from being merged into the BIOS main source code, and the compatibility problem is prevented from flowing into the BIOS main source code.
According to the technical scheme of the embodiment of the invention, the compatibility test is carried out before the codes are combined, the prevention of the compatibility problem of the BIOS main trunk source codes is realized, the compatibility problem is prevented from flowing into the code main trunk, the compatibility problem of the BIOS codes is really solved before the problem occurs, the influence possibly brought by the compatibility problem is greatly reduced, meanwhile, the dependence of the compatibility test process on a physical machine is reduced by carrying out the compatibility test under a simulator, the transportability of the test environment is improved, and the beneficial effect of the test cost is also reduced.
EXAMPLE III
Fig. 3 is a flowchart of a code testing method according to a third embodiment of the present invention, which includes the following steps:
step 301, a code merging request input by a user is obtained, wherein the code merging request carries a new BIOS branch source code.
Step 302, sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing a compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code: if the compatibility test result fed back by the compatibility test process is that the test is passed, executing step 303; if the compatibility test result fed back by the compatibility test process is a test failure, go to step 304.
Step 303, merging the new BIOS branch source code into the BIOS trunk source code to generate a new BIOS trunk source code.
And step 304, providing the merging failure prompt information to the user.
And the merging failure prompt message is used for prompting that the merging of the new BIOS branch source code and the BIOS main source code fails, and re-inputting a code merging request after the new BIOS branch source code is modified.
According to the technical scheme of the embodiment of the invention, the compatibility test is carried out before the codes are combined, the prevention of the compatibility problem of the BIOS main trunk source codes is realized, the compatibility problem is prevented from flowing into the code main trunk, the compatibility problem of the BIOS codes is really solved before the problem occurs, the influence possibly brought by the compatibility problem is greatly reduced, meanwhile, the dependence of the compatibility test process on a physical machine is reduced by carrying out the compatibility test under a simulator, the transportability of the test environment is improved, and the beneficial effect of the test cost is also reduced.
Example four
Fig. 4 is a schematic structural diagram of a code testing apparatus according to a fourth embodiment of the present invention. The apparatus may be configured in an electronic device. As shown in fig. 4, the apparatus includes: a request acquisition module 401, a code testing module 402, and a code merging module 403.
The request obtaining module 401 is configured to obtain a code merging request input by a user, where the code merging request carries a new BIOS branch source code; a code testing module 402, configured to send a control instruction to a compatibility testing process, instruct the compatibility testing process, compile the new BIOS branch source code to obtain a new BIOS branch code, perform compatibility testing on the new BIOS branch code in a simulator, and feed back a compatibility testing result of the new BIOS branch code; a code merging module 403, configured to merge the new BIOS branch source code into the BIOS trunk source code to generate a new BIOS trunk source code if the compatibility test result fed back by the compatibility test process is that the test passes.
According to the technical scheme of the embodiment of the invention, a code merging request input by a user is obtained, and the code merging request carries a new BIOS branch source code; then sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code; if the compatibility test result is that the test is passed, the new BIOS branch source code is merged into the BIOS main source code to generate the new BIOS main source code, thereby solving the problems that the test scheme of the BIOS code in the related technology can not prevent the standard compatibility problem from flowing into the BIOS main source code in advance, occupying a large amount of hardware resources and improving the test cost, obtaining the compatibility test before code merging, realizing the prevention of the compatibility problem of the BIOS main source code, preventing the compatibility problem from flowing into the code main, really solving the compatibility problem of the BIOS code before the problem occurs, greatly reducing the influence possibly brought by the compatibility problem, meanwhile, the compatibility test is carried out under the simulator, so that the dependence of the compatibility test process on a physical machine is reduced, the transportability of the test environment is improved, and the test cost is reduced.
In an optional implementation manner of the embodiment of the present invention, optionally, when the code testing module 402 executes the operation of indicating the compatibility testing process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility testing on the new BIOS branch code in a simulator, and feeding back a result of the compatibility testing on the new BIOS branch code, the code testing module is specifically configured to: instructing the compatibility test process to perform the following operations: compiling the new BIOS branch source code through a compiler; if the compiling is successful, obtaining a new BIOS branch code, operating the new BIOS branch code in a simulator, and calling a preset compatibility test script to perform compatibility test on the new BIOS branch code in the operating process of the new BIOS branch code; and if the new BIOS branch code passes the compatibility test, determining that the compatibility test result of the new BIOS branch code passes the test, and feeding back the compatibility test result of the new BIOS branch code.
In an optional implementation manner of the embodiment of the present invention, optionally, after the compiling the new BIOS branch source code by the compiler, the method further includes: and if the compiling fails, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
In an optional implementation manner of the embodiment of the present invention, optionally, after the invoking a preset compatibility test script to perform the compatibility test on the new BIOS branch code, the method further includes: and if the new BIOS branch code does not pass the compatibility test, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
In an optional implementation manner of the embodiment of the present invention, optionally, the code testing apparatus further includes: a prompt information providing module, configured to provide, if the compatibility test result fed back by the compatibility test process is a test failure, a merge failure prompt information to the user; and the merging failure prompt message is used for prompting that the merging of the new BIOS branch source code and the BIOS main source code fails, and re-inputting a code merging request after the new BIOS branch source code is modified.
In an optional implementation manner of the embodiment of the present invention, optionally, the request obtaining module 401 is specifically configured to: and acquiring a code merging request input by a user through a code merging page, wherein the code merging request carries a new BIOS branch source code.
In an optional implementation manner of the embodiment of the present invention, optionally, the code testing apparatus further includes: the script acquisition module is used for acquiring a preset compatibility test script uploaded by a user and storing the preset compatibility test script to a preset storage position.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The code testing device can execute the code testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the code testing method.
EXAMPLE five
Fig. 5 shows a schematic structural diagram of an electronic device 10 that can be used to implement the code testing method of the embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM)12, a Random Access Memory (RAM)13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM)12 or the computer program built from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as code testing methods.
In some embodiments, the code testing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is built into the RAM 13 and executed by the processor 11, one or more steps of the code testing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the code testing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the code testing method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A code testing method, comprising:
acquiring a code merging request input by a user, wherein the code merging request carries a new BIOS branch source code;
sending a control instruction to a compatibility test process, indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility test on the new BIOS branch code in a simulator, and feeding back a compatibility test result of the new BIOS branch code;
and if the compatibility test result fed back by the compatibility test process is that the test is passed, merging the new BIOS branch source code into the BIOS main source code to generate a new BIOS main source code.
2. The method of claim 1, wherein the indicating the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing a compatibility test on the new BIOS branch code in a simulator, and feeding back a result of the compatibility test on the new BIOS branch code comprises:
instructing the compatibility test process to perform the following operations:
compiling the new BIOS branch source code through a compiler;
if the compiling is successful, obtaining a new BIOS branch code, operating the new BIOS branch code in a simulator, and calling a preset compatibility test script to perform compatibility test on the new BIOS branch code in the operating process of the new BIOS branch code;
and if the new BIOS branch code passes the compatibility test, determining that the compatibility test result of the new BIOS branch code passes the test, and feeding back the compatibility test result of the new BIOS branch code.
3. The method of claim 2, after compiling the new BIOS branch source code with a compiler, further comprising:
and if the compiling fails, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
4. The method of claim 2, after invoking a preset compatibility test script to perform compatibility test on the new BIOS branch code, further comprising:
and if the new BIOS branch code does not pass the compatibility test, determining that the compatibility test result of the new BIOS branch code is test failure, and feeding back the compatibility test result of the new BIOS branch code.
5. The method of claim 1, wherein after sending a control command to a compatibility test process, instructing the compatibility test process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing a compatibility test on the new BIOS branch code in a simulator, and feeding back a result of the compatibility test on the new BIOS branch code, the method further comprises:
if the compatibility test result fed back by the compatibility test process is test failure, providing the merging failure prompt information to the user;
and the merging failure prompt message is used for prompting that the merging of the new BIOS branch source code and the BIOS main source code fails, and re-inputting a code merging request after the new BIOS branch source code is modified.
6. The method of claim 1, wherein obtaining a user-entered code merge request, the code merge request carrying new BIOS branch source code, comprises:
and acquiring a code merging request input by a user through a code merging page, wherein the code merging request carries a new BIOS branch source code.
7. The method of claim 2, prior to obtaining the user-entered code merge request, further comprising:
the method comprises the steps of obtaining a preset compatibility test script uploaded by a user, and storing the preset compatibility test script to a preset storage position.
8. A code testing apparatus, comprising:
the request acquisition module is used for acquiring a code merging request input by a user, wherein the code merging request carries a new BIOS branch source code;
the code testing module is used for sending a control instruction to a compatibility testing process, indicating the compatibility testing process, compiling the new BIOS branch source code to obtain a new BIOS branch code, performing compatibility testing on the new BIOS branch code in a simulator and feeding back a compatibility testing result of the new BIOS branch code;
and the code merging module is used for merging the new BIOS branch source code into the BIOS main source code to generate a new BIOS main source code if the compatibility test result fed back by the compatibility test process is that the test is passed.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the code testing method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the code testing method of any one of claims 1-7 when executed.
CN202210472290.4A 2022-04-29 2022-04-29 Code testing method, device, equipment and medium Pending CN115080382A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210472290.4A CN115080382A (en) 2022-04-29 2022-04-29 Code testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210472290.4A CN115080382A (en) 2022-04-29 2022-04-29 Code testing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115080382A true CN115080382A (en) 2022-09-20

Family

ID=83247427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210472290.4A Pending CN115080382A (en) 2022-04-29 2022-04-29 Code testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115080382A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024113128A1 (en) * 2022-11-29 2024-06-06 Huawei Cloud Computing Technologies Co., Ltd. A code branch managing system for comparing and/or updating a master code branch with a new code branch

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024113128A1 (en) * 2022-11-29 2024-06-06 Huawei Cloud Computing Technologies Co., Ltd. A code branch managing system for comparing and/or updating a master code branch with a new code branch

Similar Documents

Publication Publication Date Title
CN109901985B (en) Distributed test apparatus and method, storage medium, and electronic device
CN112433944A (en) Service testing method, device, computer equipment and storage medium
CN113760769A (en) Test case processing method and device, electronic equipment and storage medium
CN115168130A (en) Chip testing method and device, electronic equipment and storage medium
CN114911492A (en) Inference service deployment method, device, equipment and storage medium
CN115080382A (en) Code testing method, device, equipment and medium
CN117724980A (en) Method and device for testing software framework performance, electronic equipment and storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN112988578A (en) Automatic testing method and device
CN116702668A (en) Regression testing method and device, electronic equipment and storage medium
CN112965910B (en) Automatic regression testing method and device, electronic equipment and storage medium
CN114996107A (en) Log file updating method, device, equipment, medium and product
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN112231231A (en) Method, system and device for debugging cloud service
CN112379973A (en) Heavy loading method and device
CN111176718A (en) Script online method and device, storage medium and electronic equipment
CN115374010A (en) Function testing method, device, equipment and storage medium
CN111258910B (en) Static link library function verification method and device, electronic equipment and storage medium
CN111625275B (en) Code reconstruction planning method and device, storage medium and electronic equipment
CN114879982A (en) Software installation method and device, electronic equipment and storage medium
CN110175116B (en) Test date switching method, device and system
US20230262135A1 (en) Service deployment processing method and apparatus, electronic device, and storage medium
CN116955189A (en) Automatic testing method, device and equipment for user interface and storage medium
CN116974940A (en) Interface testing method, device, equipment and storage medium
CN115878168A (en) Software development method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination