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

Step 1 - Install Dependencies

Before we can install Touca, we need to install the required dependencies:

  1. Open a terminal window and enter the following command to update the package list:

    $ sudo apt update

  2. Install 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:

  1. Enter the following command in the terminal to clone the repository:

    $ git clone https://github.com/trytouca/touca-cpp.git

  2. Change to the newly created touca-cpp directory 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:

  1. Create a build directory by entering the following command:

    $ mkdir build && cd build

  2. Generate the Makefile by entering the following command:

    $ cmake ..

  3. To build Touca, enter the following command:

    $ make

  4. Once the build is complete, install Touca by entering the following command:

    $ sudo make install

  5. 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.

Step 4 - Testing the Installation

We can now test the installation of Touca by following these steps:

  1. Create a new directory:

    $ mkdir touca-test && cd touca-test

  2. Create a new file called main.cpp by entering the following command:

    $ touch main.cpp

  3. 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;
    }
    
  4. Compile the main.cpp file by entering the following command:

    $ g++ main.cpp -o touca-test $(touca-config --cflags --libs) -pthread
    
  5. 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.

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.

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!