Skip to content

Commit 7a3bb83

Browse files
Release scripts to validate ThreadX port (#254)
1 parent b11d1be commit 7a3bb83

File tree

158 files changed

+4345
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+4345
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode/
22
_deps/
33
build/
4+
Debug/
45
CMakeFiles/
56
CMakeScripts/
67
CMakeLists.txt.user
@@ -11,4 +12,5 @@ cmake_install.cmake
1112
install_manifest.txt
1213
compile_commands.json
1314
CTestTestfile.cmake
15+
*.dep
1416

test/ports/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
log

test/ports/README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Azure RTOS ThreadX CI/CD system
2+
3+
**The old Azure RTOS ThreadX CI/CD script and README are preserved with the .old extension**
4+
5+
This directory contains a collection of files to execute test for continuos integration and continuous delivery of Azure RTOS ThreadX.
6+
7+
This directory contains documentation, scripts and auxiliary files (expected test results, etc).
8+
9+
The Azure RTOS ThreadX CI/CD system can be used in various scenarios:
10+
* Setting up the environment for a toolchain
11+
* Cleaning up the local repository
12+
* Building locally or on the pipeline
13+
* Smoke testing examples (on the native IDE)
14+
* Testing an example on a generic architecture simulator (like ARM FVP)
15+
* Running the certification test suite on a port
16+
* Testing locally during development
17+
* Testing automatically on the DevOps pipeline
18+
* Testing ports
19+
* Testing examples
20+
* Testing one or more ports
21+
* Verifying the ports build
22+
* Verifying that examples one or more ports during development
23+
24+
There are several operations that can be performed by the CI/CD system:
25+
* CheckCompliance: perform compliance checks (only debug configurations, valid comments, ...)
26+
* StartCLI: start a CLI environment.
27+
* RealClean: remove all generated files.
28+
* Clean: remove all build generated files.
29+
* Build: compile examples using using the toolchain IDE, project, workspace, etc.
30+
* Test: smoke test examples with the toolchain simulator.
31+
* PlatformTest: test examples using the platform simulator, like the ARM FVP platform.
32+
* CertificationTest: test examples using the certification test suite.
33+
* HardwareTest: test examples using attached hardware.
34+
35+
## azrtos_cicd.ps1
36+
This is the main entry point for Azure RTOS ThreadX CI/CD operations.
37+
To get detailed usage information use the PowerShell Get-Help command passing this script as a parameter.
38+
This file outputs a summary to the screen and detailed log file with all output to files located in the default log directory or a directory specified in the script command line.
39+
40+
## azrtos_cicd.csv
41+
This is the default database of ports, examples and corresponding data and scripts. The database is a CSV file that can be modified or updated by the user. Other databases can be specified on the command line when calling the script.
42+
43+
## -StartCLI
44+
This option will open a CLI with the environment appropriately set for it. It will have the command aliases "realclean", "clean", "build" and "test" set to the corresponding scripts. Useful for developing and debugging.
45+
46+
## Examples:
47+
48+
These examples assume the PowerShell script is called from the Windows Command Interpreter. For calling the script from the PowerShell prompt, remove the leading `pwsh -Command`.
49+
50+
`pwsh -Command Get-Help .\azrtos_cicd.ps1`
51+
Show the help embedded in the script.
52+
53+
`pwsh -Command .\azrtos_cicd.ps1 -clean`
54+
This cleans all examples in the default database.
55+
56+
`pwsh -Command .\azrtos_cicd.ps1 -build`
57+
This builds all examples in the default database.
58+
59+
`pwsh -Command .\azrtos_cicd.ps1 -test`
60+
This runs the bassic tests on all examples in the default database.
61+
62+
`pwsh -Command .\azrtos_cicd.ps1 -clean -build -test`
63+
This first cleans, then builds and finally runs tests on all examples in the default database.
64+
65+
`pwsh -Command .\azrtos_cicd.ps1 -MatchName 'Modules' -build`
66+
This builds all ThreadX Modules examples.
67+
68+
`pwsh -Command .\azrtos_cicd.ps1 -MatchName 'Modules','IAR' -build`
69+
This builds all examples in the default database that have names matching the string 'Modules' and 'IAR'.
70+
71+
`pwsh -Command .\azrtos_cicd.ps1 -MatchName 'Cortex M4','ARM compiler v6' -StartCli`
72+
This opens a CLI with set environment for all examples in the default database that have names matching the 'Cortex M4' and 'ARM compiler v6'.
73+
74+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex M' -clean`
75+
This cleans all examples matching all the keywords; these are ThreadX (not ThreadX modules) Cortex M (0/3/4/7/23/33/...) for ARM compiler v6.
76+
77+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex M' -build`
78+
Like the example above, but it builds the matching examples.
79+
80+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','Cortex M7' -StartCLI`
81+
Start CLI environments for all ThreadX for Cortex M7 examples (IAR, ARM compiler v5, ARM compiler v6, GHS, ...).
82+
From these you can use the commands 'realclean','clean','build','test' to call these operations and see the output on the console.
83+
84+
Here is a list of commonly used commands that you can directly cut/paste into your command line:
85+
`pwsh -Command Get-Help .\azrtos_cicd.ps1`
86+
`pwsh -Command .\azrtos_cicd.ps1 -clean`
87+
`pwsh -Command .\azrtos_cicd.ps1 -build`
88+
`pwsh -Command .\azrtos_cicd.ps1 -test`
89+
`pwsh -Command .\azrtos_cicd.ps1 -clean -build -test`
90+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex M' -clean`
91+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','IAR','Cortex M' -clean`
92+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','Cortex M' -clean`
93+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex M' -build`
94+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','IAR','Cortex M' -build`
95+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','Cortex M' -build`
96+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','ARM compiler v6','Cortex M' -clean`
97+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','IAR','Cortex M' -clean`
98+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','GCC','Cortex M' -clean`
99+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','ARM compiler v6','Cortex M' -build`
100+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','IAR','Cortex M' -build`
101+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TXM','GCC','Cortex M' -build`
102+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','SMP' -clean`
103+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','IAR','SMP' -clean`
104+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','SMP' -clean`
105+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','SMP' -build`
106+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','IAR','SMP' -build`
107+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','SMP' -build`
108+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','ARMv8-A' -build`
109+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','ARMv8-A' -build`
110+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex-A35' -clean`
111+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','Cortex-A35' -clean`
112+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex-A35' -build`
113+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','Cortex-A35' -build`
114+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','ARM compiler v6','Cortex-A35' -test`
115+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'TX ','GCC','Cortex-A35' -test`
116+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'ARM compiler v6','Cortex-A35' -clean -build -test`
117+
`pwsh -Command .\azrtos_cicd.ps1 -MatchKeywords 'GCC','Cortex-A35' -clean -build -test`
118+
119+
For more examples look at the help embedded in the script.

test/ports/README.old.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Azure RTOS CI/CD (old version)
2+
3+
**There is a new version of this script written in PowerSell and now named azrtos_cicd.ps1. Use that script instead. The documentation for that script is in the file README.md and the embedded help of that script.**
4+
5+
This directory contains a collection of files to execute several automated operations on all ports.
6+
These are batch scripts and auxiliary files (expected test results, etc).
7+
8+
## These operations include:
9+
* Build: compile the port example.
10+
* Clean: remove all build generated files.
11+
* Test: test the example with the toolchain simulator.
12+
* Test_FVP: test the example using the ARM FVP platform.
13+
14+
## azrtos_cicd.old.bat
15+
This is the main entry point for operations to be performed on several examples at the same time.
16+
This script can be called from any location, it will automatically perform the requested operations on the examples of the repository where it is located.
17+
This file outputs a summary to the screen and a detailed log file with all the output called azrtos_do.all.log
18+
Call this scripts without parameters to get usage information.
19+
The script parameters are case insensitive.
20+
21+
## Examples:
22+
23+
`azrtos_cicd.old.bat build tx ghs iar`
24+
This will build all GHS and IAR example projects.
25+
26+
`azrtos_cicd.old.bat clean tx all`
27+
This cleans all ThreadX examples
28+
29+
`azrtos_cicd.old.bat build txm iar`
30+
This builds all ThreadX Modules IAR examples.

test/ports/azrtos_build_tx_ac5.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
CALL build_threadx.bat
6+
IF NOT EXIST tx.a (
7+
ECHO ERROR: ThreadX library build failed.
8+
EXIT /B 1
9+
)
10+
11+
CALL build_threadx_sample.bat
12+
IF NOT EXIST sample_threadx.axf (
13+
ECHO ERROR: ThreadX example build failed.
14+
EXIT /B 1
15+
)
16+
17+
ECHO INFO: Build completed successfully!

test/ports/azrtos_build_tx_arm_ds.bat

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
IF EXIST workspace GOTO WORKSPACE_EXISTS
6+
7+
ECHO INFO: Initializing the workspace...
8+
%AZRTOS_ARM_DS_IDEC% -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data .\workspace -import .\tx -import .\sample_threadx
9+
IF %ERRORLEVEL% NEQ 0 (
10+
ECHO ERROR: failed to initialize the workspace
11+
EXIT /B 1
12+
) ELSE (
13+
ECHO INFO: Workspace initialized.
14+
)
15+
16+
:WORKSPACE_EXISTS
17+
%AZRTOS_ARM_DS_IDEC% -nosplash --launcher.suppressErrors -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data .\workspace -build tx -build sample_threadx
18+
IF %ERRORLEVEL% NEQ 0 (
19+
ECHO ERROR: build failed.
20+
EXIT /B 1
21+
)
22+
23+
ECHO INFO: Build completed successfully!

test/ports/azrtos_build_tx_ghs.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
%AZRTOS_GHS_COMP_GBUILD% -top azure_rtos_workspace.gpj tx.a txe.a sample_threadx sample_threadx_el
6+
IF %ERRORLEVEL% NEQ 0 (
7+
echo ERROR: build failed.
8+
EXIT /B 1
9+
)
10+
11+
ECHO INFO: Build completed successfully!

test/ports/azrtos_build_tx_gnu.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
CALL build_threadx.bat
6+
IF NOT EXIST tx.a (
7+
ECHO ERROR: ThreadX library build failed.
8+
EXIT /B 1
9+
)
10+
11+
CALL build_threadx_sample.bat
12+
IF NOT EXIST sample_threadx.out (
13+
ECHO ERROR: ThreadX example build failed.
14+
EXIT /B 1
15+
)
16+
17+
ECHO INFO: Build completed successfully!

test/ports/azrtos_build_tx_iar.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
%AZRTOS_IAR_BUILD% tx.ewp -make Debug -log all -parallel %NUMBER_OF_PROCESSORS%
6+
IF %ERRORLEVEL% NEQ 0 (
7+
ECHO ERROR: failed to build tx.ewp
8+
EXIT /B 1
9+
)
10+
11+
%AZRTOS_IAR_BUILD% sample_threadx.ewp -make Debug -log all -parallel %NUMBER_OF_PROCESSORS%
12+
IF %ERRORLEVEL% NEQ 0 (
13+
ECHO ERROR: failed to build sample_threadx.ewp
14+
EXIT /B 1
15+
)
16+
17+
ECHO INFO: Build completed successfully!

test/ports/azrtos_build_tx_mdk4.bat

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@ECHO OFF
2+
3+
ECHO INFO: Building %CD%...
4+
5+
ECHO INFO: Building ThreadX_Library...
6+
DEL out.txt 2> NUL
7+
START /wait %AZRTOS_KEIL_UV% -j0 -b ThreadX_Library.uvproj -o out.txt
8+
IF %ERRORLEVEL% GEQ 2 GOTO BUILD_ERROR
9+
TYPE out.txt 2> NUL
10+
11+
ECHO INFO: Building ThreadX_Demo...
12+
DEL out.txt 2> NUL
13+
START /wait %AZRTOS_KEIL_UV% -j0 -b ThreadX_Demo.uvproj -o out.txt
14+
IF %ERRORLEVEL% GEQ 2 GOTO BUILD_ERROR
15+
TYPE out.txt 2> NUL
16+
17+
DEL out.txt 2> NUL
18+
ECHO INFO: Build completed successfully!
19+
EXIT /B 0
20+
21+
:BUILD_ERROR
22+
TYPE out.txt 2> NUL
23+
ECHO ERROR: build failed.
24+
EXIT /B 1

0 commit comments

Comments
 (0)