Changeset View
Changeset View
Standalone View
Standalone View
tests/auto/qmljsc/testpurejavascriptgenerator_integration.cpp
Show All 12 Lines | |||||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. | ||
15 | * | 15 | * | ||
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
18 | * | 18 | * | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "../../../src/qmljsc/purejavascriptgenerator.h" | 21 | #include "../../../src/qmljsc/codegeneration/purejavascriptgenerator.h" | ||
22 | 22 | | |||
23 | #include <QtCore/QMetaType> | 23 | #include <QtCore/QMetaType> | ||
24 | #include <QtTest/QTest> | 24 | #include <QtTest/QTest> | ||
25 | #include <QtCore/QFile> | 25 | #include <QtCore/QFile> | ||
26 | 26 | | |||
27 | #include <private/qqmljsast_p.h> | 27 | #include <private/qqmljsast_p.h> | ||
28 | #include <private/qqmljsengine_p.h> | 28 | #include <private/qqmljsengine_p.h> | ||
29 | #include <private/qqmljslexer_p.h> | 29 | #include <private/qqmljslexer_p.h> | ||
30 | #include <private/qqmljsparser_p.h> | 30 | #include <private/qqmljsparser_p.h> | ||
31 | 31 | | |||
32 | Q_DECLARE_METATYPE(QQmlJS::AST::Node*) | 32 | Q_DECLARE_METATYPE(QQmlJS::AST::Node*) | ||
33 | 33 | | |||
34 | namespace QmlJSc { | ||||
35 | | ||||
34 | class TestPureJavaScriptGeneratorIntegration | 36 | class TestPureJavaScriptGeneratorIntegration | ||
35 | : public QObject | 37 | : public QObject | ||
36 | { | 38 | { | ||
37 | Q_OBJECT | 39 | Q_OBJECT | ||
38 | 40 | | |||
39 | private: | 41 | private: | ||
40 | QQmlJS::AST::Node* astForFile(QString fileName) { | 42 | QQmlJS::AST::Node* astForFile(QString fileName) { | ||
41 | QString input = fileContent(fileName); | 43 | QString input = fileContent(fileName); | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 102 | void test_compileJavaScriptFile() { | |||
110 | // Verify | 112 | // Verify | ||
111 | QCOMPARE(generator.getGeneratedCode(), expectedOutput); | 113 | QCOMPARE(generator.getGeneratedCode(), expectedOutput); | ||
112 | } | 114 | } | ||
113 | 115 | | |||
114 | 116 | | |||
115 | 117 | | |||
116 | }; | 118 | }; | ||
117 | 119 | | |||
118 | QTEST_MAIN(TestPureJavaScriptGeneratorIntegration) | 120 | } // namespace QmlJSc | ||
121 | | ||||
122 | QTEST_MAIN(QmlJSc::TestPureJavaScriptGeneratorIntegration) | ||||
119 | #include "testpurejavascriptgenerator_integration.moc" | 123 | #include "testpurejavascriptgenerator_integration.moc" |