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.
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 update
Install the necessary packages by entering the following command:
$ sudo apt install cmake git build-essential libcurl4-openssl-dev libssl-dev uuid-dev
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.git
Change to the newly created touca-cpp
directory by entering the following command:
$ cd touca-cpp
We can now build and install Touca by following these steps:
Create a build
directory by entering the following command:
$ mkdir build && cd build
Generate the Makefile by entering the following command:
$ cmake ..
To build Touca, enter the following command:
$ make
Once the build is complete, install Touca by entering the following command:
$ sudo make install
Verify the installation by entering the following command:
$ touca --version
If Touca was installed successfully, you will see the version number printed to the console.
We can now test the installation of Touca by following these steps:
Create a new directory:
$ mkdir touca-test && cd touca-test
Create a new file called main.cpp
by entering the following command:
$ touch main.cpp
Add the following code to the main.cpp
file:
#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.cpp
file by entering the following command:
$ g++ main.cpp -o touca-test $(touca-config --cflags --libs) -pthread
Run the touca-test
executable 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.
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.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!