diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-21 11:06:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-21 10:09:14 +0000 |
commit | 4630f179107a2b2548b68b3e7701c16ed2f8d52b (patch) | |
tree | 0fd353223ccc63ced2ebaefc60a478a843cfdc29 /sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp | |
parent | b0754eac872e4859db20df5dd2a5ece8b809a92c (diff) |
shiboken: Flip the default behavior the --api-version option
When no option was passed, all type system entries with a "since"
would be silently excluded. For example, the scriptable application
would only see Qt API that does not have a "since" attribute. This
could be fixed by adding version options for all dependent Qt
libraries it uses to the build steps, but this is tedious and
error-prone.
Flip the behavior such that an empty version list specification means
"latest".
Add helper functionality to clear the versions to the TypeDatabase
and use that in the tests to start out with a clean list.
Change the tests to use a QString for the version.
Add a test for the new behavior.
Task-number: PYSIDE-814
Change-Id: Ie6137ba6095ce562813bacbadbf4028d0e2c061f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp b/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp index 86bf64495..fc67ebba5 100644 --- a/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testabstractmetatype.cpp @@ -103,7 +103,8 @@ void TestAbstractMetaType::testApiVersionSupported() <function signature='justAtest2()' since='1.1'/>\n\ <function signature='justAtest3()'/>\n\ </typesystem>\n"; - QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false, "1.0")); + QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, + false, QLatin1String("1.0"))); QVERIFY(!builder.isNull()); AbstractMetaClassList classes = builder->classes(); @@ -121,7 +122,8 @@ void TestAbstractMetaType::testApiVersionNotSupported() const char* xmlCode = "<typesystem package='Foo'>\n\ <value-type name='object' since='0.1'/>\n\ </typesystem>\n"; - QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, true, "0.1")); + QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, + true, QLatin1String("0.1"))); QVERIFY(!builder.isNull()); AbstractMetaClassList classes = builder->classes(); |