summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-06-11 17:16:54 +0300
committerAndrei Golubev <andrei.golubev@qt.io>2020-06-18 18:28:41 +0300
commit68de38ded1c0e5387ae29aacaee50ba5dacfc59a (patch)
tree4bef76d45efcf52fcbebb862c353776b3b93cbd7 /tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
parentb0f445a1526fa43563522d865c5ad1546201003c (diff)
Document QPromise API
Documented QPromise. Added snippets under auto tests to ensure they are compiled and run in CI. Task-number: QTBUG-81586 Change-Id: I20084e38f9d2f6fc8540f95ee03ec3d2827177e8 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/corelib/thread/qpromise/tst_qpromise.cpp')
-rw-r--r--tests/auto/corelib/thread/qpromise/tst_qpromise.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
index 1e5864e59e..02c5b6a8bd 100644
--- a/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
+++ b/tests/auto/corelib/thread/qpromise/tst_qpromise.cpp
@@ -68,6 +68,11 @@ private slots:
void cancelWhenMoved();
void waitUntilResumed();
void waitUntilCanceled();
+
+ // snippets (external):
+ void snippet_basicExample();
+ void snippet_multithreadExample();
+ void snippet_suspendExample();
};
struct TrivialType { int field = 0; };
@@ -573,5 +578,22 @@ void tst_QPromise::waitUntilCanceled()
QCOMPARE(f.resultCount(), 0);
}
+// Below is a quick and dirty hack to make snippets a part of a test suite
+#include "snippet_qpromise.cpp"
+void tst_QPromise::snippet_basicExample()
+{
+ snippet_QPromise::basicExample();
+}
+
+void tst_QPromise::snippet_multithreadExample()
+{
+ snippet_QPromise::multithreadExample();
+}
+
+void tst_QPromise::snippet_suspendExample()
+{
+ snippet_QPromise::suspendExample();
+}
+
QTEST_MAIN(tst_QPromise)
#include "tst_qpromise.moc"