| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | #include "testqml.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-25 12:39:04 -07:00
										 |  |  | #include "core/settings/qPref.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | #include <QtQuickTest>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // main loosely copied from QUICK_TEST_MAIN_WITH_SETUP macro
 | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | int main(int argc, char **argv) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
 | 
					
						
							|  |  |  | 	return 0; | 
					
						
							|  |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | 	QTEST_ADD_GPU_BLACKLIST_SUPPORT | 
					
						
							|  |  |  | 	QTEST_SET_MAIN_SOURCE_PATH | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | 	QMLTestSetup setup; | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | 	// register C++ types and classes (but not objects)
 | 
					
						
							| 
									
										
										
										
											2018-09-04 11:18:43 +02:00
										 |  |  | 	qPref::instance()->registerQML(NULL); | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | 	return quick_test_main_with_setup(argc, argv, "TestQML", nullptr, &setup); | 
					
						
							|  |  |  | #endif //QT_VERSION
 | 
					
						
							| 
									
										
										
										
											2018-07-07 18:55:24 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2018-09-08 18:18:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | void QMLTestSetup::qmlEngineAvailable(QQmlEngine *engine) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	// register C++ objects (but not types and classes)
 | 
					
						
							|  |  |  | 	qPref::instance()->registerQML(engine); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 |