• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Compile the test case
2
3-   [Introduction]
4-   [Directory]
5-   [Constraints and Limitations]
6-   [illustrate]
7-   [Description of related issues]
8
9## Introduction
10
11Provides a framework based on cmake compilation, which can compile binary files for different platforms.
12
13According to the needs of customers, compile and generate corresponding executable programs and library files. Its compilation process is:
14
151.  Use python script to configure the parameters of cmake compilation
162.  After python runs, a Makefile will be generated
173.  Execute the compiled task by running cmake --build .
18
19## Directory
20
21```
22.
23├── README.en.md
24├── README.md
25├── ndk-test
26│   ├── CMakeLists.txt           # Starting point for ndk-test build via cmake
27│   ├── build.py                 # Script to compile ndk-test
28│   └── src
29├── sanitize
30│   ├── CMakeLists.txt           # Starting point for sanitize build via cmake
31│   ├── asan
32│   ├── build.py                 # Script to compile sanitize
33│   ├── cfi
34│   ├── fuzz
35│   ├── scudo
36│   └── ubsan
37├── script                       # Script Directory
38│   ├── __pycache__
39│   ├── build.py                 # Total Compile Script
40│   ├── config_args.py           # Parameters required for cmake compilation
41│   ├── runtest-sanitize.sh
42│   ├── runtest.sh
43│   └── runtest_Windows.bat      # Push the compiled files to the board
44└── target                       # save the target file
45    └── README.md
46```
47
48## Constraints and Limitations
49
50-   Need to download NDK or compile and generate through openharmony
51-   Configuration environment, please refer to [help for wiki](https://gitee.com/openharmony/third_party_musl/wikis/Home)
52
53## illustrate
54
551.  Compile commands for full compilation in the general directory
56
57    ```
58    python build.py
59    ```
60
612.  The corresponding compilation directory can be compiled separately
62
63    ```
64    # subdirectory sanitize
65    python build.py
66    # subdirectory ndk-test
67    python build.py
68    ```
69
703.  Run the test case on the board
71
72    ```
73    # Make sure the board is connected to the computer and run the script
74    runtest_Windows.bat
75    ```
76
774.  If the above steps are executed successfully, the script will generate a REPORT and REPORT-SANITIZE files to record the results of running the ndk-test and sanitize test cases respectively
78
79## Description of related issues
80
81**For cmake parameter CMAKE_TOOCHAIN_FILE**
82-   Points to the location of the toolchain file, which is important for compiling binaries for different platforms, so give the correct path