How to run JUnit tests » History » Revision 4
Revision 3 (Sergey Smolov, 10/22/2019 05:26 PM) → Revision 4/7 (Sergey Smolov, 10/25/2019 01:16 PM)
h1. Template-based How to run JUnit test cases tests h2. Prerequisites 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. h2. Introduction 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: * 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; * Test program compilation into binary image; * Test program binary image simulation on "QEMU4V":https://forge.ispras.ru/projects/qemu4v (simulation log file is produced); * Test program binary image simulation on "Spike":https://github.com/riscv/riscv-isa-sim (simulation log file is produced); * MicroTESK and QEMU4V log comparison by "Trace Matcher":https://forge.ispras.ru/projects/traceutils tool. 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. h2. Toolchain installation 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: <pre> $ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain $ cd riscv-gnu-toolchain $ git checkout -b rvv-0.7.1 origin/rvv-0.7.1 </pre> To complete the installation follow the "instruction":https://github.com/riscv/riscv-gnu-toolchain. h2. Simulator installation 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. 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"). h2. Test cases running To run JUnit test cases enter the project directory and execute the following command: <pre> $ ./gradlew clean test </pre>