Skip to content

Commit 5187953

Browse files
authored
add ROCM-Examples
add ROCM-Examples testing in precheckin
1 parent 0945c5c commit 5187953

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

Diff for: .jenkins/common.groovy

+29-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
2828
platform.runCommand(this, command)
2929
}
3030

31-
def runTestCommand (platform, project)
31+
def runTestCommand (platform, project, boolean rocmExamples=false)
3232
{
3333
String sudo = auxiliary.sudo(platform.jenkinsLabel)
3434
// String centos = platform.jenkinsLabel.contains('centos') ? '3' : ''
@@ -44,6 +44,34 @@ def runTestCommand (platform, project)
4444
"""
4545

4646
platform.runCommand(this, command)
47+
//ROCM Examples
48+
if (rocmExamples){
49+
String buildString = ""
50+
if (platform.os.contains("ubuntu")){
51+
buildString += "sudo dpkg -i *.deb"
52+
}
53+
else {
54+
buildString += "sudo rpm -i *.rpm"
55+
}
56+
testCommand = """#!/usr/bin/env bash
57+
set -ex
58+
cd ${project.paths.project_build_prefix}/build/release/package
59+
${buildString}
60+
cd ../../..
61+
testDirs=("Libraries/rocRAND")
62+
git clone https://github.com/ROCm/rocm-examples.git
63+
rocm_examples_dir=\$(readlink -f rocm-examples)
64+
for testDir in \${testDirs[@]}; do
65+
cd \${rocm_examples_dir}/\${testDir}
66+
cmake -S . -B build
67+
cmake --build build
68+
cd ./build
69+
ctest --output-on-failure
70+
done
71+
"""
72+
platform.runCommand(this, testCommand, "ROCM Examples")
73+
74+
}
4775
}
4876

4977
def runPackageCommand(platform, project)

Diff for: .jenkins/precheckin.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def runCI =
2929
{
3030
platform, project->
3131

32-
commonGroovy.runTestCommand(platform, project)
32+
commonGroovy.runTestCommand(platform, project, true)
3333
}
3434

3535
def packageCommand =

0 commit comments

Comments
 (0)