Skip to content

Commit be57a8a

Browse files
committed
test: skip POSIX-shell suites on Windows
Hook, mcp-stdio, monitor, loop-scheduler and runner tests require /bin/bash; QSKIP them on Q_OS_WIN instead of failing the build. Signed-off-by: Huang Rui <vowstar@gmail.com>
1 parent b5ccc91 commit be57a8a

5 files changed

Lines changed: 23 additions & 1 deletion

File tree

test/test_qsochookmanager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class Test : public QObject
5959
private slots:
6060
void initTestCase()
6161
{
62+
#ifdef Q_OS_WIN
63+
QSKIP("requires a POSIX shell (/bin/bash); not supported on Windows");
64+
#endif
6265
static auto argc = 1;
6366
static char appName[] = "qsoc_test";
6467
static std::array<char *, 1> argv = {{appName}};

test/test_qsochookrunner.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class Test : public QObject
4545
private slots:
4646
void initTestCase()
4747
{
48+
#ifdef Q_OS_WIN
49+
QSKIP("requires a POSIX shell (/bin/bash); not supported on Windows");
50+
#endif
4851
static auto argc = 1;
4952
static char appName[] = "qsoc_test";
5053
static std::array<char *, 1> argv = {{appName}};

test/test_qsocloopscheduler.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class TestQSocLoopScheduler : public QObject
7272
Q_OBJECT
7373

7474
private slots:
75-
void initTestCase() { TestApp::instance(); }
75+
void initTestCase()
76+
{
77+
TestApp::instance();
78+
#ifdef Q_OS_WIN
79+
QSKIP("requires a POSIX shell (/bin/bash); not supported on Windows");
80+
#endif
81+
}
7682

7783
/* ---- parseLoopArgs (cron-based) ---- */
7884

test/test_qsocmcpstdio.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class Test : public QObject
6464
private slots:
6565
void initTestCase()
6666
{
67+
#ifdef Q_OS_WIN
68+
QSKIP("requires a POSIX shell (/bin/bash); not supported on Windows");
69+
#endif
6770
static auto argc = 1;
6871
static char appName[] = "qsoc_test";
6972
static std::array<char *, 1> argv = {{appName}};

test/test_qsocmonitortasksource.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class Test : public QObject
2727
Q_OBJECT
2828

2929
private slots:
30+
void initTestCase()
31+
{
32+
#ifdef Q_OS_WIN
33+
QSKIP("requires a POSIX shell (/bin/bash); not supported on Windows");
34+
#endif
35+
}
36+
3037
void localMonitorEmitsLineEventsAndCompletion()
3138
{
3239
QSocTaskEventQueue queue;

0 commit comments

Comments
 (0)