Skip to content

Commit 5f430f2

Browse files
committed
Add Azure DevOps pipelines for ThreadX test
1 parent ebeb02b commit 5f430f2

File tree

6 files changed

+161
-2
lines changed

6 files changed

+161
-2
lines changed

.pipelines/smp.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
trigger:
2+
- master
3+
4+
pr:
5+
- master
6+
7+
pool:
8+
vmImage: "ubuntu-22.04"
9+
10+
steps:
11+
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
12+
displayName: 'Install softwares'
13+
env:
14+
INDEX_URL: $(INDEX_URL)
15+
16+
- task: Bash@3
17+
displayName: 'SDL check'
18+
inputs:
19+
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
20+
21+
- task: Bash@3
22+
displayName: 'Build SMP'
23+
inputs:
24+
filePath: '$(Build.SourcesDirectory)/scripts/build_smp.sh'
25+
26+
- task: Bash@3
27+
displayName: 'Test SMP'
28+
inputs:
29+
filePath: '$(Build.SourcesDirectory)/scripts/test_smp.sh'
30+
31+
- task: PublishTestResults@2
32+
condition: succeededOrFailed()
33+
displayName: 'Test SMP (PublishTestResults)'
34+
inputs:
35+
testResultsFormat: 'cTest'
36+
testResultsFiles: '*/Testing/**/*.xml'
37+
searchFolder: '$(Build.SourcesDirectory)/test/smp/cmake/build'
38+
testRunTitle: 'SMP-Tests'
39+
buildConfiguration: 'Release'
40+
41+
- task: CopyFiles@2
42+
condition: succeededOrFailed()
43+
displayName: 'Test SMP (PublishTestReports)'
44+
inputs:
45+
SourceFolder: '$(Build.SourcesDirectory)/test/smp/cmake'
46+
Contents: |
47+
build/*.txt
48+
build/*/Testing/**/*.xml
49+
coverage_report/**/*
50+
TargetFolder: '$(ob_outputDirectory)/test_reports_SMP'
51+
52+
- task: PublishCodeCoverageResults@1
53+
condition: succeededOrFailed()
54+
displayName: 'Test SMP (PublishCodeCoverageResults)'
55+
inputs:
56+
codeCoverageTool: 'Cobertura'
57+
summaryFileLocation: '$(Build.SourcesDirectory)/test/smp/cmake/coverage_report/default_build_coverage.xml'
58+
pathToSources: '$(Build.SourcesDirectory)/test/smp/cmake'
59+
reportDirectory: '$(Build.SourcesDirectory)/test/smp/cmake/coverage_report/default_build_coverage'

.pipelines/tx.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
trigger:
2+
- master
3+
4+
pr:
5+
- master
6+
7+
pool:
8+
vmImage: "ubuntu-22.04"
9+
10+
steps:
11+
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
12+
displayName: 'Install softwares'
13+
env:
14+
INDEX_URL: $(INDEX_URL)
15+
16+
- task: Bash@3
17+
displayName: 'SDL check'
18+
inputs:
19+
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
20+
21+
- task: Bash@3
22+
displayName: 'Build TX'
23+
inputs:
24+
filePath: '$(Build.SourcesDirectory)/scripts/build_tx.sh'
25+
26+
- task: Bash@3
27+
displayName: 'Test TX'
28+
inputs:
29+
filePath: '$(Build.SourcesDirectory)/scripts/test_tx.sh'
30+
31+
- task: PublishTestResults@2
32+
condition: succeededOrFailed()
33+
displayName: 'Test TX (PublishTestResults)'
34+
inputs:
35+
testResultsFormat: 'cTest'
36+
testResultsFiles: '*/Testing/**/*.xml'
37+
searchFolder: '$(Build.SourcesDirectory)/test/tx/cmake/build'
38+
testRunTitle: 'TX-Tests'
39+
buildConfiguration: 'Release'
40+
41+
- task: CopyFiles@2
42+
condition: succeededOrFailed()
43+
displayName: 'Test TX (PublishTestReports)'
44+
inputs:
45+
SourceFolder: '$(Build.SourcesDirectory)/test/tx/cmake'
46+
Contents: |
47+
build/*.txt
48+
build/*/Testing/**/*.xml
49+
coverage_report/**/*
50+
TargetFolder: '$(ob_outputDirectory)/test_reports_TX'
51+
52+
- task: PublishCodeCoverageResults@1
53+
condition: succeededOrFailed()
54+
displayName: 'Test TX (PublishCodeCoverageResults)'
55+
inputs:
56+
codeCoverageTool: 'Cobertura'
57+
summaryFileLocation: '$(Build.SourcesDirectory)/test/tx/cmake/coverage_report/default_build_coverage.xml'
58+
pathToSources: '$(Build.SourcesDirectory)/test/tx/cmake'
59+
reportDirectory: '$(Build.SourcesDirectory)/test/tx/cmake/coverage_report/default_build_coverage'

scripts/install.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
#
3+
# Install necessary softwares for Ubuntu.
4+
5+
apt-get update
6+
apt-get install -y \
7+
gcc-multilib \
8+
git \
9+
g++ \
10+
python3-pip \
11+
ninja-build \
12+
unifdef \
13+
p7zip-full \
14+
tofrodos \
15+
gawk \
16+
cmake \
17+
software-properties-common
18+
19+
python3 -m pip install --upgrade pip
20+
pip3 install artifacts-keyring
21+
pip3 install gcovr==4.1 $INDEX_URL
22+

scripts/sdl_check.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# !/bin/bash
2+
dir_list="common common_smp common_modules ports ports_module ports_smp samples"
3+
exclude_list="-path TX"
4+
file_list=$(find $dir_list \( $exclude_list \) -prune -o -type f -name '*.[ch]' -print)
5+
cd $(dirname `realpath $0`)/..
6+
echo "Checking for unexpected usage of memcpy..."
7+
echo ""
8+
echo "Excluding:"
9+
echo $exclude_list | grep -P "[^\s]*/[^\s]*" -o
10+
echo ""
11+
echo "Result:"
12+
grep -i "memcpy(" -i $file_list -n | grep -i "use case of .* is verified" -v
13+
if [ "$?" -eq "1" ];
14+
then
15+
echo "CLEAN"
16+
exit 0
17+
else
18+
exit 1
19+
fi

test/smp/cmake/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../tools/cmake_bootstrap.sh
1+
../../../scripts/cmake_bootstrap.sh

test/tx/cmake/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../tools/cmake_bootstrap.sh
1+
../../../scripts/cmake_bootstrap.sh

0 commit comments

Comments
 (0)