Skip to content

Commit 677d024

Browse files
elena-volkova-hclGitHub Enterprise
authored andcommitted
RIC-1122: Automate samples execution (#101)
* RIC-1122: Add execute step for samples * Call sed after cd * RIC-1122: Remove folders before copying, allow stderr printouts * Use branch RIC-1122-automate-samples * RIC-1122: timeout = 10, add args for MatMult * RIC-1122: support expect_stdout.txt and similar * RIC-1122: Fix command line arguments * Use master branch * Try different quotes for MatMult arguments * Fix arguments, try to send to stdin * RIC-1122: exit(0) in case of correct completion in MatMult * Change to 5 rounds * Fix arguments
1 parent 517c388 commit 677d024

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

art-comp-test/Jenkinsfile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ def prepareTests() {
8787

8888
sh '''
8989
pwd
90+
rm -rf ./art-comp-test/tests/sanity_* ./art-comp-test/tests/sample_* ./art-comp-test/tests/TcpServer ./art-samples/*_target ./art-samples/*/*_target
91+
9092
cp -r ./art-samples/HelloWorld/ ./art-comp-test/tests/sanity_HelloWorld
9193
cd ./art-comp-test/tests/sanity_HelloWorld
9294
mv *.tcjs top.tcjs
@@ -107,21 +109,31 @@ def prepareTests() {
107109
for ff in $(find ./art-samples -name '*.tcjs' -type f | xargs dirname)
108110
do
109111
folder=$(basename $ff)
110-
[[ $folder == *_target ]] && continue
111112
[ $folder == HelloWorld ] && continue
112113
[ $folder == PiComputer ] && continue
113114
[[ $folder == Qt* ]] && continue
114115
[[ $folder == gRPC* ]] && continue
115-
if [ $folder == TcpServer ]
116-
then
117-
cp -r $ff ./art-comp-test/tests/
118-
continue
119-
fi
116+
[ $folder == TcpServer ] && cp -r $ff ./art-comp-test/tests/ && continue
117+
120118
cp -r $ff ./art-comp-test/tests/sample_$folder
121119
cd ./art-comp-test/tests/sample_$folder
122120
[ -f top.tcjs ] || mv *.tcjs top.tcjs
121+
[ $folder == TrafficLight ] && sed -i 's/TrafficLight/Top/' *.tcjs *.art
122+
[ $folder == TrafficLightWeb ] && sed -i 's/TLSystem/Top/' *.tcjs *.art
123123
echo -e "\ntc.targetProject = 'sample_${folder}_target';" >> top.tcjs
124-
echo -e "---\ngroup: samples\nsteps: generate-build\n---\nBuilding Art sample $folder" > testcase.md
124+
echo "---" > testcase.md
125+
echo "group: samples" >> testcase.md
126+
echo "steps: generate-build, execute" >> testcase.md
127+
timeout=10
128+
[ $folder == DiningPhils_v1 ] && timeout=25
129+
[ $folder == DiningPhils_v2 ] && timeout=5
130+
echo "timeout: $timeout" >> testcase.md
131+
echo "allow_stderr_printouts: true" >> testcase.md
132+
[ $folder == MatMult ] && echo "test_exe_args: -URTS_DEBUG=quit -UARGS 2 3 [2,2,2,4,4,4] [5,5,5,5,5,5]" >> testcase.md
133+
[ $folder == TcpRangeCounter ] && echo "test_exe_args: -URTS_DEBUG=quit -port=12345" >> testcase.md
134+
[ $folder == PingPongTimeDeltaTracker ] && echo "test_exe_args: -URTS_DEBUG=quit <5" >> testcase.md
135+
echo "---" >> testcase.md
136+
echo "Building and executing Art sample $folder" >> testcase.md
125137
cd $WORKSPACE
126138
done
127139

art-samples/DistributedPingPong/Top.art

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
capsule TOP {
3+
capsule Top {
44

55
[[rt::impl]]
66
`
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let tc = TCF.define(TCF.ART_TO_CPP);
2-
tc.topCapsule = 'TOP';
2+
tc.topCapsule = 'Top';
33
tc.targetFolder = 'DistributedPingPong_target';
44
tc.prerequisites = ['../TcpServer/tcpServerLib.tcjs'];
55
tc.cppCodeStandard = "C++ 17";

art-samples/MatMult/OutputCollector.art

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ capsule OutputCollector {
4949
`
5050
std::cout << "[" << myName << "] Done" << std::endl;
5151
std::cout << "[" << myName << "] Exiting..." << std::endl;
52-
exit(1);
52+
exit(0);
5353
`;
5454
};
5555

0 commit comments

Comments
 (0)