Skip to content

Commit

Permalink
makes the usb test more conditional so the build will pass on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNotary committed Sep 10, 2024
1 parent 6c511e4 commit 7197f76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/env_setup_and_building.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ As that the project is my only repo demonstrating sourcing dependencies in a C++

#### Building on Terminal ("Developer Command Prompt")

Note: There's an integration test that can be enabled by setting the env variable "KEYBOARD_ATTACHED" to 1.

At the root of the repo, run:
```
# Skip these, they were for gitbash but there are pathing issues that ruined it
Expand Down
7 changes: 5 additions & 2 deletions test/keyboard_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "../src/demo/blink_loader.h"



namespace KeyboardTest
{
using namespace rk84;
Expand Down Expand Up @@ -77,7 +76,11 @@ namespace KeyboardTest
was_reasonable = true;

EXPECT_TRUE(was_reasonable);
EXPECT_EQ(list.size(), 1);

// Only do this if an KEYBOARD_ATTACHED is set to 1
const char* keyboardAttachedEnv = std::getenv("KEYBOARD_ATTACHED");

Check warning on line 81 in test/keyboard_test.cpp

View workflow job for this annotation

GitHub Actions / windows-latest-hosted-ninja-vcpkg_submod-autocache

'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
if (keyboardAttachedEnv != nullptr && std::string(keyboardAttachedEnv) == "1")
EXPECT_EQ(list.size(), 1);
}

}
Expand Down

0 comments on commit 7197f76

Please sign in to comment.