Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ repos:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
additional_dependencies: [ ruamel.yaml>=0.15 ]
- id: debug-statements
- id: end-of-file-fixer
exclude: "tests/fixture/no_newline_file.txt"
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v21.1.2
Expand All @@ -21,23 +18,6 @@ repos:
rev: 1.4.3
hooks:
- id: cmakelint
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.16.0
hooks:
- id: reorder-python-imports
args: [--py310-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: v4.0.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/PyCQA/flake8
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
- repo: https://github.com/rhysd/actionlint
rev: v1.7.8
hooks:
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ auto main() -> int {
return Willow::runTests(
{
{"test_runTests", test_runTests},
{"test_alert", test_alert},
{"test_toString", test_toString},
{"test_Test_alert", test_Test_alert},
{"test_Test_Operator()", test_Test_Operator},
{"PreCommitReporter::print", TestPreCommitReporter::test_print},
{"PreCommitReporter::cleanup", TestPreCommitReporter::test_cleanup},
Expand Down
10 changes: 10 additions & 0 deletions src/tests/test_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ constexpr auto test_Test_Operator([[maybe_unused]] Willow::Test* test) -> int {

return !(t.retcode == 42);
}

constexpr auto test_Test_alert([[maybe_unused]] Willow::Test* test) -> int {
Willow::Test t {};
t.alert("fail");

if (t.msg.has_value() && t.msg.value() == "fail") {
return 0;
}
return 1;
}
10 changes: 0 additions & 10 deletions src/tests/test_willow.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ constexpr auto test_runTests([[maybe_unused]] Willow::Test* test) -> int {

return !(ret == 1);
}

constexpr auto test_alert([[maybe_unused]] Willow::Test* test) -> int {
Willow::Test t {};
Willow::alert(&t, "fail");

if (t.msg.has_value() && t.msg.value() == "fail") {
return 0;
}
return 1;
}
2 changes: 2 additions & 0 deletions src/willow/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace Willow {
: name {given_name}, fn {f}, status {st} {}

auto operator()() -> void { retcode = fn(this); }

constexpr auto alert(std::string message) -> void { msg = message; }
};
}; // namespace Willow

Expand Down
4 changes: 0 additions & 4 deletions src/willow/willow.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ namespace Willow {
}));
}

constexpr auto alert(Test* test, std::string message) -> void {
test->msg = message;
}

} // namespace Willow

#endif // WILLOW_H
Loading