-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from WilliamYinwei/32bit
增加对C++测试用例的支持
- Loading branch information
Showing
124 changed files
with
2,910 additions
and
949 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
TEMPLATE = subdirs | ||
|
||
SUBDIRS += \ | ||
LocalSqlite | ||
LocalSqlite \ | ||
TestCppDemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# TestCppDemo | ||
C++测试用例样例 | ||
|
||
# 注意事项 | ||
* 与Python和JavaScript的测试工程一样,测试用例组件需要与后缀tp和tpx同文件名; | ||
* 编译TestCppDemo时依赖了TACppBase.lib | ||
* 开发完成生成TestCppDemo.dll后,发布时需要依赖DevLangCpp.dll,删除该测试工程的源代码; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#------------------------------------------------- | ||
# | ||
# Project created by QtCreator 2020-05-03T17:30:11 | ||
# | ||
#------------------------------------------------- | ||
|
||
QT -= gui | ||
|
||
TARGET = TestCppDemo | ||
TEMPLATE = lib | ||
|
||
DEFINES += TESTCPPDEMO_LIBRARY | ||
|
||
CONFIG(release, debug|release): DESTDIR = ../../bin | ||
CONFIG(debug, debug|release): DESTDIR = ../../bind | ||
|
||
INCLUDEPATH += ../../Libs/TACppBase | ||
LIBS += -L$$DESTDIR/libs/ -lTACppBase | ||
|
||
SOURCES += testcppdemo.cpp | ||
|
||
HEADERS += testcppdemo.h\ | ||
testcppdemo_global.h | ||
|
||
unix { | ||
target.path = /usr/lib | ||
INSTALLS += target | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"Desc": "demo", | ||
"Name": "testdemo", | ||
"Parameter": { | ||
"Name1": "gfedcba", | ||
"Name2": "abcdefg" | ||
}, | ||
"Public": { | ||
"Models": [ | ||
{ | ||
"Com": "TA_MsgBox.dll", | ||
"Obj": "ta" | ||
}, | ||
{ | ||
"Com": "Sleep.js", | ||
"Obj": "bb" | ||
} | ||
], | ||
"Parameter": [ | ||
{ | ||
"Desc": "asd", | ||
"Name": "Gabc", | ||
"Value": "123" | ||
}, | ||
{ | ||
"Desc": "111", | ||
"Name": "Gdd", | ||
"Value": "111" | ||
}, | ||
{ | ||
"Desc": "all of this", | ||
"Name": "Gall", | ||
"Value": "22.3" | ||
} | ||
] | ||
}, | ||
"TestSuite": [ | ||
{ | ||
"Desc": "suite2 test", | ||
"Name": "suite2", | ||
"Parameter": { | ||
"Name1": "2", | ||
"Name2": "2" | ||
}, | ||
"TestCase": [ | ||
{ | ||
"Desc": "描述2", | ||
"Name": "test2", | ||
"Parameter": { | ||
"Name1": "1", | ||
"Name2": "2" | ||
} | ||
}, | ||
{ | ||
"Desc": "描述1", | ||
"Name": "test1", | ||
"Parameter": { | ||
"Name1": "1", | ||
"Name2": "2" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"Desc": "suite1描述", | ||
"Name": "suite1", | ||
"Parameter": { | ||
"Name1": "2", | ||
"Name2": "2" | ||
}, | ||
"TestCase": [ | ||
{ | ||
"Desc": "描述1", | ||
"Name": "test1", | ||
"Parameter": { | ||
"Name1": "1", | ||
"Name2": "2" | ||
} | ||
}, | ||
{ | ||
"Desc": "描述2", | ||
"Name": "test2", | ||
"Parameter": { | ||
"Name1": "1", | ||
"Name2": "2" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"Ver": "1.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"BarCodeReg": "abc\\d{1}", | ||
"Desc": "It's demo test", | ||
"GUIPlugins": [ | ||
{ | ||
"Com": "GUI_TA_MsgBox.dll", | ||
"Name": "msg" | ||
} | ||
], | ||
"Instance": [ | ||
{ | ||
"File": "TestCppDemo.tp", | ||
"Name": "Demo11", | ||
"Parameter": [ | ||
{ | ||
"Desc": "asd", | ||
"Name": "Gabc", | ||
"Value": "123" | ||
}, | ||
{ | ||
"Desc": "111", | ||
"Name": "Gdd", | ||
"Value": "111" | ||
}, | ||
{ | ||
"Desc": "all of this", | ||
"Name": "Gall", | ||
"Value": "22.3" | ||
} | ||
] | ||
}, | ||
{ | ||
"File": "TestCppDemo.tp", | ||
"Name": "Demo2", | ||
"Parameter": [ | ||
{ | ||
"Desc": "asd", | ||
"Name": "Gabc", | ||
"Value": "123" | ||
}, | ||
{ | ||
"Desc": "111", | ||
"Name": "Gdd", | ||
"Value": "111" | ||
}, | ||
{ | ||
"Desc": "all of this", | ||
"Name": "Gall", | ||
"Value": "22.3" | ||
} | ||
] | ||
}, | ||
{ | ||
"File": "TestCppDemo.tp", | ||
"Name": "Demo3", | ||
"Parameter": [ | ||
{ | ||
"Desc": "asd", | ||
"Name": "Gabc", | ||
"Value": "123" | ||
}, | ||
{ | ||
"Desc": "111", | ||
"Name": "Gdd", | ||
"Value": "111" | ||
}, | ||
{ | ||
"Desc": "all of this", | ||
"Name": "Gall", | ||
"Value": "22.3" | ||
} | ||
] | ||
} | ||
], | ||
"LoopCount": 1, | ||
"Name": "TestDemos", | ||
"failedToStop": false, | ||
"stoppedForLoop": false | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/// | ||
/// @project TreeATE | ||
/// @brief This is test item sample class for cpp language | ||
/// @author David Yin 2020-05 willage.yin@163.com | ||
/// | ||
/// @license GNU LGPL v3 | ||
/// | ||
/// Distributed under the GNU LGPL v3 License | ||
/// (See accompanying file LICENSE or copy at | ||
/// http://www.gnu.org/licenses/lgpl-3.0.html) | ||
/// | ||
#include "testcppdemo.h" | ||
#include <QThread> | ||
|
||
void* CreateTestInst(const char *strValue) | ||
{ | ||
Q_UNUSED(strValue) | ||
return new TestCppDemo(); | ||
} | ||
|
||
TestCppDemo::TestCppDemo() | ||
{ | ||
} | ||
|
||
int TestCppDemo::setup_testdemo() | ||
{ | ||
OutputError("setup_testdemo中文"); | ||
|
||
QString name = GetProjectName(); | ||
OutputError("GetProjectName:" + name); | ||
QString ver = GetProjectVer(); | ||
OutputError("GetProjectVer:" + ver); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::teardown_testdemo() | ||
{ | ||
OutputError("teardown_testdemo"); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::setup_suite1() | ||
{ | ||
OutputError("setup_suite1"); | ||
QString ret = GetUserName(); | ||
OutputError("GetUserName:" + ret); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::teardown_suite1() | ||
{ | ||
OutputError("teardown_suite1"); | ||
QString ret = GetWorkLine(); | ||
OutputError("GetWorkLine:" + ret); | ||
ret = GetWorkStation(); | ||
OutputError("GetWorkStation:" + ret); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::setup_suite2() | ||
{ | ||
OutputError("setup_suite2"); | ||
QString ret = GetProjectBarcode(); | ||
OutputError("GetProjectBarcode:" + ret); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::teardown_suite2() | ||
{ | ||
OutputError("teardown_suite2"); | ||
QString ret = GetProjectDesc(); | ||
OutputError("GetProjectDesc:" + ret); | ||
QString rst = GetTotalRst(); | ||
OutputError("GetTotalRst:" + rst); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::test_test1() | ||
{ | ||
OutputError("test_test1"); | ||
|
||
for(int i = 0; i < 100; i++) { | ||
QThread::msleep(300); | ||
if(IsStopped()) { | ||
break; | ||
} | ||
} | ||
OutputRst(getParaValue("Name2"), getParaValue("Gabc"), "0"); | ||
return 0; | ||
} | ||
|
||
int TestCppDemo::test_test2() | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/// | ||
/// @project TreeATE | ||
/// @brief This is test item sample class for cpp language | ||
/// @author David Yin 2020-05 willage.yin@163.com | ||
/// | ||
/// @license GNU LGPL v3 | ||
/// | ||
/// Distributed under the GNU LGPL v3 License | ||
/// (See accompanying file LICENSE or copy at | ||
/// http://www.gnu.org/licenses/lgpl-3.0.html) | ||
/// | ||
#ifndef TESTCPPDEMO_H | ||
#define TESTCPPDEMO_H | ||
|
||
#include "testcppdemo_global.h" | ||
#include "tacppbase.h" | ||
|
||
extern "C" TESTCPPDEMOSHARED_EXPORT void* CreateTestInst(const char *strValue); | ||
|
||
class TESTCPPDEMOSHARED_EXPORT TestCppDemo : public TACppBase | ||
{ | ||
Q_OBJECT | ||
public: | ||
TestCppDemo(); | ||
|
||
public slots: | ||
int setup_testdemo(); | ||
int teardown_testdemo(); | ||
int setup_suite1(); | ||
int teardown_suite1(); | ||
int setup_suite2(); | ||
int teardown_suite2(); | ||
int test_test1(); | ||
int test_test2(); | ||
}; | ||
|
||
#endif // TESTCPPDEMO_H |
Oops, something went wrong.