feat(EditorConfig): Add .editorconfig files

This commit is contained in:
Jiří Štefka 2023-12-10 01:25:53 +01:00
parent 1f8dce3a86
commit 96477dfba3
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
12 changed files with 400 additions and 0 deletions

View file

@ -0,0 +1,17 @@
# Make an explicit list of all source files in `IFJ23_TESTS`. This is important
# because CMake is not a build system: it is a build system generator. Suppose
# you add a file foo.cpp to src/ after running cmake .. . If you set
# `IFJ23_TESTS` with `file(GLOB ... )`, this is not passed to the makefile;
# the makefile doesn't know that foo.cpp exists and will not re-run cmake. Your
# collaborator's builds will fail and it will be unclear why. Whether you use
# file(GLOB ...) or not, you will need to re-run cmake, but with an explicit
# file list, you know beforehand why your code isn't compiling.
set(TESTS
test.cpp
)
# Form the full path to the source files...
PREPEND(TESTS)
# ... and pass the variable to the parent scope.
set(TESTS ${TESTS} PARENT_SCOPE)

31
01/tests/src/test.cpp Normal file
View file

@ -0,0 +1,31 @@
#include <gtest/gtest.h>
#define TESTING
// Include the source file(s) to be tested.
#include "main.c"
// Create a test fixture class template - this will be like a "conlection" of
// tests. the : public ::testing::Test part is important! Add it to your fixture
// class.
class HelloTest : public ::testing::Test {
HelloTest() {}
~HelloTest() {}
void SetUp() {}
void TearDown() {}
};
// Add tests to the test fixture class.
// @param fixture_class_name The name of the test fixture class.
// @param test_name The name of the test.
TEST(HelloTest, BasicAssertions) {
// Execute the code to be tested.
// Expect two strings not to be equal.
EXPECT_STRNE("hello", "world");
// Expect equality.
EXPECT_EQ(7 * 6, 42);
}