-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
345 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
node ('centos7' + ' && !vm1-centos7'){ | ||
try { | ||
stage('Preparation') { | ||
withEnv(['PATH+WHATEVER=/home/balasr/.local/bin:/home/balasr/.riscv/bin']) { | ||
checkout scm | ||
sh 'pip install --user junit-xml' | ||
sh 'git submodule update --init --recursive' | ||
dir("tb/core") { | ||
sh 'make fpnew/src/fpnew_pkg.sv' | ||
} | ||
} | ||
} | ||
stage('Build Firmware') { | ||
withEnv(['PATH+WHATEVER=/home/balasr/.local/bin:/home/balasr/.riscv/bin', | ||
'RISCV=/home/balasr/.riscv']) { | ||
dir("tb/core") { | ||
sh "make firmware/firmware.hex" | ||
} | ||
dir("tb/dm") { | ||
sh "make prog/test.hex" | ||
} | ||
} | ||
} | ||
stage('Build RTL') { | ||
dir("tb/core") { | ||
sh "make vsim-all" | ||
} | ||
dir("tb/dm") { | ||
sh "make vsim-all" | ||
} | ||
} | ||
|
||
stage('Run Tests') { | ||
dir("tb/core") { | ||
sh "make firmware-vsim-run 2>&1 | tee test.log" | ||
} | ||
sh "./ci/rv32tests-to-junit.py -i tb/core/test.log -o rv32_test_report.xml" | ||
|
||
withEnv(['PATH+WHATEVER=/home/balasr/.local/bin:/home/balasr/.riscv/bin', | ||
'RISCV=/home/balasr/.riscv']) { | ||
sh "./ci/run-openocd-compliance.sh" | ||
sh "./ci/openocd-to-junit.py -i openocd.log -o openocd_test_report.xml" | ||
|
||
} | ||
} | ||
|
||
} catch (e) { | ||
currentBuild.result = "FAILED" | ||
echo "SENDING E-MAIL" | ||
notifyFailed() | ||
throw e | ||
} finally { | ||
junit '*.xml' | ||
} | ||
} | ||
|
||
def notifyFailed() { | ||
emailext ( | ||
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", | ||
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p> | ||
<p>Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""", | ||
recipientProviders: [[$class: 'DevelopersRecipientProvider']] | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
import sys, getopt | ||
from junit_xml import * | ||
|
||
|
||
def main(argv): | ||
inputfile = '' | ||
outputfile = '' | ||
|
||
try: | ||
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="]) | ||
except getopt.GetoptError: | ||
print ('openocd-to-junit.py -i <inputfile> -o <outputfile>') | ||
sys.exit(2) | ||
for opt, arg in opts: | ||
if opt == '-h': | ||
print ('openocd-to-junit.py -i <inputfile> -o <outputfile>') | ||
sys.exit() | ||
elif opt in ("-i", "--ifile"): | ||
inputfile = arg | ||
elif opt in ("-o", "--ofile"): | ||
outputfile = arg | ||
|
||
test_strings = defaultdict(list) | ||
test_timestamps = {} | ||
current_testname = '' | ||
|
||
test_cases = [] | ||
current_test_case = None | ||
|
||
ocd_stdout = '' | ||
|
||
with open(inputfile, 'r') as infile: | ||
for line in infile: | ||
if 'Info' in line and 'riscv013_test_compliance()' in line: | ||
print(line.split(' ')) | ||
current_testname = ' '.join(line.split(' ')[7:]) | ||
test_strings[current_testname].append(line) | ||
test_timestamps[current_testname] = line.split(' ')[3] | ||
|
||
ocd_stdout += line | ||
|
||
for k,v in test_strings.items(): | ||
current_test_case = TestCase(k, stdout=''.join(v), | ||
timestamp=test_timestamps[k]) | ||
error_msg = "" | ||
for line in v: | ||
if 'FAILED' in line: | ||
error_msg += line; | ||
|
||
if error_msg: | ||
current_test_case.add_error_info(error_msg) | ||
|
||
test_cases.append(current_test_case) | ||
|
||
ts = TestSuite("openocd-compliance", test_cases, stdout=ocd_stdout) | ||
# pretty printing is on by default but can be disabled using prettyprint=False | ||
with open(outputfile, 'w') as outfile: | ||
TestSuite.to_file(outfile, [ts]) | ||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
import sys, getopt | ||
from junit_xml import * | ||
|
||
|
||
def main(argv): | ||
inputfile = '' | ||
outputfile = '' | ||
|
||
try: | ||
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="]) | ||
except getopt.GetoptError: | ||
print ('rv32tests-to-junit.py -i <inputfile> -o <outputfile>') | ||
sys.exit(2) | ||
for opt, arg in opts: | ||
if opt == '-h': | ||
print ('rv32tests-to-junit.py -i <inputfile> -o <outputfile>') | ||
sys.exit() | ||
elif opt in ("-i", "--ifile"): | ||
inputfile = arg | ||
elif opt in ("-o", "--ofile"): | ||
outputfile = arg | ||
|
||
test_strings = defaultdict(list) | ||
current_testname = '' | ||
|
||
test_cases = [] | ||
current_test_case = None | ||
|
||
with open(inputfile, 'r') as infile: | ||
for line in infile: | ||
if 'Test Begin' in line: | ||
current_testname = line.split('#')[1] | ||
if 'Test End' in line: | ||
current_testname = "" | ||
if current_testname != "": | ||
test_strings[current_testname].append(line) | ||
|
||
for k,v in test_strings.items(): | ||
#test_cases.append(TestCase('Test1', stdout=''.join(v))) | ||
current_test_case = TestCase(k, stdout=''.join(v)) | ||
error_msg = "" | ||
for line in v: | ||
if 'Assertion violation' in line: | ||
error_msg += line; | ||
|
||
if error_msg: | ||
current_test_case.add_error_info(error_msg) | ||
|
||
test_cases.append(current_test_case) | ||
|
||
ts = TestSuite("riscv-compliance", test_cases) | ||
# pretty printing is on by default but can be disabled using prettyprint=False | ||
with open(outputfile, 'w') as outfile: | ||
TestSuite.to_file(outfile, [ts]) | ||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1:]) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.