Template-based JUnit test cases¶
This instruction is suitable for those developers of 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.
1. Introduction¶The MicroTESK project contains a collection of JUnit test cases. Some of them (for example, MiniMIPS and x86 architecture related) consist of the following steps:
- Assembler test program and MicroTESK simulator log generation from the Ruby test template and nML specifications;
- Test program compilation into binary image;
- Test program binary image emulation on QEMU4V (simulation log file is produced);
For all the steps of JUnit test cases to be accomplished, several auxiliary tools are used and several settings should be done.
For JUnit tests running you should have an access to Nexus Repository Manager 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.
3. x86 toolchain installation¶For x86 assembler test programs compilation we use both GCC and nasm in different JUnit test cases. To install these toolchains, do the following:
$ sudo apt install gcc nasm
To complete the installation:
- Set NASM_TCHAIN system\environment variable to the path to the directory, that contains bin sub-directory with '*nasm' binary (for example, "/usr").
- Set X86_GNU_TCHAIN system\environment variable to the path to the directory, that contains bin sub-directory with GCC binaries (for example, "/usr").
4. MiniMIPS toolchain installation¶
For MiniMIPS assembler test programs compilation we use MIPS64 Linux GNU toolchain. To install it, do the following:
$ sudo apt install gcc-mips-linux-gnu
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").
5. Emulator installation¶
For MiniMIPS and x86 test programs validation we use QEMU4V emulator. 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.
6. Test cases running¶
To run JUnit test cases, enter the project directory and execute the following command:
$ ./gradlew clean test
To run the specific JUnit test case, enter the project directory and execute the following command:
$ ./gradlew clean test --tests "here.should.be.full.reference.to.class.TestCase"