Skip to content

Commit

Permalink
Change tutorials to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman committed May 7, 2024
1 parent c24e1f7 commit 3175980
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 33 deletions.
113 changes: 105 additions & 8 deletions cupcake.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,108 @@
{"libraries": [{"name": "autocheck"}], "imports": [{"name": "gtest", "version": "1.14.0", "reference": "gtest/1.14.0", "file": "GTest", "targets": ["GTest::gtest_main", "GTest::gtest"], "groups": ["test"]}],
{
"project": {
"name": "autocheck"
},
"libraries": [
{
"name": "autocheck"
}
],
"imports": [
{
"name": "catch2",
"version": "3.6.0",
"reference": "catch2/3.6.0",
"file": "Catch2",
"targets": [
"Catch2::Catch2",
"Catch2::Catch2WithMain"
],
"groups": [
"test"
]
},
{
"name": "gtest",
"version": "1.14.0",
"reference": "gtest/1.14.0",
"file": "GTest",
"targets": [
"GTest::gtest_main",
"GTest::gtest"
],
"groups": [
"test"
]
}
],
"tests": [
{"name": "arbitrary", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "check", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "generator_combinators", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "generator", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "is_one_of", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "largest", "links": ["autocheck.libautocheck", "GTest::gtest_main"]},
{"name": "value", "links": ["autocheck.libautocheck", "GTest::gtest_main"]}
{
"name": "arbitrary",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "check",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "generator_combinators",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "generator",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "is_one_of",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "largest",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "value",
"links": [
"autocheck.libautocheck",
"GTest::gtest_main"
]
},
{
"name": "reverse",
"links": [
"${PROJECT_NAME}.libautocheck"
]
},
{
"name": "insert-sorted",
"links": [
"${PROJECT_NAME}.libautocheck"
]
},
{
"name": "factorial",
"links": [
"${PROJECT_NAME}.libautocheck",
"Catch2::Catch2WithMain"
]
}
]
}
5 changes: 2 additions & 3 deletions tutorial/factorial.cpp → tests/factorial.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>

#include <autocheck/sequence.hpp>
#include <autocheck/check.hpp>

std::size_t Factorial( const std::size_t number ) {
#define MAKE_IT_FAIL 1
#define MAKE_IT_FAIL 0
#if MAKE_IT_FAIL
return number <= 1 ? number : Factorial(number-1)*number;
#else
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions tutorial/CMakeLists.txt

This file was deleted.

0 comments on commit 3175980

Please sign in to comment.