Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unit test setup #687

Merged
merged 8 commits into from
Jun 25, 2019
Merged

unit test setup #687

merged 8 commits into from
Jun 25, 2019

Conversation

fntlnz
Copy link
Contributor

@fntlnz fntlnz commented Jun 25, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support to use catch2 as a testing framework, initially it allows only to test falco_engine but it will be expanded to other areas as soon as we extract functionalities into libraries.

There's no actual tests in this PR since this one is to setup the environment that will then be used in other PRs checking in the tests.

Here's how a unit test will look like:

#include <catch.hpp>

using namespace std;
using Catch::Matchers::Equals;

TEST_CASE("someFunction check if false is false") {
    REQUIRE_FALSE(false);
}

Tests will be organized under the tests folder.

For example, falco_engine tests will go under tests/engine using the same structure as for userspace.

For every other type of assertion and details, refer to the the catch2 documentation.

Which issue(s) this PR fixes:

Fixes #686

Special notes for your reviewer:
image

Does this PR introduce a user-facing change?:

new: unit test setup

fntlnz and others added 3 commits June 25, 2019 10:32
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
@leodido
Copy link
Member

leodido commented Jun 25, 2019

/hold
I propose to hold it until we integrate them in Travis.

fntlnz and others added 5 commits June 25, 2019 10:55
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Co-authored-by: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
@poiana poiana added the lgtm label Jun 25, 2019
@poiana
Copy link
Contributor

poiana commented Jun 25, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leodido

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link
Contributor

poiana commented Jun 25, 2019

LGTM label has been added.

Git tree hash: 01cc25da86d7eecea8dd41ecfef828caa2171488

@leodido leodido merged commit 93537cc into dev Jun 25, 2019
@poiana poiana deleted the feat/unit-test-setup branch June 25, 2019 15:01
@fntlnz fntlnz changed the title wip: unit test setup unit test setup Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit test setup
3 participants