Skip to content

Commit

Permalink
🎨 (functional): Move utils in tests namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Jul 10, 2024
1 parent f8bd18c commit efb7e34
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 58 deletions.
1 change: 1 addition & 0 deletions tests/functional/include/tests/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace ut = boost::ut;
namespace cfg {

using namespace std::literals;
using namespace tests;

namespace output {

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/include/tests/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "LogKit.h"

namespace utils {
namespace tests::utils {

namespace time {

Expand Down Expand Up @@ -56,4 +56,4 @@ namespace sd {

} // namespace sd

} // namespace utils
} // namespace tests::utils
4 changes: 2 additions & 2 deletions tests/functional/include/tests/utils_sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

using namespace std::chrono;

namespace utils::sleep {
namespace tests::utils::sleep {

constexpr inline auto SERIAL_FLUSH_TIME_MS = 150ms;
constexpr inline auto US_PER_S = 1'000'000;
Expand Down Expand Up @@ -119,4 +119,4 @@ inline auto system_deep_sleep_check() -> deep_sleep_status_t
return {can_deep_sleep, can_deep_sleep_test_check};
}

} // namespace utils::sleep
} // namespace tests::utils::sleep
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ suite suite_core_buffered_serial = [] {
scenario("base system check") = [] {
given("serial is not instantiated") = [] {
then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -35,7 +35,7 @@ suite suite_core_buffered_serial = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -53,7 +53,7 @@ suite suite_core_buffered_serial = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -65,7 +65,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -77,7 +77,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -89,7 +89,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -101,7 +101,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -113,7 +113,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -125,7 +125,7 @@ suite suite_core_buffered_serial = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/tests/deep_sleep_core_lcd/suite_core_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ suite suite_core_lcd = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -71,7 +71,7 @@ suite suite_core_lcd = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -83,7 +83,7 @@ suite suite_core_lcd = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -95,7 +95,7 @@ suite suite_core_lcd = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -107,7 +107,7 @@ suite suite_core_lcd = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ suite suite_core_motor = [] {
scenario("base system check") = [] {
given("motor is not instantiated") = [] {
then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -37,7 +37,7 @@ suite suite_core_motor = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -58,7 +58,7 @@ suite suite_core_motor = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -70,7 +70,7 @@ suite suite_core_motor = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -82,7 +82,7 @@ suite suite_core_motor = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -94,7 +94,7 @@ suite suite_core_motor = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -106,7 +106,7 @@ suite suite_core_motor = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand Down
18 changes: 9 additions & 9 deletions tests/functional/tests/deep_sleep_core_pwm/suite_core_pwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ suite suite_core_pwm = [] {
scenario("base system check") = [] {
given("pwm is not instantiated") = [] {
then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -35,7 +35,7 @@ suite suite_core_pwm = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -53,7 +53,7 @@ suite suite_core_pwm = [] {

when("I do nothing") = [&] {
then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -65,7 +65,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -77,7 +77,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -89,7 +89,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -101,7 +101,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -113,7 +113,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -125,7 +125,7 @@ suite suite_core_pwm = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep TO NOT BE possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/tests/deep_sleep_log_kit/suite_log_kit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ suite suite_log_kit = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep to be possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand All @@ -35,7 +35,7 @@ suite suite_log_kit = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep to NOT be possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(not status.test_check_ok);
};
Expand All @@ -49,7 +49,7 @@ suite suite_log_kit = [] {
rtos::ThisThread::sleep_for(500ms);

then("I expect deep sleep to NOT be possible") = [] {
auto status = utils::sleep::system_deep_sleep_check();
auto status = tests::utils::sleep::system_deep_sleep_check();

expect(status.test_check_ok);
};
Expand Down
Loading

0 comments on commit efb7e34

Please sign in to comment.