diff --git a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
index f5d06b3de958440aadd8854f01d92138687af3e2..5c6c56e3896d2a1bb4368217f40f3031fc56ea53 100644
--- a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
@@ -5,7 +5,7 @@ SUBDIRS	=	lib \
                 theplugin \
 		tst
 !android: !win32: !mac: SUBDIRS += almostplugin
-macx-*: SUBDIRS += machtest
+macx-*: contains(QT_CONFIG, private_tests): SUBDIRS += machtest
 TARGET = tst_qpluginloader
 
 # no special install rule for subdir