You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/user-guide/test/index.md
+13-20Lines changed: 13 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Let's test the Blog model code that we made in the [tutorial](/user-guide/en/tut
20
20
```
21
21
22
22
We will try to create the test case for creating and reading of the Blog model.<br>
23
-
For example, let's set the name of the implementing test as follows: *TestBlog*. The source code with the following content is saved as a file named *testBlog.cpp*.
23
+
For example, let's set the name of the implementing test as follows: *TestBlog*. The source code with the following content is saved as a file named *testblog.cpp*.
24
24
25
25
```c++
26
26
#include<TfTest/TfTest>
@@ -83,9 +83,9 @@ Next, create a project file to make the *Makefile*. The file name is *testblog.p
83
83
```
84
84
TARGET = testblog
85
85
TEMPLATE = app
86
-
CONFIG += console debug qtestlib
86
+
CONFIG += console debug c++11
87
87
CONFIG -= app_bundle
88
-
QT += network sql
88
+
QT += network sql testlib
89
89
QT -= gui
90
90
DEFINES += TF_DLL
91
91
INCLUDEPATH += ../..
@@ -94,12 +94,6 @@ Next, create a project file to make the *Makefile*. The file name is *testblog.p
94
94
SOURCES = testblog.cpp # Specifying the file name
95
95
```
96
96
97
-
Part of the specification has changed after the update to Qt5. If you are using Qt5, please change the 5th line of the above as the following.
98
-
99
-
```
100
-
QT += network sql testlib
101
-
```
102
-
103
97
After you save the project file, you can create a binary by running the following command in its directory:
104
98
105
99
```
@@ -154,12 +148,11 @@ The configuration is now complete. Next, the test needs to be executed. If the t
154
148
155
149
```
156
150
$ ./testblog
157
-
********* Start testing of TestBlog *********
158
-
Config: Using QTest library 4.8.3, Qt 4.8.3
151
+
Config: Using QtTest library 5.5.1, Qt 5.5.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609)
Make a test case for each each model. Then please do the test. The key to a good Web application development is to be sure that the model is working properly.
175
+
Make a test case for each each model. Then please do the test. The key to a good Web application development is to be sure that the model is working properly.
0 commit comments