How to Install Touca on MXLinux Latest
Touca is a lightweight test automation and regression testing tool designed to simplify and accelerate the testing of embedded applications. In this tutorial, we will show you how to install Touca on MXLinux Latest.
Prerequisites
- A running instance of MXLinux Latest
- A user with sudo privileges
Step 1 - Install Dependencies
Before we can install Touca, we need to install the required dependencies:
Open a terminal window and enter the following command to update the package list:
$ sudo apt updateInstall the necessary packages by entering the following command:
$ sudo apt install cmake git build-essential libcurl4-openssl-dev libssl-dev uuid-dev
Step 2 - Clone the Touca Repository
We will now clone the Touca repository to our local machine:
Enter the following command in the terminal to clone the repository:
$ git clone https://github.com/trytouca/touca-cpp.gitChange to the newly created
touca-cppdirectory by entering the following command:$ cd touca-cpp
Step 3 - Build and Install Touca
We can now build and install Touca by following these steps:
Create a
builddirectory by entering the following command:$ mkdir build && cd buildGenerate the Makefile by entering the following command:
$ cmake ..To build Touca, enter the following command:
$ makeOnce the build is complete, install Touca by entering the following command:
$ sudo make installVerify the installation by entering the following command:
$ touca --version
If Touca was installed successfully, you will see the version number printed to the console.
Step 4 - Testing the Installation
We can now test the installation of Touca by following these steps:
Create a new directory:
$ mkdir touca-test && cd touca-testCreate a new file called
main.cppby entering the following command:$ touch main.cppAdd the following code to the
main.cppfile:#include "touca/touca.hpp" int main() { touca::initialize("myteam", "mytest", "myrevision"); touca::testcase("testcase1", []{ touca::check("testresult", "success"); touca::check("runtime", 42); }); touca::shutdown(); return 0; }Compile the
main.cppfile by entering the following command:$ g++ main.cpp -o touca-test $(touca-config --cflags --libs) -pthreadRun the
touca-testexecutable by entering the following command:$ ./touca-test
If the test was successful, you should see a message similar to the following:
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test case(s) run.
[ RUN ] testcase1
[ OK ] testcase1 (0 ms)
[----------] 1 test case(s) run.
[----------] Global test environment tear-down.
[==========] 1 test(s) run.
[ PASSED ] 1 test(s).
Test results sent to server
Congratulations! You have successfully installed and tested Touca on MXLinux Latest.
Conclusion
In this tutorial, we have shown you how to install Touca on MXLinux Latest. Touca is a powerful tool that can greatly simplify the testing of embedded applications, and we hope you find it useful in your future projects.