Skip to content

Migrate tests from CxxTest to Google Test - #4

Open
koplyarov with Copilot wants to merge 4 commits into
masterfrom
copilot/migrate-tests-to-google-test
Open

Migrate tests from CxxTest to Google Test#4
koplyarov with Copilot wants to merge 4 commits into
masterfrom
copilot/migrate-tests-to-google-test

Conversation

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

The test suite was built on CxxTest, which requires a code-generation step and a separate tool installation. This migrates to Google Test — a more widely adopted framework with no codegen requirement.

Key changes

  • src/test/api_v1_test.cpp (new): 27 tests ported from CxxTest::TestSuite static methods to TEST(WigwagApiV1Test, ...) macros. CxxTest assertion macros replaced with GTest equivalents:

    CxxTest GTest
    TS_ASSERT_EQUALS(a, b) EXPECT_EQ(a, b)
    TS_ASSERT(x) EXPECT_TRUE(x)
    TS_ASSERT_THROWS(e, T) EXPECT_THROW(e, T)
    TS_ASSERT_THROWS_NOTHING(e) EXPECT_NO_THROW(e)
    TS_ASSERT_THROWS_ANYTHING(e) EXPECT_ANY_THROW(e)
    TS_ASSERT_LESS_THAN_EQUALS(a, b) EXPECT_LE(a, b)
    TS_ASSERT_DIFFERS(a, b) EXPECT_NE(a, b)

    Note: wigwag::signal<> is fully qualified throughout because GTest includes <csignal>, making unqualified signal ambiguous with the C signal() function.

  • src/test/utils/thread.hpp: TS_FAIL(msg)ADD_FAILURE() << msg; added <gtest/gtest.h>.

  • CMakeLists.txt: find_package(CxxTest) / CXXTEST_ADD_TEST replaced with find_package(GTest) / add_executable + GTest::GTest GTest::Main. C++ standard bumped C++11 → C++14 (minimum required by GTest 1.14).

  • .github/workflows/run_tests.yml: cxxtest apt package replaced with libgtest-dev.

  • src/test/api_v1_test.hpp: Cleared; tests now live in the .cpp file.

Copilot AI and others added 4 commits April 22, 2026 21:37
Agent-Logs-Url: https://github.com/koplyarov/wigwag/sessions/14af2aaf-b4c7-4fbd-9fb9-214d454f7476

Co-authored-by: koplyarov <2735681+koplyarov@users.noreply.github.com>
… using declarations

Agent-Logs-Url: https://github.com/koplyarov/wigwag/sessions/14af2aaf-b4c7-4fbd-9fb9-214d454f7476

Co-authored-by: koplyarov <2735681+koplyarov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants