Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed May 31, 2024
1 parent a58c2fd commit d62b4c1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions common/test/test_alog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ limitations under the License.
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include "../../test/ci-tools.h"

class LogOutputTest : public ILogOutput {
public:
Expand Down Expand Up @@ -575,6 +576,7 @@ TEST(ALOG, IPAddr) {

int main(int argc, char **argv)
{
if (!photon::is_using_default_engine()) return 0;
photon::vcpu_init();
DEFER(photon::vcpu_fini());
::testing::InitGoogleTest(&argc, argv);
Expand Down
7 changes: 1 addition & 6 deletions fs/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,12 +1369,7 @@ TEST(Walker, basic) {

int main(int argc, char **argv){
::testing::InitGoogleTest(&argc, argv);
#ifdef __linux__
int ev_engine = photon::INIT_EVENT_EPOLL;
#else
int ev_engine = photon::INIT_EVENT_KQUEUE;
#endif
if (photon::init(ev_engine, photon::INIT_IO_NONE))
if (photon::init(photon::INIT_EVENT_DEFAULT, photon::INIT_IO_NONE))
return -1;
DEFER(photon::fini());
int ret = RUN_ALL_TESTS();
Expand Down
2 changes: 2 additions & 0 deletions fs/test/test_throttledfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ limitations under the License.
#include <photon/thread/thread11.h>
#include <photon/thread/thread.h>
#include <photon/fs/localfs.h>
#include "../../test/ci-tools.h"

#include "mock.h"

Expand Down Expand Up @@ -433,6 +434,7 @@ TEST(ThrottledFs, concurrent){

int main(int argc, char **argv)
{
if (!photon::is_using_default_engine()) return 0;
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
LOG_ERROR_RETURN(0, ret, VALUE(ret));
Expand Down
7 changes: 4 additions & 3 deletions test/ci-tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ static void parse_env_eng() {
_engine = photon::INIT_EVENT_IOURING;
} else if (strcmp(_engine_name, "kqueue") == 0) {
_engine = photon::INIT_EVENT_KQUEUE;
} else {
printf("invalid event engine: %s\n", _engine_name);
_engine_name = nullptr;
exit(-1);
}
printf("invalid event engine: %s\n", _engine_name);
_engine_name = nullptr;
exit(-1);
}

static const char* get_engine_name(uint64_t eng) {
Expand Down
3 changes: 3 additions & 0 deletions thread/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ limitations under the License.
#include "../../photon.cpp"
#include "../common/identity-pool.cpp"
#include <photon/common/alog-audit.h>
#include "../../test/ci-tools.h"


using namespace std;
using namespace photon;
Expand Down Expand Up @@ -1894,6 +1896,7 @@ TEST(intrusive_list, split) {

int main(int argc, char** arg)
{
if (!photon::is_using_default_engine()) return 0;
::testing::InitGoogleTest(&argc, arg);
gflags::ParseCommandLineFlags(&argc, &arg, true);
default_audit_logger.log_output = log_output_stdout;
Expand Down

0 comments on commit d62b4c1

Please sign in to comment.