Skip to content

Commit

Permalink
Add CI UT
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldwings committed Jun 6, 2024
1 parent 5c09cda commit 05fa7d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/ci.linux.x86-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=io_uring
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=epoll_ng
ctest -E test-lockfree --timeout 3600 -V
gcc921:
needs: gcc850
Expand Down Expand Up @@ -103,6 +105,8 @@ jobs:
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=io_uring
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=epoll_ng
ctest -E test-lockfree --timeout 3600 -V
gcc1031:
needs: gcc921
Expand Down Expand Up @@ -144,6 +148,8 @@ jobs:
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=io_uring
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=epoll_ng
ctest -E test-lockfree --timeout 3600 -V
gcc1121:
needs: gcc1031
Expand Down Expand Up @@ -185,6 +191,8 @@ jobs:
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=io_uring
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=epoll_ng
ctest -E test-lockfree --timeout 3600 -V
gcc1211:
needs: gcc1121
Expand Down Expand Up @@ -226,5 +234,7 @@ jobs:
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=io_uring
ctest -E test-lockfree --timeout 3600 -V
export PHOTON_CI_EV_ENGINE=epoll_ng
ctest -E test-lockfree --timeout 3600 -V
6 changes: 5 additions & 1 deletion test/ci-tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ static void parse_env_eng() {
_engine = photon::INIT_EVENT_IOURING;
} else if (strcmp(_engine_name, "kqueue") == 0) {
_engine = photon::INIT_EVENT_KQUEUE;
} else if (strcmp(_engine_name, "epoll_ng") == 0) {
_engine = photon::INIT_EVENT_EPOLL_NG;
} else {
printf("invalid event engine: %s\n", _engine_name);
_engine_name = nullptr;
Expand All @@ -39,6 +41,7 @@ static estring_view get_engine_name(uint64_t eng) {
case INIT_EVENT_KQUEUE: return "kqueue";
case INIT_EVENT_SELECT: return "select";
case INIT_EVENT_IOCP: return "iocp";
case INIT_EVENT_EPOLL_NG: return "epoll_ng";
}
return {};
}
Expand Down Expand Up @@ -66,7 +69,8 @@ int init(uint64_t event_engine, uint64_t io_engine, const PhotonOptions& options
LOG_INFO("enter CI overriden photon::init()");
const uint64_t all_engines = INIT_EVENT_EPOLL |
INIT_EVENT_IOURING | INIT_EVENT_KQUEUE |
INIT_EVENT_SELECT | INIT_EVENT_IOCP;
INIT_EVENT_SELECT | INIT_EVENT_IOCP |
INIT_EVENT_EPOLL_NG;
auto arg_specified = event_engine & all_engines;
LOG_INFO("argument specified: ` (`)", get_engine_names(arg_specified), arg_specified);
LOG_INFO("environment specified: '`'", _engine_name);
Expand Down

0 comments on commit 05fa7d2

Please sign in to comment.