Template-based JUnit test cases » History » Version 1
Sergey Smolov, 10/25/2019 01:14 PM
1 | 1 | Sergey Smolov | h1. Template-based JUnit test cases |
---|---|---|---|
2 | |||
3 | This instruction is suitable for those developers of "MicroTESK":https://forge.ispras.ru/projects/microtesk 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 Linux package names that are mentioned here are correct for Ubuntu-based distros and may differ in other OS. |
||
4 | |||
5 | h2. 1. Introduction |
||
6 | |||
7 | The "MicroTESK":https://forge.ispras.ru/projects/microtesk project contains a collection of JUnit test cases. Some of them (for example, MiniMIPS and x86 architecture related) consist of the following steps: |
||
8 | * 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; |
||
9 | * Test program compilation into binary image; |
||
10 | * Test program binary image emulation on "QEMU4V":https://forge.ispras.ru/projects/qemu4v (simulation log file is produced); |
||
11 | |||
12 | For all the steps of JUnit test cases to be accomplished, several auxiliary tools are used and several settings should be done. |
||
13 | |||
14 | h2. 2. Prerequisites |
||
15 | |||
16 | 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. |
||
17 | |||
18 | h2. 3. x86 toolchain installation |
||
19 | |||
20 | For x86 assembler test programs compilation we use both GCC and nasm in different JUnit test cases. To install these toolchains, do the following: |
||
21 | <pre> |
||
22 | $ sudo apt install gcc nasm |
||
23 | </pre> |
||
24 | To complete the installation: |
||
25 | # Set *NASM_TCHAIN* system\environment variable to the path to the directory, that contains _bin_ sub-directory with '*nasm' binary (for example, "/usr"). |
||
26 | # Set *X86_GNU_TCHAIN* system\environment variable to the path to the directory, that contains _bin_ sub-directory with GCC binaries (for example, "/usr"). |
||
27 | |||
28 | h2. 4. MiniMIPS toolchain installation |
||
29 | |||
30 | For MiniMIPS assembler test programs compilation we use MIPS64 Linux GNU toolchain. To install it, do the following: |
||
31 | <pre> |
||
32 | $ sudo apt install gcc-mips-linux-gnu |
||
33 | </pre> |
||
34 | To complete the installation, set *MIPS64_TCHAIN* system\environment variable to the path to the directory, that contains _bin_ sub-directory with toolchain binaries (for example, "/usr"). |
||
35 | |||
36 | h2. 5. Emulator installation |
||
37 | |||
38 | For MiniMIPS and x86 test programs validation we use QEMU4V emulator. "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. |
||
39 | |||
40 | h2. 6. Test cases running |
||
41 | |||
42 | To run JUnit test cases, enter the project directory and execute the following command: |
||
43 | <pre> |
||
44 | $ ./gradlew clean test |
||
45 | </pre> |
||
46 | |||
47 | To run the specific JUnit test case, enter the project directory and execute the following command: |
||
48 | <pre> |
||
49 | $ ./gradlew clean test --tests "here.should.be.full.reference.to.class.TestCase" |
||
50 | </pre> |