Project

General

Profile

How to run JUnit tests » History » Version 5

Sergey Smolov, 10/25/2019 01:17 PM

1 4 Sergey Smolov
h1. Template-based JUnit test cases
2 1 Sergey Smolov
3
h2. Prerequisites
4
5
This instruction is suitable for those developers of "MicroTESK for RISC-V":https://forge.ispras.ru/projects/microtesk-riscv project who want to run project's JUnit test cases on their own machines. The instruction is applicable for Linux-based OS only. All the package names that are mentioned here are correct for Ubuntu-based distros and may be different in other OS. For JUnit tests running you should have an access to "Nexus Repository Manager":https://forge.ispras.ru/nexus server at ISP RAS network. Ask system administrator of ISP Nexus for login and password and store them at the _REPO_USER and _REPO_PASSWORD system variables respectively.
6
7
h2. Introduction
8
9
The "MicroTESK for RISC-V":https://forge.ispras.ru/projects/microtesk-riscv project contains a collection of JUnit test cases. Most of them consist of the following steps:
10
* Assembler test program and "MicroTESK":https://forge.ispras.ru/projects/microtesk simulator log generation from the Ruby test template and RISC-V ISA nML specifications;
11
* Test program compilation into binary image;
12
* Test program binary image simulation on "QEMU4V":https://forge.ispras.ru/projects/qemu4v (simulation log file is produced);
13
* Test program binary image simulation on "Spike":https://github.com/riscv/riscv-isa-sim (simulation log file is produced);
14
* MicroTESK and QEMU4V log comparison by "Trace Matcher":https://forge.ispras.ru/projects/traceutils tool.
15
16
For all the steps of JUnit test cases to be accomplished, several auxiliary tools should be installed. For complete guide read all the chapters below.
17
18
h2. Toolchain installation
19
20
For RISC-V assembler test program compilation we use "GNU toolchain for RISC-V":https://github.com/riscv/riscv-gnu-toolchain. Get the toolchain's source code and switch to "rvv-0.7.1" branch:
21
<pre>
22
$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
23
$ cd riscv-gnu-toolchain
24
$ git checkout -b rvv-0.7.1 origin/rvv-0.7.1
25 5 Sergey Smolov
$ git submodule update --init --recursive
26 1 Sergey Smolov
</pre>
27
To complete the installation follow the "instruction":https://github.com/riscv/riscv-gnu-toolchain.
28
29
h2. Simulator installation
30
31 3 Sergey Smolov
For RISC-V test programs validation we use both QEMU4V and Spike simulators. "QEMU4V":https://forge.ispras.ru/projects/qemu4v is downloaded by project's scripts in a binary form, so there is no need to install it. However, *libjpeg62* package should be installed in your system for QEMU4V binary running.
32 1 Sergey Smolov
For Spike installation follow the "instruction":https://github.com/riscv/riscv-isa-sim. Note, that Spike must be installed in the same directory the toolchain has been installed (for example, "/opt/riscv").
33
34
h2. Test cases running
35
36
To run JUnit test cases enter the project directory and execute the following command:
37
<pre>
38
$ ./gradlew clean test
39
</pre>