From 736163f02ec2904cc0ef17537ed3d841eef0443a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Albert=20=20Bab=C3=AD=20Oller?=
 <albert.babi@savoirfairelinux.com>
Date: Mon, 26 Oct 2020 08:51:43 -0400
Subject: [PATCH] Create Qt and QML testing tools

---
 Qt-and-QML-testing-tools.md | 58 +++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 Qt-and-QML-testing-tools.md

diff --git a/Qt-and-QML-testing-tools.md b/Qt-and-QML-testing-tools.md
new file mode 100644
index 00000000..e72575e5
--- /dev/null
+++ b/Qt-and-QML-testing-tools.md
@@ -0,0 +1,58 @@
+# C++
+
+## Google Test
+Google's c++ test framework.
+
+### Installation
+- Ubuntu / Debian:
+`apt install googletest libgtest-dev`
+
+## Example main.cpp
+```
+#include <gtest/gtest.h>
+
+TEST(Test, Test1)
+{
+    EXPECT_EQ(0, 0); // OK
+    EXPECT_EQ(1, 0); // ERROR and continues
+    ASSERT_EQ(0, 0); // OK
+    ASSERT_EQ(1, 0); // ERROR and stops execution
+}
+
+int main(int argc, char *argv[])
+{
+    ::testing::InitGoogleTest(&argc, argv);
+    return RUN_ALL_TESTS();  // Runs Test1 and any other included test
+}
+```
+
+# QML 
+
+## QtQuickTest
+
+### Installation
+- Ubuntu / Debian: `apt install qml-module-qqtest libqt5quicktest5` 
+
+- Example main.cpp
+```
+#include <QtQuickTest/quicktest.h>
+#include <QQmlEngine>
+
+class Setup : public QObject
+{
+    Q_OBJECT
+
+public:
+    Setup() {}
+
+public slots:
+
+    void qmlEngineAvailable(QQmlEngine *engine)
+    {
+        // Code to be run before the tests
+    }
+};
+
+QUICK_TEST_MAIN_WITH_SETUP(testqml, Setup)
+#include "main.moc"
+```
\ No newline at end of file
-- 
GitLab