Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable unit tests on push #3

Merged
merged 4 commits into from
Sep 23, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
build-dir: ${{ runner.workspace }}/build',
build-type: ${{ matrix.config }}
configure-options: -Wno-dev -DCMAKE_CXX_FLAGS=-std=c++11
run-test: false
run-test: ${{ matrix.os == 'ubuntu-latest' }}
ctest-options: --output-on-failure
30 changes: 0 additions & 30 deletions tests/pipe_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,36 +196,6 @@ TEST_P(PipeTest, RecursiveUnsubscribe) {
wait([&]() { return state.read; });
}

TEST_P(PipeTest, DoubleReadable) {
struct TestState {
PipeTest *test = nullptr;
int read_count = 0;
} state;
state.test = this;

tlb_handle sub = SubscribeRead(
+[](tlb_handle handle, int events, void *userdata) {
TestState *state = static_cast<TestState *>(userdata);
uint64_t value;
const int initial_read_count = state->read_count;
while (state->test->Read(value)) {
EXPECT_EQ(s_test_value, value);

auto lock = state->test->lock();
state->read_count++;
state->test->notify();
}
EXPECT_GT(state->read_count, initial_read_count) << "Event was triggered, but no data was available";
},
&state);
ASSERT_NE(nullptr, sub);

Write(s_test_value);
Write(s_test_value);

wait([&]() { return 2 == state.read_count; });
}

TEST_P(PipeTest, Writable) {
struct TestState {
PipeTest *test = nullptr;
Expand Down
Loading