Skip to content

Commit

Permalink
fix(cxx): tests are not be executed
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Sep 6, 2024
1 parent 8b11c1f commit 1a0af6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions template/cxx/{{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ build:
run:
@./build/bin/$(APP_NAME)

# test
test:
@./build/bin/$(APP_NAME)-tests

# build image
image:
@docker image build -t $(APP_NAME) .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include "gtest/gtest.h"
#include "my_lib.h"

int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

TEST(AddTest, PositiveNumbers)
{
EXPECT_EQ(add(1, 2), 3);
Expand Down
3 changes: 0 additions & 3 deletions template/cxx/{{cookiecutter.project_slug}}/tests/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ target("{{cookiecutter.project_slug}}-tests")
add_files("*.cpp")
add_deps("{{cookiecutter.package_name}}_lib")
add_packages("gtest")

-- Add test rule
add_rules("test")

0 comments on commit 1a0af6b

Please sign in to comment.