diff options
Diffstat (limited to 'tests/auto/blackbox')
455 files changed, 2628 insertions, 1057 deletions
diff --git a/tests/auto/blackbox/blackbox-android.pro b/tests/auto/blackbox/blackbox-android.pro index d27550301..7aca99e8d 100644 --- a/tests/auto/blackbox/blackbox-android.pro +++ b/tests/auto/blackbox/blackbox-android.pro @@ -16,3 +16,6 @@ for(data_dir, DATA_DIRS) { } OTHER_FILES += $$FILES + +DISTFILES += \ + testdata/texttemplate/expected-output-one.txt diff --git a/tests/auto/blackbox/blackbox-android.qbs b/tests/auto/blackbox/blackbox-android.qbs index 068322cf9..ca7d429ef 100644 --- a/tests/auto/blackbox/blackbox-android.qbs +++ b/tests/auto/blackbox/blackbox-android.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/blackbox-apple.qbs b/tests/auto/blackbox/blackbox-apple.qbs index 8137aec82..6cc946d12 100644 --- a/tests/auto/blackbox/blackbox-apple.qbs +++ b/tests/auto/blackbox/blackbox-apple.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/blackbox-clangdb.qbs b/tests/auto/blackbox/blackbox-clangdb.qbs index 359fad1db..38118309f 100644 --- a/tests/auto/blackbox/blackbox-clangdb.qbs +++ b/tests/auto/blackbox/blackbox-clangdb.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/blackbox-java.qbs b/tests/auto/blackbox/blackbox-java.qbs index b75a5f168..6c56b3d18 100644 --- a/tests/auto/blackbox/blackbox-java.qbs +++ b/tests/auto/blackbox/blackbox-java.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/blackbox-joblimits.pro b/tests/auto/blackbox/blackbox-joblimits.pro new file mode 100644 index 000000000..85413473e --- /dev/null +++ b/tests/auto/blackbox/blackbox-joblimits.pro @@ -0,0 +1,18 @@ +TARGET = tst_blackbox-joblimits + +HEADERS = tst_blackboxbase.h +SOURCES = tst_blackboxjoblimits.cpp tst_blackboxbase.cpp +OBJECTS_DIR = joblimits +MOC_DIR = $${OBJECTS_DIR}-moc + +include(../auto.pri) + +DATA_DIRS = testdata-joblimits ../find + +for(data_dir, DATA_DIRS) { + files = $$files($$PWD/$$data_dir/*, true) + win32:files ~= s|\\\\|/|g + for(file, files):!exists($$file/*):FILES += $$file +} + +OTHER_FILES += $$FILES diff --git a/tests/auto/blackbox/blackbox-joblimits.qbs b/tests/auto/blackbox/blackbox-joblimits.qbs new file mode 100644 index 000000000..857e1de7f --- /dev/null +++ b/tests/auto/blackbox/blackbox-joblimits.qbs @@ -0,0 +1,20 @@ +import qbs.Utilities + +QbsAutotest { + testName: "blackbox-joblimits" + Depends { name: "qbs_app" } + Depends { name: "qbs-setup-toolchains" } + Group { + name: "testdata" + prefix: "testdata-joblimits/" + files: ["**/*"] + fileTags: [] + } + files: [ + "../shared.h", + "tst_blackboxbase.cpp", + "tst_blackboxbase.h", + "tst_blackboxjoblimits.cpp", + ] + cpp.defines: base.concat(["SRCDIR=" + Utilities.cStringQuote(path)]) +} diff --git a/tests/auto/blackbox/blackbox-qt.qbs b/tests/auto/blackbox/blackbox-qt.qbs index ad473f731..a25221dc9 100644 --- a/tests/auto/blackbox/blackbox-qt.qbs +++ b/tests/auto/blackbox/blackbox-qt.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/blackbox.qbs b/tests/auto/blackbox/blackbox.qbs index 917e8345b..3f0ff959a 100644 --- a/tests/auto/blackbox/blackbox.qbs +++ b/tests/auto/blackbox/blackbox.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities QbsAutotest { diff --git a/tests/auto/blackbox/find/find-android.qbs b/tests/auto/blackbox/find/find-android.qbs index 5a28b0560..26dedc60f 100644 --- a/tests/auto/blackbox/find/find-android.qbs +++ b/tests/auto/blackbox/find/find-android.qbs @@ -1,8 +1,8 @@ -import qbs import qbs.TextFile Product { property string packageName: "" + qbs.targetPlatform: "android" Depends { name: "Android.sdk"; required: false } Depends { name: "Android.ndk"; required: false } diff --git a/tests/auto/blackbox/find/find-jdk.qbs b/tests/auto/blackbox/find/find-jdk.qbs index 411569f23..81d84fa20 100644 --- a/tests/auto/blackbox/find/find-jdk.qbs +++ b/tests/auto/blackbox/find/find-jdk.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/find/find-nodejs.qbs b/tests/auto/blackbox/find/find-nodejs.qbs index d8b555ecd..c63d40c81 100644 --- a/tests/auto/blackbox/find/find-nodejs.qbs +++ b/tests/auto/blackbox/find/find-nodejs.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/find/find-typescript.qbs b/tests/auto/blackbox/find/find-typescript.qbs index df2f86a84..18ca0c5cc 100644 --- a/tests/auto/blackbox/find/find-typescript.qbs +++ b/tests/auto/blackbox/find/find-typescript.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/find/find-xcode.qbs b/tests/auto/blackbox/find/find-xcode.qbs index b42b2deb7..bb6ee9718 100644 --- a/tests/auto/blackbox/find/find-xcode.qbs +++ b/tests/auto/blackbox/find/find-xcode.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata-android/aidl/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/aidl/AndroidManifest.xml new file mode 100644 index 000000000..e8a950847 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/aidl/AndroidManifest.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="io.qbs.aidltest"> + <application android:label="AidlTest"> + <activity android:name="MainActivity"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/tests/auto/blackbox/testdata-android/aidl/aidl.qbs b/tests/auto/blackbox/testdata-android/aidl/aidl.qbs new file mode 100644 index 000000000..6e827099f --- /dev/null +++ b/tests/auto/blackbox/testdata-android/aidl/aidl.qbs @@ -0,0 +1,8 @@ +Application { + name: "io.qbs.aidltest" + Android.sdk.aidlSearchPaths: path + files: [ + "AndroidManifest.xml", + "io/qbs/aidltest/*", + ] +} diff --git a/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface1.aidl b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface1.aidl new file mode 100644 index 000000000..34fb0386c --- /dev/null +++ b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface1.aidl @@ -0,0 +1,7 @@ +package io.qbs.aidltest; + +import io.qbs.aidltest.Interface2; + +interface Interface1 { + void doSomething(in Interface2 param1, in Bundle param2); +} diff --git a/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface2.aidl b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface2.aidl new file mode 100644 index 000000000..815d44f23 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/Interface2.aidl @@ -0,0 +1,5 @@ +package io.qbs.aidltest; + +interface Interface2 { + void someFunc(in Bundle params); +} diff --git a/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/MainActivity.java b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/MainActivity.java new file mode 100644 index 000000000..e38cfa55b --- /dev/null +++ b/tests/auto/blackbox/testdata-android/aidl/io/qbs/aidltest/MainActivity.java @@ -0,0 +1,18 @@ +package io.qbs.aidltest; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.TextView; + +public class MainActivity extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + TextView label = new TextView(this); + label.setText("Hello world!"); + + setContentView(label); + } +} diff --git a/tests/auto/blackbox/testdata-android/minimal-native/libdependency.so b/tests/auto/blackbox/testdata-android/minimal-native/libdependency.so new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata-android/minimal-native/libdependency.so diff --git a/tests/auto/blackbox/testdata-android/minimal-native/minimal-native.qbs b/tests/auto/blackbox/testdata-android/minimal-native/minimal-native.qbs new file mode 100644 index 000000000..8cdda7a3c --- /dev/null +++ b/tests/auto/blackbox/testdata-android/minimal-native/minimal-native.qbs @@ -0,0 +1,11 @@ +CppApplication { + name: "minimalnative" + qbs.buildVariant: "release" + Properties { condition: qbs.toolchain.contains("clang"); Android.ndk.appStl: "c++_shared" } + Android.ndk.appStl: "stlport_shared" + files: "src/main/native/native.c" + Group { + files: "libdependency.so" + fileTags: "android.nativelibrary" + } +} diff --git a/tests/auto/blackbox/testdata-android/minimal-native/src/main/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/minimal-native/src/main/AndroidManifest.xml new file mode 100644 index 000000000..575e95e8d --- /dev/null +++ b/tests/auto/blackbox/testdata-android/minimal-native/src/main/AndroidManifest.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="somedefault"> + <application android:label="MinimalNative"> + <activity android:name="MainActivity"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/tests/auto/blackbox/testdata-android/minimal-native/src/main/java/minimal/MinimalNative.java b/tests/auto/blackbox/testdata-android/minimal-native/src/main/java/minimal/MinimalNative.java new file mode 100644 index 000000000..1464d2593 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/minimal-native/src/main/java/minimal/MinimalNative.java @@ -0,0 +1,22 @@ +package minimalnative; + +import android.app.Activity; +import android.widget.TextView; +import android.os.Bundle; + +public class MinimalNative extends Activity +{ + @Override + public void onCreate(Bundle savedInstanceState) + { + TextView tv = new TextView(this); + tv.setText(stringFromNative()); + setContentView(tv); + } + + public native String stringFromNative(); + + static { + System.loadLibrary("minimal"); + } +} diff --git a/tests/auto/blackbox/testdata-android/minimal-native/src/main/native/native.c b/tests/auto/blackbox/testdata-android/minimal-native/src/main/native/native.c new file mode 100644 index 000000000..6b625858b --- /dev/null +++ b/tests/auto/blackbox/testdata-android/minimal-native/src/main/native/native.c @@ -0,0 +1,8 @@ +#include <string.h> +#include <jni.h> + +jstring +Java_minimalnative_MinimalNative_stringFromNative(JNIEnv* env, jobject thiz) +{ + return (*env)->NewStringUTF(env, "This message comes from native code."); +} diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs index 3d03c309a..5dc5ad269 100644 --- a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/multiple-apks-per-project.qbs @@ -1,5 +1,3 @@ -import qbs - Project { references: [ "product1", diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs index eb63d4c20..c4a78a30b 100644 --- a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product1/product1.qbs @@ -1,5 +1,3 @@ -import qbs - Project { DynamicLibrary { Depends { name: "Android.ndk" } @@ -24,9 +22,10 @@ Project { cpp.useRPaths: false } - AndroidApk { + Application { name: "twolibs1" - packageName: "io.qt.dummy1" + Android.sdk.apkBaseName: name + Android.sdk.packageName: "io.qt.dummy1" Depends { productTypes: ["android.nativelibrary"] limitToSubProject: true diff --git a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs index 9b7f3eb54..9be70dcda 100644 --- a/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs +++ b/tests/auto/blackbox/testdata-android/multiple-apks-per-project/product2/product2.qbs @@ -1,5 +1,3 @@ -import qbs - Project { DynamicLibrary { Depends { name: "cpp" } @@ -19,9 +17,10 @@ Project { Android.ndk.appStl: "stlport_shared" } - AndroidApk { + Application { name: "twolibs2" - packageName: "io.qt.dummy2" + Android.sdk.apkBaseName: name + Android.sdk.packageName: "io.qt.dummy2" Depends { productTypes: ["android.nativelibrary"] limitToSubProject: true diff --git a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs index 6dd4e6bdb..8b9ded211 100644 --- a/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs +++ b/tests/auto/blackbox/testdata-android/multiple-libs-per-apk/multiple-libs-per-apk.qbs @@ -1,5 +1,3 @@ -import qbs - Project { DynamicLibrary { Depends { name: "Android.ndk" } @@ -25,6 +23,8 @@ Project { JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false Depends { name: "lib6" } Depends { name: "lib8" } name: "lib3" @@ -33,38 +33,49 @@ Project { JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false name: "lib4" files: ["lib4.java"] } JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false name: "lib5" files: ["lib5.java"] } JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false name: "lib6" files: ["lib6.java"] } JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false name: "lib7" files: ["lib7.java"] } JavaJarFile { Depends { name: "Android.sdk" } + Android.sdk.packageName: undefined + Android.sdk.automaticSources: false Depends { name: "lib7"; Android.sdk.embedJar: false } name: "lib8" files: ["lib8.java"] } - AndroidApk { + Application { name: "twolibs" - packageName: "io.qt.dummy" + Android.sdk.apkBaseName: name + Android.sdk.packageName: "io.qt.dummy" Depends { productTypes: ["android.nativelibrary"] } Depends { name: "lib3"; Android.sdk.embedJar: true } Depends { name: "lib4"; Android.sdk.embedJar: false } diff --git a/tests/auto/blackbox/testdata-android/no-native/no-native.qbs b/tests/auto/blackbox/testdata-android/no-native/no-native.qbs index 2909adc0c..74514f604 100644 --- a/tests/auto/blackbox/testdata-android/no-native/no-native.qbs +++ b/tests/auto/blackbox/testdata-android/no-native/no-native.qbs @@ -1,8 +1,7 @@ -import qbs - -AndroidApk { +Application { + qbs.targetPlatform: "android" name: "com.example.android.basicmediadecoder" - sourceSetDir: Android.sdk.sdkDir + Android.sdk.sourceSetDir: Android.sdk.sdkDir + "/samples/android-BasicMediaDecoder/Application/src/main" } diff --git a/tests/auto/blackbox/testdata-android/qml-app/main.cpp b/tests/auto/blackbox/testdata-android/qml-app/main.cpp new file mode 100644 index 000000000..e7cf5e16e --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/main.cpp @@ -0,0 +1,21 @@ +#include <QGuiApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { + qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); + qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); + + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + } + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/tests/auto/blackbox/testdata-android/qml-app/main.qml b/tests/auto/blackbox/testdata-android/qml-app/main.qml new file mode 100644 index 000000000..45ee20a2f --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/main.qml @@ -0,0 +1,9 @@ +import QtQuick 2.6 +import QtQuick.Window 2.2 + +Window { + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") +} diff --git a/tests/auto/blackbox/testdata-android/qml-app/qml-app.qbs b/tests/auto/blackbox/testdata-android/qml-app/qml-app.qbs new file mode 100644 index 000000000..56b9d6eaf --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/qml-app.qbs @@ -0,0 +1,14 @@ +QtApplication { + name: "qmlapp" + Depends { name: "Qt.quick" } + Depends { name: "Qt.android_support" } + Properties { + condition: qbs.targetOS.contains("android") + Qt.android_support.extraPrefixDirs: path + } + property stringList qmlImportPaths: path + files: [ + "main.cpp", + "qml.qrc", + ] +} diff --git a/tests/auto/blackbox/testdata-android/qml-app/qml.qrc b/tests/auto/blackbox/testdata-android/qml-app/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/qml.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>main.qml</file> + </qresource> +</RCC> diff --git a/tests/auto/blackbox/testdata-android/qml-app/src/main/AndroidManifest.xml b/tests/auto/blackbox/testdata-android/qml-app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..066ec0a63 --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/src/main/AndroidManifest.xml @@ -0,0 +1,81 @@ +<?xml version='1.0' encoding='utf-8'?> +<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto"> + <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --"> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" + android:name="org.qtproject.qt5.android.bindings.QtActivity" + android:label="-- %%INSERT_APP_NAME%% --" + android:screenOrientation="unspecified" + android:launchMode="singleTop"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + + <!-- Application arguments --> + <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ --> + <!-- Application arguments --> + + <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> + <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> + <meta-data android:name="android.app.repository" android:value="default"/> + <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> + <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/> + <!-- Deploy Qt libs as part of package --> + <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/> + <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/> + <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/> + <!-- Run with local libs --> + <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/> + <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/> + <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/> + <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/> + <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/> + <!-- Messages maps --> + <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/> + <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> + <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> + <!-- Messages maps --> + + <!-- Splash screen --> + <!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ --> + <!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ --> + <!-- Splash screen --> + + <!-- Background running --> + <!-- Warning: changing this value to true may cause unexpected crashes if the + application still try to draw after + "applicationStateChanged(Qt::ApplicationSuspended)" + signal is sent! --> + <meta-data android:name="android.app.background_running" android:value="false"/> + <!-- Background running --> + + <!-- auto screen scale factor --> + <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/> + <!-- auto screen scale factor --> + + <!-- extract android style --> + <!-- available android:values : + * full - useful QWidget & Quick Controls 1 apps + * minimal - useful for Quick Controls 2 apps, it is much faster than "full" + * none - useful for apps that don't use any of the above Qt modules + --> + <meta-data android:name="android.app.extract_android_style" android:value="full"/> + <!-- extract android style --> + </activity> + + <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices --> + + </application> + + <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/> + <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> + + <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. + Remove the comment if you do not require these default permissions. --> + <!-- %%INSERT_PERMISSIONS --> + + <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. + Remove the comment if you do not require these default features. --> + <!-- %%INSERT_FEATURES --> + +</manifest> diff --git a/tests/auto/blackbox/testdata-android/qml-app/src/main/assets/dummyasset.txt b/tests/auto/blackbox/testdata-android/qml-app/src/main/assets/dummyasset.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata-android/qml-app/src/main/assets/dummyasset.txt diff --git a/tests/auto/blackbox/testdata-android/teapot/teapot.qbs b/tests/auto/blackbox/testdata-android/teapot/teapot.qbs index 3e0210554..2b5cb8aba 100644 --- a/tests/auto/blackbox/testdata-android/teapot/teapot.qbs +++ b/tests/auto/blackbox/testdata-android/teapot/teapot.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Project { @@ -6,6 +5,7 @@ Project { StaticLibrary { name: "native-glue" qbs.targetPlatform: "android" + cpp.warningLevel: "none" Depends { name: "cpp" } Group { id: glue_sources @@ -23,6 +23,7 @@ Project { StaticLibrary { name: "ndk-helper" qbs.targetPlatform: "android" + cpp.warningLevel: "none" Depends { name: "Android.ndk" } Depends { name: "cpp" } Depends { name: "native-glue" } @@ -78,9 +79,10 @@ Project { } } - DynamicLibrary { + CppApplication { name: "TeapotNativeActivity" qbs.targetPlatform: "android" + Depends { name: "Android.ndk" } Depends { name: "cpp" } Depends { name: "android_cpufeatures" } @@ -88,6 +90,21 @@ Project { Depends { name: "ndk-helper" } Probe { + id: teapotProbe + property string samplesDir: Android.sdk.ndkSamplesDir + property string dir + configure: { + var paths = ["/teapots/classic-teapot/src/main", "/Teapot/app/src/main", "/Teapot"]; + for (var i = 0; i < paths.length; ++i) { + if (File.exists(samplesDir + paths[i])) { + dir = samplesDir + paths[i]; + break; + } + } + } + } + + Probe { id: teapotProbeJni property string samplesDir: Android.ndk.ndkSamplesDir property string jniDir @@ -116,6 +133,9 @@ Project { FileTagger { patterns: ["*.inl"]; fileTags: ["hpp"] } + Android.sdk.apkBaseName: name + Android.sdk.packageName: "com.sample.teapot" + Android.sdk.sourceSetDir: teapotProbe.dir Properties { condition: qbs.toolchain.contains("clang"); Android.ndk.appStl: "c++_shared" } Android.ndk.appStl: "gnustl_shared" cpp.cxxLanguageVersion: "c++11" @@ -126,25 +146,4 @@ Project { // Refer to: https://github.com/android-ndk/ndk/issues/381 cpp.linkerFlags: ["-u", "ANativeActivity_onCreate"] } - - AndroidApk { - Probe { - id: teapotProbe - property string samplesDir: Android.sdk.ndkSamplesDir - property string dir - configure: { - var paths = ["/teapots/classic-teapot/src/main", "/Teapot/app/src/main", "/Teapot"]; - for (var i = 0; i < paths.length; ++i) { - if (File.exists(samplesDir + paths[i])) { - dir = samplesDir + paths[i]; - break; - } - } - } - } - - name: "com.sample.teapot" - sourceSetDir: teapotProbe.dir - Depends { productTypes: ["android.nativelibrary"] } - } } diff --git a/tests/auto/blackbox/testdata-apple/apple-dmg/apple-dmg.qbs b/tests/auto/blackbox/testdata-apple/apple-dmg/apple-dmg.qbs index 3bccebfd0..b3d39fe27 100644 --- a/tests/auto/blackbox/testdata-apple/apple-dmg/apple-dmg.qbs +++ b/tests/auto/blackbox/testdata-apple/apple-dmg/apple-dmg.qbs @@ -1,5 +1,3 @@ -import qbs - Project { AppleApplicationDiskImage { Depends { name: "myapp" } @@ -18,12 +16,7 @@ Project { targetName: "My Great App" files: ["main.c"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installDir: "/Applications" - qbs.installSourceBase: product.buildDirectory - } + install: true } AppleDiskImage { diff --git a/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs b/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs index fcd440e66..438624f70 100644 --- a/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs +++ b/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities Project { @@ -18,11 +17,8 @@ Project { aggregate: false multiplexByQbsProperties: [] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } CppApplication { @@ -39,11 +35,8 @@ Project { qbs.architectures: ["x86_64"] qbs.buildVariants: ["release"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { @@ -59,11 +52,8 @@ Project { aggregate: false multiplexByQbsProperties: [] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } CppApplication { @@ -75,11 +65,8 @@ Project { cpp.rpaths: [cpp.rpathOrigin + "/../../../"] cpp.minimumMacosVersion: "10.6" - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } CppApplication { @@ -94,12 +81,10 @@ Project { qbs.architecture: "x86_64" multiplexByQbsProperties: project.enableX86 ? ["architectures", "buildVariants"] : ["buildVariants"] + qbs.buildVariants: "debug" - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } CppApplication { @@ -113,11 +98,8 @@ Project { qbs.architectures: project.enableX86 ? ["x86", "x86_64"] : ["x86_64"] qbs.buildVariants: ["debug", "profile"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { @@ -131,11 +113,8 @@ Project { qbs.architectures: project.enableX86 ? ["x86", "x86_64"] : ["x86_64"] qbs.buildVariants: ["release", "debug", "profile"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { @@ -149,11 +128,8 @@ Project { qbs.architectures: project.enableX86 ? ["x86", "x86_64"] : ["x86_64"] qbs.buildVariants: ["debug", "profile"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { @@ -166,11 +142,8 @@ Project { cpp.defines: ["VARIANT=" + Utilities.cStringQuote(qbs.buildVariant)] qbs.architectures: project.enableX86 ? ["x86", "x86_64"] : ["x86_64"] qbs.buildVariants: ["debug", "profile"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { Depends { name: "cpp" } @@ -181,10 +154,7 @@ Project { cpp.defines: ["VARIANT=" + Utilities.cStringQuote(qbs.buildVariant)] qbs.architectures: project.enableX86 ? ["x86", "x86_64"] : ["x86_64"] qbs.buildVariants: ["debug", "profile"] - Group { - fileTagsFilter: ["bundle.content"] - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } } diff --git a/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs b/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs index a7c3e20bf..8cf031e33 100644 --- a/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs +++ b/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property stringList bundleFileTags: ["bundle.content"] @@ -17,11 +15,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } Application { @@ -37,11 +32,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } Application { @@ -57,11 +49,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } DynamicLibrary { @@ -73,11 +62,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } StaticLibrary { @@ -89,11 +75,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } LoadableModule { @@ -105,11 +88,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } ApplicationExtension { @@ -121,11 +101,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } XPCService { @@ -137,11 +114,8 @@ Project { bundle.privateHeaders: ["dummy_p.h"] bundle.resources: ["resource.txt"] files: ["dummy.c"] - Group { - fileTagsFilter: product.type.concat(project.bundleFileTags) - qbs.install: true - qbs.installSourceBase: product.buildDirectory - } + install: true + installDir: "" } Product { diff --git a/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs b/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs index 940fe74f4..9eff57b60 100644 --- a/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs +++ b/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.c"] diff --git a/tests/auto/blackbox/testdata-apple/embedInfoPlist/embedInfoPlist.qbs b/tests/auto/blackbox/testdata-apple/embedInfoPlist/embedInfoPlist.qbs index 16b00208e..ba23dc32c 100644 --- a/tests/auto/blackbox/testdata-apple/embedInfoPlist/embedInfoPlist.qbs +++ b/tests/auto/blackbox/testdata-apple/embedInfoPlist/embedInfoPlist.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { Depends { name: "lib" } @@ -13,10 +11,8 @@ Project { bundle.infoPlist: ({ "QBS": "org.qt-project.qbs.testdata.embedInfoPlist" }) - Group { - fileTagsFilter: product.type - qbs.install: true - } + install: true + installDir: "" } DynamicLibrary { @@ -30,10 +26,8 @@ Project { bundle.infoPlist: ({ "QBS": "org.qt-project.qbs.testdata.embedInfoPlist.dylib" }) - Group { - fileTagsFilter: product.type - qbs.install: true - } + install: true + installDir: "" } LoadableModule { diff --git a/tests/auto/blackbox/testdata-apple/frameworkStructure/frameworkStructure.qbs b/tests/auto/blackbox/testdata-apple/frameworkStructure/frameworkStructure.qbs index 39b3a1b58..a812ae513 100644 --- a/tests/auto/blackbox/testdata-apple/frameworkStructure/frameworkStructure.qbs +++ b/tests/auto/blackbox/testdata-apple/frameworkStructure/frameworkStructure.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property bool includeHeaders: true Library { diff --git a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs index ef67796f9..622fa46cb 100644 --- a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities Project { diff --git a/tests/auto/blackbox/testdata-apple/ib/empty-asset-catalogs/multiple-asset-catalogs.qbs b/tests/auto/blackbox/testdata-apple/ib/empty-asset-catalogs/multiple-asset-catalogs.qbs index 454d3c482..49b389d3d 100644 --- a/tests/auto/blackbox/testdata-apple/ib/empty-asset-catalogs/multiple-asset-catalogs.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/empty-asset-catalogs/multiple-asset-catalogs.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "ib" } files: [ diff --git a/tests/auto/blackbox/testdata-apple/ib/iconset/iconset.qbs b/tests/auto/blackbox/testdata-apple/ib/iconset/iconset.qbs index 1d563f180..b3481587f 100644 --- a/tests/auto/blackbox/testdata-apple/ib/iconset/iconset.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/iconset/iconset.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "ib" } type: ["icns"] diff --git a/tests/auto/blackbox/testdata-apple/ib/iconsetapp/iconsetapp.qbs b/tests/auto/blackbox/testdata-apple/ib/iconsetapp/iconsetapp.qbs index 7e5323a0c..04e6ce0ce 100644 --- a/tests/auto/blackbox/testdata-apple/ib/iconsetapp/iconsetapp.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/iconsetapp/iconsetapp.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "ib" } files: ["main.c", "white.iconset"] diff --git a/tests/auto/blackbox/testdata-apple/ib/multiple-asset-catalogs/multiple-asset-catalogs.qbs b/tests/auto/blackbox/testdata-apple/ib/multiple-asset-catalogs/multiple-asset-catalogs.qbs index 454d3c482..49b389d3d 100644 --- a/tests/auto/blackbox/testdata-apple/ib/multiple-asset-catalogs/multiple-asset-catalogs.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/multiple-asset-catalogs/multiple-asset-catalogs.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "ib" } files: [ diff --git a/tests/auto/blackbox/testdata-apple/infoplist/infoplist.qbs b/tests/auto/blackbox/testdata-apple/infoplist/infoplist.qbs index 58cb361dd..a6ac3d8d1 100644 --- a/tests/auto/blackbox/testdata-apple/infoplist/infoplist.qbs +++ b/tests/auto/blackbox/testdata-apple/infoplist/infoplist.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { cpp.minimumMacosVersion: "10.7" files: ["main.c"] diff --git a/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs b/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs index 672de3cb5..545d5701c 100644 --- a/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs +++ b/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "cpp" } consoleApplication: true diff --git a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs index 0c2b0b93d..d7baf8c8e 100644 --- a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs +++ b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property stringList sdks: [] diff --git a/tests/auto/blackbox/testdata-clangdb/project1/project.qbs b/tests/auto/blackbox/testdata-clangdb/project1/project.qbs index 4552deb40..ecfc562b0 100644 --- a/tests/auto/blackbox/testdata-clangdb/project1/project.qbs +++ b/tests/auto/blackbox/testdata-clangdb/project1/project.qbs @@ -1,5 +1,3 @@ -import qbs - // $ g++ 'i like spaces.cpp' '-DSPACES="!have \\fun\x5c!\n"' '-DSPICES=%T% # && $$ 1>&2 '\''\n'\''\n' '-DSLICES=(42>24)' && ./a.out // SPACES=!have \fun\! // SPICES=%T% # && $$ 1>&2 '\n' diff --git a/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs b/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs index 5bc861f5d..c48401478 100644 --- a/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs +++ b/tests/auto/blackbox/testdata-java/java/inner-class/inner-class.qbs @@ -1,5 +1,3 @@ -import qbs - JavaJarFile { files: ["**/*.java"] } diff --git a/tests/auto/blackbox/testdata-java/java/vehicles.qbs b/tests/auto/blackbox/testdata-java/java/vehicles.qbs index 86d1f7d32..8153efe00 100644 --- a/tests/auto/blackbox/testdata-java/java/vehicles.qbs +++ b/tests/auto/blackbox/testdata-java/java/vehicles.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.Utilities @@ -14,15 +13,14 @@ Project { name: "native" files: ["engine.c"] - Group { - fileTagsFilter: ["dynamiclibrary"] - qbs.install: true - } + qbs.installPrefix: "" + install: true + installDir: "" } JavaClassCollection { Depends { name: "random_stuff" } - name: "class_collection" + name: "cc" java.additionalCompilerFlags: ["-Xlint:all"] files: [ "Car.java", "HelloWorld.java", "Jet.java", "NoPackage.java", "Ship.java", @@ -44,6 +42,7 @@ Project { name: "random_stuff" files: ["RandomStuff.java"] + qbs.installPrefix: "" Group { fileTagsFilter: ["java.jar"] qbs.install: true @@ -78,6 +77,7 @@ Project { java.manifestClassPath: [product.targetName + ".jar"] } + qbs.installPrefix: "" Group { fileTagsFilter: ["java.jar"] qbs.install: true @@ -98,6 +98,7 @@ Project { return mf; } + qbs.installPrefix: "" Group { fileTagsFilter: ["java.jar"] qbs.install: true diff --git a/tests/auto/blackbox/testdata-joblimits/job-limits/job-limits.qbs b/tests/auto/blackbox/testdata-joblimits/job-limits/job-limits.qbs new file mode 100644 index 000000000..1ab369c88 --- /dev/null +++ b/tests/auto/blackbox/testdata-joblimits/job-limits/job-limits.qbs @@ -0,0 +1,97 @@ +import qbs.TextFile + +Project { + property int projectJobCount + property int productJobCount + property int moduleJobCount + JobLimit { + condition: projectJobCount !== -1 + jobPool: "singleton" + jobCount: projectJobCount + } + JobLimit { + condition: projectJobCount !== -1 + jobPool: "singleton" + jobCount: 100 + } + CppApplication { + name: "tool" + consoleApplication: true + cpp.cxxLanguageVersion: "c++14" + Properties { + condition: qbs.targetOS.contains("macos") + cpp.minimumMacosVersion: "10.9" + } + files: "main.cpp" + Group { + fileTagsFilter: "application" + fileTags: "tool_tag" + } + Export { + Rule { + alwaysRun: true + inputs: "tool_in" + explicitlyDependsOnFromDependencies: "tool_tag" + Artifact { filePath: input.completeBaseName + ".out"; fileTags: "tool_out" } + prepare: { + var cmd = new Command(explicitlyDependsOn.tool_tag[0].filePath, + [output.filePath]); + cmd.workingDirectory = product.buildDirectory; + cmd.description = "Running tool"; + cmd.jobPool = "singleton"; + return cmd; + } + } + JobLimit { + condition: project.moduleJobCount !== -1 + jobPool: "singleton" + jobCount: project.moduleJobCount + } + JobLimit { + condition: project.moduleJobCount !== -1 + jobPool: "singleton" + jobCount: 200 + } + } + } + Product { + name: "p" + type: "tool_out" + Depends { name: "tool" } + Rule { + multiplex: true + outputFileTags: "tool_in" + outputArtifacts: { + var artifacts = []; + for (var i = 0; i < 7; ++i) + artifacts.push({filePath: "file" + i + ".in", fileTags: "tool_in"}); + return artifacts; + } + prepare: { + var commands = []; + for (var i = 0; i < outputs.tool_in.length; ++i) { + var cmd = new JavaScriptCommand(); + var output = outputs.tool_in[i]; + cmd.output = output.filePath; + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output, TextFile.WriteOnly); + f.close(); + } + commands.push(cmd); + }; + return commands; + } + } + JobLimit { + condition: project.productJobCount !== -1 + jobPool: "singleton" + jobCount: project.productJobCount + } + JobLimit { + condition: project.productJobCount !== -1 + jobPool: "singleton" + jobCount: 300 + } + } +} diff --git a/tests/auto/blackbox/testdata-joblimits/job-limits/main.cpp b/tests/auto/blackbox/testdata-joblimits/job-limits/main.cpp new file mode 100644 index 000000000..0a94c6393 --- /dev/null +++ b/tests/auto/blackbox/testdata-joblimits/job-limits/main.cpp @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <cerrno> +#include <chrono> +#include <cstdio> +#include <cstring> +#include <iostream> +#include <string> +#include <thread> + +#if defined(_WIN32) || defined(WIN32) +#include <io.h> +#include <sys/locking.h> +#else +#include <unistd.h> +#endif + +static bool tryLock(FILE *f) +{ + const int exitCode = +#if defined(_WIN32) || defined(WIN32) + _locking(_fileno(f), _LK_NBLCK, 10); + +#else + lockf(fileno(f), F_TLOCK, 10); +#endif + return exitCode == 0; +} + +int main(int argc, char *argv[]) +{ + if (argc != 2) { + std::cerr << "tool needs exactly one argument" << std::endl; + return 1; + } + + const std::string lockFilePath = std::string(argv[0]) + ".lock"; + std::FILE * const lockFile = std::fopen(lockFilePath.c_str(), "w"); + if (!lockFile) { + std::cerr << "cannot open lock file: " << strerror(errno) << std::endl; + return 2; + } + if (!tryLock(lockFile)) { + if (errno == EACCES || errno == EAGAIN) { + std::cerr << "tool is exclusive" << std::endl; + return 3; + } else { + std::cerr << "unexpected lock failure: " << strerror(errno) << std::endl; + fclose(lockFile); + return 4; + } + } + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + fclose(lockFile); + std::FILE * const output = std::fopen(argv[1], "w"); + if (!output) { + std::cerr << "cannot create output file: " << strerror(errno) << std::endl; + return 5; + } + fclose(output); +} diff --git a/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/add-qobject-macro-to-generated-cpp-file.qbs b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/add-qobject-macro-to-generated-cpp-file.qbs new file mode 100644 index 000000000..db0e20097 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/add-qobject-macro-to-generated-cpp-file.qbs @@ -0,0 +1,25 @@ +import qbs.File + +QtApplication { + name: "p" + files: ["main.cpp", "object.h"] + Group { + files: "object.cpp.in" + fileTags: "cpp.in" + } + Rule { + inputs: "cpp.in" + Artifact { + filePath: input.completeBaseName + fileTags: "cpp" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generatating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); } + return cmd; + } + } + cpp.includePaths: path +} + diff --git a/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/main.cpp b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/main.cpp new file mode 100644 index 000000000..3f57ddafb --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/main.cpp @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "object.h" + +int main() +{ + Object o; + o.f(); +} diff --git a/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.cpp.in b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.cpp.in new file mode 100644 index 000000000..b1b9922af --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.cpp.in @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <object.h> + +#include <QObject> + +// class InternalClass : public QObject +// { +// Q_OBJECT +// }; + +void Object::f() { } + + +// #include <object.moc> diff --git a/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.h b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.h new file mode 100644 index 000000000..5537a8d32 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/add-qobject-macro-to-generated-cpp-file/object.h @@ -0,0 +1,32 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +class Object { +public: + void f(); +}; diff --git a/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs b/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs index 63906fd77..e08f89032 100644 --- a/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs +++ b/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs @@ -1,5 +1,3 @@ -import qbs - Project { QtApplication { name: "app" diff --git a/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs index 5117557e1..c95f1190d 100644 --- a/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs +++ b/tests/auto/blackbox/testdata-qt/cached-qml/cached-qml.qbs @@ -1,11 +1,14 @@ -import qbs import qbs.Utilities CppApplication { name: "app" + consoleApplication: true Depends { name: "Qt.core" } Depends { name: "Qt.quick" } Depends { name: "Qt.qml" } + install: true + installDir: "" + qbs.installPrefix: "" Qt.qml.generateCacheFiles: true Qt.qml.cacheFilesInstallDir: "data" @@ -16,11 +19,6 @@ CppApplication { "stuff.js" ] - Group { - fileTagsFilter: ["application"] - qbs.install: true - } - // Install the C++ sources to tell the blackbox test that Qt.qmlcache is not available. Group { condition: !Qt.qml.cachingEnabled diff --git a/tests/auto/blackbox/testdata-qt/combined-moc/combined-moc.qbs b/tests/auto/blackbox/testdata-qt/combined-moc/combined-moc.qbs index 34529fce6..acbed1639 100644 --- a/tests/auto/blackbox/testdata-qt/combined-moc/combined-moc.qbs +++ b/tests/auto/blackbox/testdata-qt/combined-moc/combined-moc.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { name: "theapp" files: [ diff --git a/tests/auto/blackbox/testdata-qt/dbus-adaptors/car.qbs b/tests/auto/blackbox/testdata-qt/dbus-adaptors/car.qbs index f89a8473b..34aab4701 100644 --- a/tests/auto/blackbox/testdata-qt/dbus-adaptors/car.qbs +++ b/tests/auto/blackbox/testdata-qt/dbus-adaptors/car.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "car" condition: Qt.dbus.present diff --git a/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.qbs b/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.qbs index f170d4a20..a1bde7f10 100644 --- a/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.qbs +++ b/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "controller" condition: Qt.dbus.present diff --git a/tests/auto/blackbox/testdata-qt/included-moc-cpp/included-moc-cpp.qbs b/tests/auto/blackbox/testdata-qt/included-moc-cpp/included-moc-cpp.qbs new file mode 100644 index 000000000..1ed85ccdd --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/included-moc-cpp/included-moc-cpp.qbs @@ -0,0 +1,9 @@ +import qbs + +QtApplication { + files: [ + "main.cpp", + "myobject.cpp", + "myobject.h", + ] +} diff --git a/tests/auto/blackbox/testdata-qt/included-moc-cpp/main.cpp b/tests/auto/blackbox/testdata-qt/included-moc-cpp/main.cpp new file mode 100644 index 000000000..5323e4c98 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/included-moc-cpp/main.cpp @@ -0,0 +1,7 @@ +#include "myobject.h" + +int main() +{ + MyObject o; + QObject::connect(&o, &QObject::destroyed, [] { }); +} diff --git a/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.cpp b/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.cpp new file mode 100644 index 000000000..de0988c24 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.cpp @@ -0,0 +1,3 @@ +#include "myobject.h" + +#include <moc_myobject.cpp> diff --git a/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.h b/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.h new file mode 100644 index 000000000..61c2920aa --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/included-moc-cpp/myobject.h @@ -0,0 +1,11 @@ +#ifndef MYOBJECT_H +#define MYOBJECT_H + +#include <QObject> + +class MyObject : public QObject +{ + Q_OBJECT +}; + +#endif diff --git a/tests/auto/blackbox/testdata-qt/lrelease/lrelease.qbs b/tests/auto/blackbox/testdata-qt/lrelease/lrelease.qbs index b4119402f..978aba333 100644 --- a/tests/auto/blackbox/testdata-qt/lrelease/lrelease.qbs +++ b/tests/auto/blackbox/testdata-qt/lrelease/lrelease.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "lrelease-test" type: ["ts"] diff --git a/tests/auto/blackbox/testdata-qt/mixed-build-variants/mixed-build-variants.qbs b/tests/auto/blackbox/testdata-qt/mixed-build-variants/mixed-build-variants.qbs index 8f2c1c7fd..7d8ab1b90 100644 --- a/tests/auto/blackbox/testdata-qt/mixed-build-variants/mixed-build-variants.qbs +++ b/tests/auto/blackbox/testdata-qt/mixed-build-variants/mixed-build-variants.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { Properties { condition: qbs.toolchain.contains("msvc") diff --git a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs index 1b0b9f54a..f5463853b 100644 --- a/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs +++ b/tests/auto/blackbox/testdata-qt/moc-and-cxx-combining/moc-and-cxx-combining.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { cpp.combineCxxSources: true files: ["main.cpp", "myobject.h", "myobject.cpp"] diff --git a/tests/auto/blackbox/testdata-qt/moc-flags/moc-flags.qbs b/tests/auto/blackbox/testdata-qt/moc-flags/moc-flags.qbs index d42c7ad87..7cc4e5c4d 100644 --- a/tests/auto/blackbox/testdata-qt/moc-flags/moc-flags.qbs +++ b/tests/auto/blackbox/testdata-qt/moc-flags/moc-flags.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { files: ["main.cpp", "blubb.h"] } diff --git a/tests/auto/blackbox/testdata-qt/moc-same-file-name/moc-same-file-name.qbs b/tests/auto/blackbox/testdata-qt/moc-same-file-name/moc-same-file-name.qbs index 42fcff82e..461fec50e 100644 --- a/tests/auto/blackbox/testdata-qt/moc-same-file-name/moc-same-file-name.qbs +++ b/tests/auto/blackbox/testdata-qt/moc-same-file-name/moc-same-file-name.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { name: "app" cpp.cxxLanguageVersion: "c++11" diff --git a/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs b/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs index 132ce337a..04b0097ef 100644 --- a/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs +++ b/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.Probes Project { diff --git a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs index d44b82d4a..f018b34e0 100644 --- a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs +++ b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs @@ -1,5 +1,3 @@ -import qbs - Project { QtApplication { name: "app" diff --git a/tests/auto/blackbox/testdata-qt/plugin-support/modules/m1/m1.qbs b/tests/auto/blackbox/testdata-qt/plugin-support/modules/m1/m1.qbs new file mode 100644 index 000000000..a4cad304f --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/plugin-support/modules/m1/m1.qbs @@ -0,0 +1,12 @@ +Module { + property bool useDummy + Depends { name: "Qt.plugin_support" } + Properties { + condition: useDummy + Qt.plugin_support.pluginsByType: ({imageformats: "dummy"}) + } + Properties { + condition: Qt.plugin_support.allPluginsByType && Qt.plugin_support.allPluginsByType.imageformats + Qt.plugin_support.pluginsByType: ({imageformats: Qt.plugin_support.allPluginsByType.imageformats[0]}) + } +} diff --git a/tests/auto/blackbox/testdata-qt/plugin-support/modules/m2/m2.qbs b/tests/auto/blackbox/testdata-qt/plugin-support/modules/m2/m2.qbs new file mode 100644 index 000000000..c4730ab6b --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/plugin-support/modules/m2/m2.qbs @@ -0,0 +1,7 @@ +Module { + Depends { name: "Qt.plugin_support" } + Properties { + condition: Qt.plugin_support.allPluginsByType && Qt.plugin_support.allPluginsByType.imageformats + Qt.plugin_support.pluginsByType: ({imageformats: Qt.plugin_support.allPluginsByType.imageformats[1]}) + } +} diff --git a/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support-main.cpp b/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support-main.cpp new file mode 100644 index 000000000..237c8ce18 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support-main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support.qbs b/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support.qbs new file mode 100644 index 000000000..c554a7dc2 --- /dev/null +++ b/tests/auto/blackbox/testdata-qt/plugin-support/plugin-support.qbs @@ -0,0 +1,18 @@ +QtGuiApplication { + Probe { + id: staticProbe + property bool isStaticQt: Qt.gui.isStaticLibrary + property var plugins: Qt.plugin_support.effectivePluginsByType + property var allPlugins: Qt.plugin_support.allPluginsByType + configure: { + console.info("static Qt: " + isStaticQt); + console.info("requested image plugins: %" + plugins.imageformats + "%"); + console.info("all image plugins: #" + allPlugins.imageformats + "#"); + console.info("platform plugin count: " + (plugins.platforms || []).length); + } + } + + Depends { name: "m1" } + Depends { name: "m2" } + files: "plugin-support-main.cpp" +} diff --git a/tests/auto/blackbox/testdata-qt/qml-debugging/qml-debugging.qbs b/tests/auto/blackbox/testdata-qt/qml-debugging/qml-debugging.qbs index 3606b4aa3..8176a7c3e 100644 --- a/tests/auto/blackbox/testdata-qt/qml-debugging/qml-debugging.qbs +++ b/tests/auto/blackbox/testdata-qt/qml-debugging/qml-debugging.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { name: "debuggable-app" consoleApplication: true diff --git a/tests/auto/blackbox/testdata-qt/qobject-in-mm/qobject-in-mm.qbs b/tests/auto/blackbox/testdata-qt/qobject-in-mm/qobject-in-mm.qbs index 2f819d012..3ceb8515b 100644 --- a/tests/auto/blackbox/testdata-qt/qobject-in-mm/qobject-in-mm.qbs +++ b/tests/auto/blackbox/testdata-qt/qobject-in-mm/qobject-in-mm.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "Qt.core" } files: ["main.mm"] diff --git a/tests/auto/blackbox/testdata-qt/qrc/i.qbs b/tests/auto/blackbox/testdata-qt/qrc/i.qbs index b6aeb9c15..c005490c4 100644 --- a/tests/auto/blackbox/testdata-qt/qrc/i.qbs +++ b/tests/auto/blackbox/testdata-qt/qrc/i.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { consoleApplication: true diff --git a/tests/auto/blackbox/testdata-qt/qt-keywords/qt-keywords.qbs b/tests/auto/blackbox/testdata-qt/qt-keywords/qt-keywords.qbs index 59e964258..ddd93827d 100644 --- a/tests/auto/blackbox/testdata-qt/qt-keywords/qt-keywords.qbs +++ b/tests/auto/blackbox/testdata-qt/qt-keywords/qt-keywords.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { files: ["main.cpp"] } diff --git a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs index e010e76e6..43151bc56 100644 --- a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs +++ b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment import qbs.FileInfo @@ -29,10 +28,7 @@ Project { Depends { name: "app" } Rule { inputsFromDependencies: ["application"] - Artifact { - filePath: "dummy" - fileTags: ["runner"] - } + outputFileTags: ["runner"] prepare: { var cmd = new Command(input.filePath); cmd.description = "running " + input.filePath; diff --git a/tests/auto/blackbox/testdata-qt/quick-compiler/quick-compiler.qbs b/tests/auto/blackbox/testdata-qt/quick-compiler/quick-compiler.qbs index 5f79df581..b141c8672 100644 --- a/tests/auto/blackbox/testdata-qt/quick-compiler/quick-compiler.qbs +++ b/tests/auto/blackbox/testdata-qt/quick-compiler/quick-compiler.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "Qt.quick" } Qt.quick.useCompiler: Qt.quick.compilerAvailable diff --git a/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs index 120f10b0d..b8ac33b96 100644 --- a/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs +++ b/tests/auto/blackbox/testdata-qt/remove-moc-header-from-file-list/remove-moc-header-from-file-list.qbs @@ -1,5 +1,3 @@ -import qbs - QtApplication { name: "p" files: [ diff --git a/tests/auto/blackbox/testdata-qt/static-qt-plugin-linking/static-qt-plugin-linking.qbs b/tests/auto/blackbox/testdata-qt/static-qt-plugin-linking/static-qt-plugin-linking.qbs index a72ce0098..ed479c8f1 100644 --- a/tests/auto/blackbox/testdata-qt/static-qt-plugin-linking/static-qt-plugin-linking.qbs +++ b/tests/auto/blackbox/testdata-qt/static-qt-plugin-linking/static-qt-plugin-linking.qbs @@ -1,5 +1,3 @@ -import qbs - StaticLibrary { name: "somelib" Probe { @@ -13,5 +11,6 @@ StaticLibrary { } Depends { name: "Qt.core" } + Depends { name: "Qt.gui" } Depends { name: "Qt.qminimal"; condition: Qt.core.staticBuild; } } diff --git a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/test.qbs b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/test.qbs index 0e341c21f..0aa1b1d23 100644 --- a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/test.qbs +++ b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/test.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Application { Depends { name: "Qt.core" } cpp.cxxLanguageVersion: "c++11" diff --git a/tests/auto/blackbox/testdata-qt/trackQObjChange/i.qbs b/tests/auto/blackbox/testdata-qt/trackQObjChange/i.qbs index c18fab086..348017547 100644 --- a/tests/auto/blackbox/testdata-qt/trackQObjChange/i.qbs +++ b/tests/auto/blackbox/testdata-qt/trackQObjChange/i.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { type: "application" diff --git a/tests/auto/blackbox/testdata-qt/unmocable/unmocable.qbs b/tests/auto/blackbox/testdata-qt/unmocable/unmocable.qbs index bb86fb223..780d27e30 100644 --- a/tests/auto/blackbox/testdata-qt/unmocable/unmocable.qbs +++ b/tests/auto/blackbox/testdata-qt/unmocable/unmocable.qbs @@ -1,5 +1,3 @@ -import qbs - Application { Depends { name: "Qt.core" } files: ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs b/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs index 223da0b3c..55495a950 100644 --- a/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs +++ b/tests/auto/blackbox/testdata/QTBUG-51237/modules/mymodule/mymodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property stringList theProperty: [] //property stringList otherProperty: theProperty.concat([]) diff --git a/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs b/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs index 6edea9dc6..849a943f8 100644 --- a/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs +++ b/tests/auto/blackbox/testdata/QTBUG-51237/qtbug-51237.qbs @@ -1,14 +1,9 @@ -import qbs - Product { type: "custom" Depends { name: "mymodule" } Rule { multiplex: true - Artifact { - filePath: "dummy.custom" - fileTags: ["custom"] - } + outputFileTags: ["custom"] prepare: { var theProperty = product.mymodule.theProperty; if (!theProperty) diff --git a/tests/auto/blackbox/testdata/add-filetag-to-generated-artifact/add-filetag-to-generated-artifact.qbs b/tests/auto/blackbox/testdata/add-filetag-to-generated-artifact/add-filetag-to-generated-artifact.qbs index 1bc9b15ef..7fba9c988 100644 --- a/tests/auto/blackbox/testdata/add-filetag-to-generated-artifact/add-filetag-to-generated-artifact.qbs +++ b/tests/auto/blackbox/testdata/add-filetag-to-generated-artifact/add-filetag-to-generated-artifact.qbs @@ -1,11 +1,12 @@ -import qbs import qbs.File Project { + property bool enableTagging CppApplication { name: "my_app" files: "main.cpp" Group { + condition: project.enableTagging fileTagsFilter: ["application"] fileTags: ["app-to-compress"] } diff --git a/tests/auto/blackbox/testdata/always-run/rule.qbs b/tests/auto/blackbox/testdata/always-run/rule.qbs index 6dbb5c845..7d61e5daf 100644 --- a/tests/auto/blackbox/testdata/always-run/rule.qbs +++ b/tests/auto/blackbox/testdata/always-run/rule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/always-run/transformer.qbs b/tests/auto/blackbox/testdata/always-run/transformer.qbs index b5c83eaab..8ae44fb77 100644 --- a/tests/auto/blackbox/testdata/always-run/transformer.qbs +++ b/tests/auto/blackbox/testdata/always-run/transformer.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/archiver/archivable.qbs b/tests/auto/blackbox/testdata/archiver/archivable.qbs index d6a8e048d..8e521ddf0 100644 --- a/tests/auto/blackbox/testdata/archiver/archivable.qbs +++ b/tests/auto/blackbox/testdata/archiver/archivable.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "archivable" type: "archiver.archive" diff --git a/tests/auto/blackbox/testdata/artifact-scanning/artifact-scanning.qbs b/tests/auto/blackbox/testdata/artifact-scanning/artifact-scanning.qbs index 6fa1b5e93..bcd236163 100644 --- a/tests/auto/blackbox/testdata/artifact-scanning/artifact-scanning.qbs +++ b/tests/auto/blackbox/testdata/artifact-scanning/artifact-scanning.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "p1" diff --git a/tests/auto/blackbox/testdata/artifacts-map-change-tracking/artifacts-map-change-tracking.qbs b/tests/auto/blackbox/testdata/artifacts-map-change-tracking/artifacts-map-change-tracking.qbs index 0d3c361f6..879138536 100644 --- a/tests/auto/blackbox/testdata/artifacts-map-change-tracking/artifacts-map-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/artifacts-map-change-tracking/artifacts-map-change-tracking.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Project { diff --git a/tests/auto/blackbox/testdata/artifacts-map-invalidation/artifacts-map-invalidation.qbs b/tests/auto/blackbox/testdata/artifacts-map-invalidation/artifacts-map-invalidation.qbs index 9d0c81d26..cd4e9b790 100644 --- a/tests/auto/blackbox/testdata/artifacts-map-invalidation/artifacts-map-invalidation.qbs +++ b/tests/auto/blackbox/testdata/artifacts-map-invalidation/artifacts-map-invalidation.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Project { diff --git a/tests/auto/blackbox/testdata/artifacts-map-race-condition/artifacts-map-race-condition.qbs b/tests/auto/blackbox/testdata/artifacts-map-race-condition/artifacts-map-race-condition.qbs index 0ab4cea88..86255c6c3 100644 --- a/tests/auto/blackbox/testdata/artifacts-map-race-condition/artifacts-map-race-condition.qbs +++ b/tests/auto/blackbox/testdata/artifacts-map-race-condition/artifacts-map-race-condition.qbs @@ -1,11 +1,9 @@ -import qbs - Product { name: "p" type: ["custom1", "custom2", "custom3", "custom4", "custom5"] Rule { multiplex: true - Artifact { filePath: "dummy"; fileTags: "custom1" } + outputFileTags: "custom1" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "reader1"; @@ -24,7 +22,7 @@ Product { } Rule { multiplex: true - Artifact { filePath: "helperdummy"; fileTags: "helper" } + outputFileTags: "helper" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "helper"; @@ -55,7 +53,7 @@ Product { } Rule { multiplex: true - Artifact { filePath: "dummy2"; fileTags: "custom5" } + outputFileTags: "custom5" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "reader2"; diff --git a/tests/auto/blackbox/testdata/assembly/assembly.qbs b/tests/auto/blackbox/testdata/assembly/assembly.qbs index 7dd82731a..f7bd4ecad 100644 --- a/tests/auto/blackbox/testdata/assembly/assembly.qbs +++ b/tests/auto/blackbox/testdata/assembly/assembly.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs b/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs index 6850ee138..92d5ec6dd 100644 --- a/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs +++ b/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { @@ -6,18 +5,18 @@ Project { name: "helper-app" type: ["application", "test-helper"] consoleApplication: true + install: true files: "helper-main.cpp" cpp.executableSuffix: ".exe" Group { fileTagsFilter: "application" fileTags: "test-helper" - qbs.install: true - qbs.installDir: "bin" } } CppApplication { name: "test-app" type: ["application", "autotest"] + Depends { name: "autotest" } files: "test-main.cpp" } diff --git a/tests/auto/blackbox/testdata/autotests/autotests.qbs b/tests/auto/blackbox/testdata/autotests/autotests.qbs new file mode 100644 index 000000000..a2c2646dc --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/autotests.qbs @@ -0,0 +1,4 @@ +Project { + references: ["test1", "test2", "test3"] + AutotestRunner {} +} diff --git a/tests/auto/blackbox/testdata/autotests/test1/test1.cpp b/tests/auto/blackbox/testdata/autotests/test1/test1.cpp new file mode 100644 index 000000000..08d9d4782 --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test1/test1.cpp @@ -0,0 +1,12 @@ +#include <cstdlib> +#include <iostream> + +int main(int argc, char *[]) +{ + if (argc != 2) { + std::cerr << "This test needs exactly one argument" << std::endl; + std::cerr << "FAIL" << std::endl; + return EXIT_FAILURE; + } + std::cout << "PASS" << std::endl; +} diff --git a/tests/auto/blackbox/testdata/autotests/test1/test1.qbs b/tests/auto/blackbox/testdata/autotests/test1/test1.qbs new file mode 100644 index 000000000..8b078a759 --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test1/test1.qbs @@ -0,0 +1,9 @@ +CppApplication { + name: "test1" + type: base.concat("autotest") + + Depends { name: "autotest" } + autotest.arguments: "--dummy" + + files: "test1.cpp" +} diff --git a/tests/auto/blackbox/testdata/autotests/test2/test2-resource.txt b/tests/auto/blackbox/testdata/autotests/test2/test2-resource.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test2/test2-resource.txt diff --git a/tests/auto/blackbox/testdata/autotests/test2/test2.cpp b/tests/auto/blackbox/testdata/autotests/test2/test2.cpp new file mode 100644 index 000000000..dcc3d270a --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test2/test2.cpp @@ -0,0 +1,13 @@ +#include <cstdlib> +#include <fstream> +#include <iostream> + +int main() +{ + std::ifstream input("test2-resource.txt"); + if (!input.is_open()) { + std::cerr << "Test resource not found"; + return EXIT_FAILURE; + } + std::cout << "PASS" << std::endl; +} diff --git a/tests/auto/blackbox/testdata/autotests/test2/test2.qbs b/tests/auto/blackbox/testdata/autotests/test2/test2.qbs new file mode 100644 index 000000000..2ce6ea5fa --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test2/test2.qbs @@ -0,0 +1,9 @@ +CppApplication { + name: "test2" + type: base.concat("autotest") + + Depends { name: "autotest" } + autotest.workingDir: sourceDirectory + + files: "test2.cpp" +} diff --git a/tests/auto/blackbox/testdata/autotests/test3/test3.cpp b/tests/auto/blackbox/testdata/autotests/test3/test3.cpp new file mode 100644 index 000000000..2ce7e2bf6 --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test3/test3.cpp @@ -0,0 +1,9 @@ +#include <cstdlib> +#include <iostream> + +int main() +{ + std::cerr << "I am an awful test"; + std::cerr << "FAIL" << std::endl; + return EXIT_FAILURE; +} diff --git a/tests/auto/blackbox/testdata/autotests/test3/test3.qbs b/tests/auto/blackbox/testdata/autotests/test3/test3.qbs new file mode 100644 index 000000000..34550dee7 --- /dev/null +++ b/tests/auto/blackbox/testdata/autotests/test3/test3.qbs @@ -0,0 +1,9 @@ +CppApplication { + name: "test3" + type: base.concat("autotest") + + Depends { name: "autotest" } + autotest.allowFailure: true + + files: "test3.cpp" +} diff --git a/tests/auto/blackbox/testdata/aux-inputs-from-deps/aux-inputs-from-deps.qbs b/tests/auto/blackbox/testdata/aux-inputs-from-deps/aux-inputs-from-deps.qbs index 620ae2ea0..6a9e9823d 100644 --- a/tests/auto/blackbox/testdata/aux-inputs-from-deps/aux-inputs-from-deps.qbs +++ b/tests/auto/blackbox/testdata/aux-inputs-from-deps/aux-inputs-from-deps.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs b/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs index a45391478..bef82a003 100644 --- a/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs +++ b/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs @@ -1,5 +1,3 @@ -import qbs - Project { qbsSearchPaths: base.concat(["qbs"]) diff --git a/tests/auto/blackbox/testdata/badInterpreter/qbs/modules/script-test/script-test.qbs b/tests/auto/blackbox/testdata/badInterpreter/qbs/modules/script-test/script-test.qbs index 79c008cf6..4d043ee59 100644 --- a/tests/auto/blackbox/testdata/badInterpreter/qbs/modules/script-test/script-test.qbs +++ b/tests/auto/blackbox/testdata/badInterpreter/qbs/modules/script-test/script-test.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/bom-sources/bom-sources.qbs b/tests/auto/blackbox/testdata/bom-sources/bom-sources.qbs index 8b5dbb238..4446355bc 100644 --- a/tests/auto/blackbox/testdata/bom-sources/bom-sources.qbs +++ b/tests/auto/blackbox/testdata/bom-sources/bom-sources.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" files: ["main.cpp", "theheader.h"] diff --git a/tests/auto/blackbox/testdata/build-data-of-disabled-product/build-data-of-disabled-product.qbs b/tests/auto/blackbox/testdata/build-data-of-disabled-product/build-data-of-disabled-product.qbs index 7e9d4779b..d71facf15 100644 --- a/tests/auto/blackbox/testdata/build-data-of-disabled-product/build-data-of-disabled-product.qbs +++ b/tests/auto/blackbox/testdata/build-data-of-disabled-product/build-data-of-disabled-product.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" files: ["main.cpp", "test.cpp"] diff --git a/tests/auto/blackbox/testdata/build-directories/build-directories.qbs b/tests/auto/blackbox/testdata/build-directories/build-directories.qbs index dd8fc6c05..be7672ecf 100644 --- a/tests/auto/blackbox/testdata/build-directories/build-directories.qbs +++ b/tests/auto/blackbox/testdata/build-directories/build-directories.qbs @@ -1,15 +1,10 @@ -import qbs - Project { Product { name: "p1" type: "blubb1" Rule { multiplex: true - Artifact { - filePath: "dummy1.txt" - fileTags: product.type - } + outputFileTags: "blubb1" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; @@ -26,10 +21,7 @@ Project { Depends { name: "p1" } Rule { inputsFromDependencies: "blubb1" - Artifact { - filePath: "dummy2.txt" - fileTags: product.type - } + outputFileTags: "blubb2" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/build-graph-versions/build-graph-versions.qbs b/tests/auto/blackbox/testdata/build-graph-versions/build-graph-versions.qbs index f6ae698a0..da7536315 100644 --- a/tests/auto/blackbox/testdata/build-graph-versions/build-graph-versions.qbs +++ b/tests/auto/blackbox/testdata/build-graph-versions/build-graph-versions.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.cpp"] } diff --git a/tests/auto/blackbox/testdata/buildenv-change/buildenv-change.qbs b/tests/auto/blackbox/testdata/buildenv-change/buildenv-change.qbs index c2445eafd..6c0bcc73e 100644 --- a/tests/auto/blackbox/testdata/buildenv-change/buildenv-change.qbs +++ b/tests/auto/blackbox/testdata/buildenv-change/buildenv-change.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Probe { id: dummy diff --git a/tests/auto/blackbox/testdata/change-in-disabled-product/change-in-disabled-product.qbs b/tests/auto/blackbox/testdata/change-in-disabled-product/change-in-disabled-product.qbs index 8a99d2c8c..2f0dfc08c 100644 --- a/tests/auto/blackbox/testdata/change-in-disabled-product/change-in-disabled-product.qbs +++ b/tests/auto/blackbox/testdata/change-in-disabled-product/change-in-disabled-product.qbs @@ -1,5 +1,3 @@ -import qbs - Product { condition: false files: [ diff --git a/tests/auto/blackbox/testdata/change-in-imported-file/change-in-imported-file.qbs b/tests/auto/blackbox/testdata/change-in-imported-file/change-in-imported-file.qbs index cb8bf0668..cf5354268 100644 --- a/tests/auto/blackbox/testdata/change-in-imported-file/change-in-imported-file.qbs +++ b/tests/auto/blackbox/testdata/change-in-imported-file/change-in-imported-file.qbs @@ -1,4 +1,3 @@ -import qbs import "prepare.js" as PrepareHelper Product { diff --git a/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs index 78bd8abda..d1215355c 100644 --- a/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs +++ b/tests/auto/blackbox/testdata/change-tracking-and-multiplexing/change-tracking-and-multiplexing.qbs @@ -1,5 +1,3 @@ -import qbs - StaticLibrary { name: "l" diff --git a/tests/auto/blackbox/testdata/changed-files/changed-files.qbs b/tests/auto/blackbox/testdata/changed-files/changed-files.qbs index dd222479f..e5790d2e9 100644 --- a/tests/auto/blackbox/testdata/changed-files/changed-files.qbs +++ b/tests/auto/blackbox/testdata/changed-files/changed-files.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile CppApplication { diff --git a/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/changed-inputs-from-dependencies.qbs b/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/changed-inputs-from-dependencies.qbs new file mode 100644 index 000000000..fb92d1838 --- /dev/null +++ b/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/changed-inputs-from-dependencies.qbs @@ -0,0 +1,58 @@ +import qbs.File +import qbs.TextFile + +Project { + Product { + name: "dep" + type: "dep_tag" + + files: "input.txt" + + FileTagger { patterns: "*.txt"; fileTags: "inp_tag" } + + Rule { + inputs: "inp_tag" + Artifact { filePath: input.baseName + ".intermediate"; fileTags: "int_tag" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); } + return cmd; + } + } + Rule { + inputs: "int_tag" + Artifact { filePath: input.baseName + ".dep"; fileTags: "dep_tag" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); } + return cmd; + } + } + } + Product { + name: "p" + type: "p_tag" + + Depends { name: "dep" } + + Rule { + inputsFromDependencies: "dep_tag" + outputFileTags: "p_tag" + outputArtifacts: { + var dummy = new TextFile(input.filePath, TextFile.ReadOnly); + dummy.close(); + return [{ filePath: input.baseName + ".p", fileTags: "p_tag" }] + } + + prepare: { + console.info("running final prepare script"); + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); } + return cmd; + } + } + } +} diff --git a/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/input.txt b/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/input.txt new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/auto/blackbox/testdata/changed-inputs-from-dependencies/input.txt diff --git a/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs b/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs index 8aef7b9b6..d11613c44 100644 --- a/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs +++ b/tests/auto/blackbox/testdata/changed-rule-inputs/changed-rule-inputs.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "p1" diff --git a/tests/auto/blackbox/testdata/check-timestamps/check-timestamps.qbs b/tests/auto/blackbox/testdata/check-timestamps/check-timestamps.qbs index 32456444c..65c29ca7a 100644 --- a/tests/auto/blackbox/testdata/check-timestamps/check-timestamps.qbs +++ b/tests/auto/blackbox/testdata/check-timestamps/check-timestamps.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" files: [ diff --git a/tests/auto/blackbox/testdata/choose-module-instance/choose-module-instance.qbs b/tests/auto/blackbox/testdata/choose-module-instance/choose-module-instance.qbs index 233e21746..5f4148624 100644 --- a/tests/auto/blackbox/testdata/choose-module-instance/choose-module-instance.qbs +++ b/tests/auto/blackbox/testdata/choose-module-instance/choose-module-instance.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/choose-module-instance/gerbil.txt.in b/tests/auto/blackbox/testdata/choose-module-instance/gerbil.txt.in index 53b91dbcd..4722829a3 100644 --- a/tests/auto/blackbox/testdata/choose-module-instance/gerbil.txt.in +++ b/tests/auto/blackbox/testdata/choose-module-instance/gerbil.txt.in @@ -1,5 +1,5 @@ I once had a gerbil named Bobby, Who had an unusual hobby. -He $DID on a $THING, -and now -- oh my $IDOL, +He ${DID} on a ${THING}, +and now -- oh my ${IDOL}, now all that's left is a blobby. diff --git a/tests/auto/blackbox/testdata/choose-module-instance/modules/texttemplate/texttemplate.qbs b/tests/auto/blackbox/testdata/choose-module-instance/modules/texttemplate/texttemplate.qbs deleted file mode 100644 index aca755373..000000000 --- a/tests/auto/blackbox/testdata/choose-module-instance/modules/texttemplate/texttemplate.qbs +++ /dev/null @@ -1,49 +0,0 @@ -import qbs.TextFile - -Module { - property var dict: ({}) - FileTagger { - patterns: ["*.in"] - fileTags: ["texttemplate.input"] - } - Rule { - inputs: ["texttemplate.input"] - Artifact { - fileTags: ["text"] - filePath: input.completeBaseName - } - prepare: { - var cmd = new JavaScriptCommand(); - cmd.silent = true; - cmd.sourceCode = function() { - try { - var src = new TextFile(input.filePath, TextFile.ReadOnly); - var dst = new TextFile(output.filePath, TextFile.WriteOnly); - var rex = /\$([A-Z]+)/g; - while (!src.atEof()) { - rex.lastIndex = 0; - var line = src.readLine(); - while (true) { - var result = rex.exec(line); - if (!result) - break; - var replacement = input.texttemplate.dict[result[1]]; - if (replacement) { - line = line.substr(0, result.index) - + replacement - + line.substr(result.index + result[0].length); - } - } - dst.writeLine(line); - } - } finally { - if (src) - src.close(); - if (dst) - dst.close(); - } - }; - return [cmd]; - } - } -} diff --git a/tests/auto/blackbox/testdata/clean/clean.qbs b/tests/auto/blackbox/testdata/clean/clean.qbs index 28ebe91f0..ce3a8eb12 100644 --- a/tests/auto/blackbox/testdata/clean/clean.qbs +++ b/tests/auto/blackbox/testdata/clean/clean.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { DynamicLibrary { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/cli/dotnettest.qbs b/tests/auto/blackbox/testdata/cli/dotnettest.qbs index c65a54c8c..9a10b8068 100644 --- a/tests/auto/blackbox/testdata/cli/dotnettest.qbs +++ b/tests/auto/blackbox/testdata/cli/dotnettest.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Application { Depends { name: "cli" } diff --git a/tests/auto/blackbox/testdata/cli/fshello.qbs b/tests/auto/blackbox/testdata/cli/fshello.qbs index 44dbb5c4f..0d503d90f 100644 --- a/tests/auto/blackbox/testdata/cli/fshello.qbs +++ b/tests/auto/blackbox/testdata/cli/fshello.qbs @@ -1,5 +1,3 @@ -import qbs - Application { Depends { name: "cli" } type: "application" diff --git a/tests/auto/blackbox/testdata/combined-sources/combined-sources.qbs b/tests/auto/blackbox/testdata/combined-sources/combined-sources.qbs index c22b41c4f..277fc7c3a 100644 --- a/tests/auto/blackbox/testdata/combined-sources/combined-sources.qbs +++ b/tests/auto/blackbox/testdata/combined-sources/combined-sources.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "theapp" files: [ diff --git a/tests/auto/blackbox/testdata/command-file/command-file.qbs b/tests/auto/blackbox/testdata/command-file/command-file.qbs index fb46a0712..8e25221c5 100644 --- a/tests/auto/blackbox/testdata/command-file/command-file.qbs +++ b/tests/auto/blackbox/testdata/command-file/command-file.qbs @@ -1,5 +1,3 @@ -import qbs - Project { StaticLibrary { name: "theLib" diff --git a/tests/auto/blackbox/testdata/compilerDefinesByLanguage/CppDefinesApp.qbs b/tests/auto/blackbox/testdata/compilerDefinesByLanguage/CppDefinesApp.qbs index da58f750a..b205ef2a7 100644 --- a/tests/auto/blackbox/testdata/compilerDefinesByLanguage/CppDefinesApp.qbs +++ b/tests/auto/blackbox/testdata/compilerDefinesByLanguage/CppDefinesApp.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["app.c"] diff --git a/tests/auto/blackbox/testdata/compilerDefinesByLanguage/compilerDefinesByLanguage.qbs b/tests/auto/blackbox/testdata/compilerDefinesByLanguage/compilerDefinesByLanguage.qbs index b4b126a50..001a87745 100644 --- a/tests/auto/blackbox/testdata/compilerDefinesByLanguage/compilerDefinesByLanguage.qbs +++ b/tests/auto/blackbox/testdata/compilerDefinesByLanguage/compilerDefinesByLanguage.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppDefinesApp { name: "A" diff --git a/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs b/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs index 9031890bd..802aa1450 100644 --- a/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs +++ b/tests/auto/blackbox/testdata/concurrent-executor/concurrent-executor.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.TextFile import "util.js" as Utils @@ -52,10 +51,7 @@ Product { } Rule { inputs: ["intermediate"] - Artifact { - filePath: "dummy2.final" - fileTags: ["final2"] - } + outputFileTags: "final2" prepare: { do Utils.sleep(6000); diff --git a/tests/auto/blackbox/testdata/conditional-export/conditional-export.qbs b/tests/auto/blackbox/testdata/conditional-export/conditional-export.qbs index c7b6ae09d..0f2fb2f49 100644 --- a/tests/auto/blackbox/testdata/conditional-export/conditional-export.qbs +++ b/tests/auto/blackbox/testdata/conditional-export/conditional-export.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property bool enableExport: false Product { diff --git a/tests/auto/blackbox/testdata/conditional-filetagger/conditional-filetagger.qbs b/tests/auto/blackbox/testdata/conditional-filetagger/conditional-filetagger.qbs index 286eb620a..5f0c93e46 100644 --- a/tests/auto/blackbox/testdata/conditional-filetagger/conditional-filetagger.qbs +++ b/tests/auto/blackbox/testdata/conditional-filetagger/conditional-filetagger.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "theApp" property bool enableTagger diff --git a/tests/auto/blackbox/testdata/configure/configure.qbs b/tests/auto/blackbox/testdata/configure/configure.qbs index 1a3c02bb5..af5638dde 100644 --- a/tests/auto/blackbox/testdata/configure/configure.qbs +++ b/tests/auto/blackbox/testdata/configure/configure.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/configure/modules/definition/module.qbs b/tests/auto/blackbox/testdata/configure/modules/definition/module.qbs index 56a5492e4..1d647faa2 100644 --- a/tests/auto/blackbox/testdata/configure/modules/definition/module.qbs +++ b/tests/auto/blackbox/testdata/configure/modules/definition/module.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.Process Module { diff --git a/tests/auto/blackbox/testdata/conflicting-artifacts/conflicting-artifacts.qbs b/tests/auto/blackbox/testdata/conflicting-artifacts/conflicting-artifacts.qbs index f2c5cb2bc..ade073e15 100644 --- a/tests/auto/blackbox/testdata/conflicting-artifacts/conflicting-artifacts.qbs +++ b/tests/auto/blackbox/testdata/conflicting-artifacts/conflicting-artifacts.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "a" diff --git a/tests/auto/blackbox/testdata/cpu-features/cpu-features.qbs b/tests/auto/blackbox/testdata/cpu-features/cpu-features.qbs index 62f163a95..0bfdaceba 100644 --- a/tests/auto/blackbox/testdata/cpu-features/cpu-features.qbs +++ b/tests/auto/blackbox/testdata/cpu-features/cpu-features.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "cpufeatures" } cpufeatures.x86_sse2: true diff --git a/tests/auto/blackbox/testdata/cxx-language-version/cxx-language-version.qbs b/tests/auto/blackbox/testdata/cxx-language-version/cxx-language-version.qbs index e0301eee1..6beaabfa3 100644 --- a/tests/auto/blackbox/testdata/cxx-language-version/cxx-language-version.qbs +++ b/tests/auto/blackbox/testdata/cxx-language-version/cxx-language-version.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" diff --git a/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs b/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs index ea32bbb52..735bfffbc 100644 --- a/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs +++ b/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.TextFile import qbs.FileInfo diff --git a/tests/auto/blackbox/testdata/dependency-profile-mismatch/dependency-profile-mismatch.qbs b/tests/auto/blackbox/testdata/dependency-profile-mismatch/dependency-profile-mismatch.qbs index ef2dee093..8a6f733c0 100644 --- a/tests/auto/blackbox/testdata/dependency-profile-mismatch/dependency-profile-mismatch.qbs +++ b/tests/auto/blackbox/testdata/dependency-profile-mismatch/dependency-profile-mismatch.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property string mainProfile property string depProfile diff --git a/tests/auto/blackbox/testdata/disappeared-profile/disappeared-profile.qbs b/tests/auto/blackbox/testdata/disappeared-profile/disappeared-profile.qbs index 659864b14..f1460aea5 100644 --- a/tests/auto/blackbox/testdata/disappeared-profile/disappeared-profile.qbs +++ b/tests/auto/blackbox/testdata/disappeared-profile/disappeared-profile.qbs @@ -1,5 +1,3 @@ -import qbs - Product { type: ["out1", "out2"] Depends { name: "m" } diff --git a/tests/auto/blackbox/testdata/disappeared-profile/modules-dir/modules/m/m.qbs b/tests/auto/blackbox/testdata/disappeared-profile/modules-dir/modules/m/m.qbs index a9c898889..3e1747ade 100644 --- a/tests/auto/blackbox/testdata/disappeared-profile/modules-dir/modules/m/m.qbs +++ b/tests/auto/blackbox/testdata/disappeared-profile/modules-dir/modules/m/m.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property string p1 property string p2 diff --git a/tests/auto/blackbox/testdata/discard-unused-data/discard-unused-data.qbs b/tests/auto/blackbox/testdata/discard-unused-data/discard-unused-data.qbs index 6f433cf63..fdd3aa1f7 100644 --- a/tests/auto/blackbox/testdata/discard-unused-data/discard-unused-data.qbs +++ b/tests/auto/blackbox/testdata/discard-unused-data/discard-unused-data.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" type: base.concat("custom") @@ -14,10 +12,7 @@ CppApplication { Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["custom"] - } + outputFileTags: "custom" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/driver-linker-flags/driver-linker-flags.qbs b/tests/auto/blackbox/testdata/driver-linker-flags/driver-linker-flags.qbs index 0802bc562..5de0fe053 100644 --- a/tests/auto/blackbox/testdata/driver-linker-flags/driver-linker-flags.qbs +++ b/tests/auto/blackbox/testdata/driver-linker-flags/driver-linker-flags.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: "main.cpp" diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/Dll.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/Dll.qbs index 48a90759a..1acf606dc 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/Dll.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/Dll.qbs @@ -1,5 +1,3 @@ -import qbs - DynamicLibrary { Depends { name: "cpp" } Depends { name: "bundle"; condition: qbs.targetOS.contains("darwin") } @@ -9,8 +7,9 @@ DynamicLibrary { cpp.minimumMacosVersion: "10.7" // For -rpath } - Group { - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - } + install: true + installImportLib: true + qbs.installPrefix: "" + installDir: "" + importLibInstallDir: "" } diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thelib/thelib.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thelib/thelib.qbs index 41a6436d0..30f87337d 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thelib/thelib.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thelib/thelib.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Module { @@ -14,7 +13,7 @@ Module { } Group { name: "thelib dll import" - condition: qbs.targetOS.contains("windows") && !qbs.toolchain.contains("mingw") + condition: qbs.targetOS.contains("windows") files: FileInfo.joinPaths(product.thelib.baseDir, "thelib.lib") fileTags: ["dynamiclibrary_import"] filesAreTargets: true diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/theotherlib/theotherlib.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/theotherlib/theotherlib.qbs index 2a9a7314f..1eb1e01a5 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/theotherlib/theotherlib.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/theotherlib/theotherlib.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Module { @@ -14,7 +13,7 @@ Module { } Group { name: "theotherlib dll import" - condition: qbs.targetOS.contains("windows") && !qbs.toolchain.contains("mingw") + condition: qbs.targetOS.contains("windows") files: FileInfo.joinPaths(product.theotherlib.baseDir, "theotherlib.lib") fileTags: ["dynamiclibrary_import"] filesAreTargets: true diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thethirdlib/thethirdlib.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thethirdlib/thethirdlib.qbs index d422d3f2c..b4592f514 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thethirdlib/thethirdlib.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/modules/thethirdlib/thethirdlib.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Module { diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs index 725968dae..b9149d091 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "theapp" diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/thelibs.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/thelibs.qbs index 361642cca..b06a3f171 100644 --- a/tests/auto/blackbox/testdata/dynamic-library-in-module/thelibs.qbs +++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/thelibs.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Dll { name: "thelib" diff --git a/tests/auto/blackbox/testdata/dynamic-project/dynamic-project.qbs b/tests/auto/blackbox/testdata/dynamic-project/dynamic-project.qbs index eb7c56738..166648c80 100644 --- a/tests/auto/blackbox/testdata/dynamic-project/dynamic-project.qbs +++ b/tests/auto/blackbox/testdata/dynamic-project/dynamic-project.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.FileInfo import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/dynamicMultiplexRule/dynamicMultiplexRule.qbs b/tests/auto/blackbox/testdata/dynamicMultiplexRule/dynamicMultiplexRule.qbs index d5315ac45..b8adcaf4b 100644 --- a/tests/auto/blackbox/testdata/dynamicMultiplexRule/dynamicMultiplexRule.qbs +++ b/tests/auto/blackbox/testdata/dynamicMultiplexRule/dynamicMultiplexRule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs index 04820e18f..00c93a2ac 100644 --- a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs +++ b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs @@ -35,7 +35,6 @@ ** ****************************************************************************/ -import qbs 1.0 import qbs.FileInfo import qbs.Probes import qbs.TextFile @@ -54,7 +53,7 @@ Project { Probes.PathProbe { id: flexProbe names: ["flex"] - platformPaths: ["/usr/local/bin", "/usr/bin", "/bin"] + platformSearchPaths: ["/usr/local/bin", "/usr/bin", "/bin"] } property bool isFlexAvailable: flexProbe.found Rule { diff --git a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objc.qbs b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objc.qbs index 74738ad12..eef00da78 100644 --- a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objc.qbs +++ b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objc.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.m"] cpp.frameworks: ["Foundation"] diff --git a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp-cpp.qbs b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp-cpp.qbs index b6db6879b..7f703b9ad 100644 --- a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp-cpp.qbs +++ b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp-cpp.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Group { files: ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp.qbs b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp.qbs index 8efb5d585..8946f9a38 100644 --- a/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp.qbs +++ b/tests/auto/blackbox/testdata/enableExceptions/exceptions-objcpp.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Group { files: ["main.m"] diff --git a/tests/auto/blackbox/testdata/enableExceptions/exceptions.qbs b/tests/auto/blackbox/testdata/enableExceptions/exceptions.qbs index da6fdbc2d..9a75043a8 100644 --- a/tests/auto/blackbox/testdata/enableExceptions/exceptions.qbs +++ b/tests/auto/blackbox/testdata/enableExceptions/exceptions.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.cpp"] cpp.treatWarningsAsErrors: true diff --git a/tests/auto/blackbox/testdata/enableExceptions/none.qbs b/tests/auto/blackbox/testdata/enableExceptions/none.qbs index 332af7614..8fb052476 100644 --- a/tests/auto/blackbox/testdata/enableExceptions/none.qbs +++ b/tests/auto/blackbox/testdata/enableExceptions/none.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["emptymain.cpp"] diff --git a/tests/auto/blackbox/testdata/enableRtti/rtti.qbs b/tests/auto/blackbox/testdata/enableRtti/rtti.qbs index f032bb16b..85bfa9c1d 100644 --- a/tests/auto/blackbox/testdata/enableRtti/rtti.qbs +++ b/tests/auto/blackbox/testdata/enableRtti/rtti.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property bool treatAsObjcpp: false CppApplication { diff --git a/tests/auto/blackbox/testdata/env-merging/env-merging.qbs b/tests/auto/blackbox/testdata/env-merging/env-merging.qbs index 7f3f73550..6edeca444 100644 --- a/tests/auto/blackbox/testdata/env-merging/env-merging.qbs +++ b/tests/auto/blackbox/testdata/env-merging/env-merging.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "tool" @@ -12,10 +10,7 @@ Project { Depends { name: "tool" } Rule { inputsFromDependencies: "application" - Artifact { - filePath: "dummy" - fileTags: "custom" - } + outputFileTags: "custom" prepare: { var cmd = new Command(input.filePath, []); cmd.description = "running tool"; diff --git a/tests/auto/blackbox/testdata/env-normalization/env-normalization.qbs b/tests/auto/blackbox/testdata/env-normalization/env-normalization.qbs index a197208fb..3b242aeb0 100644 --- a/tests/auto/blackbox/testdata/env-normalization/env-normalization.qbs +++ b/tests/auto/blackbox/testdata/env-normalization/env-normalization.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment Product { diff --git a/tests/auto/blackbox/testdata/erroneous/nonexistentWorkingDir/nonexistentWorkingDir.qbs b/tests/auto/blackbox/testdata/erroneous/nonexistentWorkingDir/nonexistentWorkingDir.qbs index 8cf1bfaad..6a763e1ad 100644 --- a/tests/auto/blackbox/testdata/erroneous/nonexistentWorkingDir/nonexistentWorkingDir.qbs +++ b/tests/auto/blackbox/testdata/erroneous/nonexistentWorkingDir/nonexistentWorkingDir.qbs @@ -1,5 +1,3 @@ -import qbs - Application { name: "kaputt" type: ["nutritious"] diff --git a/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-filePath/outputArtifacts-missing-filePath.qbs b/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-filePath/outputArtifacts-missing-filePath.qbs index 7a6c3a25d..047ddb862 100644 --- a/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-filePath/outputArtifacts-missing-filePath.qbs +++ b/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-filePath/outputArtifacts-missing-filePath.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - CppApplication { type: base.concat("txt") files : ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-fileTags/outputArtifacts-missing-fileTags.qbs b/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-fileTags/outputArtifacts-missing-fileTags.qbs index 9b71cf73a..8b7b9482e 100644 --- a/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-fileTags/outputArtifacts-missing-fileTags.qbs +++ b/tests/auto/blackbox/testdata/erroneous/outputArtifacts-missing-fileTags/outputArtifacts-missing-fileTags.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - CppApplication { type: base.concat("txt") files : ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/erroneous/tag-mismatch/tag-mismatch.qbs b/tests/auto/blackbox/testdata/erroneous/tag-mismatch/tag-mismatch.qbs new file mode 100644 index 000000000..51ea28e99 --- /dev/null +++ b/tests/auto/blackbox/testdata/erroneous/tag-mismatch/tag-mismatch.qbs @@ -0,0 +1,35 @@ +Product { + name: "p" + type: "p_type" + Rule { + multiplex: true + outputFileTags: ["x"] + outputArtifacts: [{filePath: "dummy1", fileTags: ["x","y","z"]}] + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { }; + return cmd; + } + } + Rule { + inputs: ["y"] + Artifact { filePath: "dummy2"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { }; + return cmd; + } + } + Rule { + inputs: ["x"] + Artifact { filePath: "dummy3"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { }; + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/boom.txt.in b/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/boom.txt.in new file mode 100644 index 000000000..359e856ec --- /dev/null +++ b/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/boom.txt.in @@ -0,0 +1 @@ +Boom! shake-shake-shake the ${what}! diff --git a/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/texttemplate-unknown-placeholder.qbs b/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/texttemplate-unknown-placeholder.qbs new file mode 100644 index 000000000..01963292a --- /dev/null +++ b/tests/auto/blackbox/testdata/erroneous/texttemplate-unknown-placeholder/texttemplate-unknown-placeholder.qbs @@ -0,0 +1,6 @@ +Product { + type: ["text"] + Depends { name: "texttemplate" } + texttemplate.dict: ({ wat: "room" }) // typo in key name + files: [ "boom.txt.in" ] +} diff --git a/tests/auto/blackbox/testdata/error-info/error-info.qbs b/tests/auto/blackbox/testdata/error-info/error-info.qbs index afd44c246..b8f42b4b2 100644 --- a/tests/auto/blackbox/testdata/error-info/error-info.qbs +++ b/tests/auto/blackbox/testdata/error-info/error-info.qbs @@ -1,4 +1,3 @@ -import qbs import "helper.js" as Helper Project { diff --git a/tests/auto/blackbox/testdata/escaped-linker-flags/escaped-linker-flags.qbs b/tests/auto/blackbox/testdata/escaped-linker-flags/escaped-linker-flags.qbs index e136acb30..f48bf8d1f 100644 --- a/tests/auto/blackbox/testdata/escaped-linker-flags/escaped-linker-flags.qbs +++ b/tests/auto/blackbox/testdata/escaped-linker-flags/escaped-linker-flags.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" property bool escapeLinkerFlags diff --git a/tests/auto/blackbox/testdata/explicitly-depends-on/explicitly-depends-on.qbs b/tests/auto/blackbox/testdata/explicitly-depends-on/explicitly-depends-on.qbs index 10cfa089b..4f190c23d 100644 --- a/tests/auto/blackbox/testdata/explicitly-depends-on/explicitly-depends-on.qbs +++ b/tests/auto/blackbox/testdata/explicitly-depends-on/explicitly-depends-on.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/explicitly-depends-on/modules/module1/module1.qbs b/tests/auto/blackbox/testdata/explicitly-depends-on/modules/module1/module1.qbs index f1752b4ed..b710c4e21 100644 --- a/tests/auto/blackbox/testdata/explicitly-depends-on/modules/module1/module1.qbs +++ b/tests/auto/blackbox/testdata/explicitly-depends-on/modules/module1/module1.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Group { filesAreTargets: true diff --git a/tests/auto/blackbox/testdata/export-rule/export-rule.qbs b/tests/auto/blackbox/testdata/export-rule/export-rule.qbs index 0b1f9f99b..29899e728 100644 --- a/tests/auto/blackbox/testdata/export-rule/export-rule.qbs +++ b/tests/auto/blackbox/testdata/export-rule/export-rule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Project { diff --git a/tests/auto/blackbox/testdata/export-to-outside-searchpath/export-to-outside-searchpath.qbs b/tests/auto/blackbox/testdata/export-to-outside-searchpath/export-to-outside-searchpath.qbs index 72c48b75a..42e17486f 100644 --- a/tests/auto/blackbox/testdata/export-to-outside-searchpath/export-to-outside-searchpath.qbs +++ b/tests/auto/blackbox/testdata/export-to-outside-searchpath/export-to-outside-searchpath.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Project { qbsSearchPaths: ["qbs-resources"] diff --git a/tests/auto/blackbox/testdata/export-to-outside-searchpath/qbs-resources/modules/aModule/aModule.qbs b/tests/auto/blackbox/testdata/export-to-outside-searchpath/qbs-resources/modules/aModule/aModule.qbs index 3e67ba10d..84957060c 100644 --- a/tests/auto/blackbox/testdata/export-to-outside-searchpath/qbs-resources/modules/aModule/aModule.qbs +++ b/tests/auto/blackbox/testdata/export-to-outside-searchpath/qbs-resources/modules/aModule/aModule.qbs @@ -1,4 +1,2 @@ -import qbs - Module { } diff --git a/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/exported-dependency-in-disabled-product.qbs b/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/exported-dependency-in-disabled-product.qbs index 9904502a6..ac6022b9d 100644 --- a/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/exported-dependency-in-disabled-product.qbs +++ b/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/exported-dependency-in-disabled-product.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Application { name: "app" diff --git a/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/modules/broken/broken.qbs b/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/modules/broken/broken.qbs index 92f01d5d3..328e5f558 100644 --- a/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/modules/broken/broken.qbs +++ b/tests/auto/blackbox/testdata/exported-dependency-in-disabled-product/modules/broken/broken.qbs @@ -1,5 +1,3 @@ -import qbs - Module { validate: { throw "broken!"; } } diff --git a/tests/auto/blackbox/testdata/exported-property-in-disabled-product/exported-property-in-disabled-product.qbs b/tests/auto/blackbox/testdata/exported-property-in-disabled-product/exported-property-in-disabled-product.qbs index 2717466b0..ff8beb347 100644 --- a/tests/auto/blackbox/testdata/exported-property-in-disabled-product/exported-property-in-disabled-product.qbs +++ b/tests/auto/blackbox/testdata/exported-property-in-disabled-product/exported-property-in-disabled-product.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "app" diff --git a/tests/auto/blackbox/testdata/exported-property-in-disabled-product/modules/broken/broken.qbs b/tests/auto/blackbox/testdata/exported-property-in-disabled-product/modules/broken/broken.qbs index 92f01d5d3..328e5f558 100644 --- a/tests/auto/blackbox/testdata/exported-property-in-disabled-product/modules/broken/broken.qbs +++ b/tests/auto/blackbox/testdata/exported-property-in-disabled-product/modules/broken/broken.qbs @@ -1,5 +1,3 @@ -import qbs - Module { validate: { throw "broken!"; } } diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs index 7934dc3c9..96d1cabb9 100644 --- a/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { @@ -85,14 +84,21 @@ Project { Depends { name: "cpp" } cpp.defines: ["SECONDLIB"] + qbs.installPrefix: "" + Depends { name: "TheFirstLib" } Export { Depends { name: "TheFirstLib" } Depends { name: "dummy" } Depends { name: "cpp" } - cpp.includePaths: ["/opt/thesecondlib/include", product.sourceDirectory] + cpp.includePaths: [ + "/opt/thesecondlib/include", + product.sourceDirectory, + importingProduct.buildDirectory + ] property string hurz: importingProduct.name + cpp.defines: hurz.toUpperCase() Rule { property int n: 5 diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs index b753ec295..c898e91d1 100644 --- a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper1/helper1.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } Depends { name: "helper2" } diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs index 9d24a812d..2dbdfdb01 100644 --- a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper2/helper2.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.includePaths: "/somedir/include2" diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs index 452191994..57e65f2f9 100644 --- a/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs +++ b/tests/auto/blackbox/testdata/exports-pkgconfig/modules/helper3/helper3.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.includePaths: "/somedir/include3" diff --git a/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs b/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs index 252cb8291..02affdfe8 100644 --- a/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs +++ b/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "consumer" qbsSearchPaths: "default/install-root/usr/qbs" diff --git a/tests/auto/blackbox/testdata/exports-qbs/exports-qbs.qbs b/tests/auto/blackbox/testdata/exports-qbs/exports-qbs.qbs index 2bad55aaa..27e417ef9 100644 --- a/tests/auto/blackbox/testdata/exports-qbs/exports-qbs.qbs +++ b/tests/auto/blackbox/testdata/exports-qbs/exports-qbs.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/exports-qbs/lib.qbs b/tests/auto/blackbox/testdata/exports-qbs/lib.qbs index 6ae0885d5..53a472dbb 100644 --- a/tests/auto/blackbox/testdata/exports-qbs/lib.qbs +++ b/tests/auto/blackbox/testdata/exports-qbs/lib.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo DynamicLibrary { @@ -28,11 +27,9 @@ DynamicLibrary { qbs.install: true qbs.installDir: headersInstallDir } - Group { - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - qbs.installDir: "lib" - } + install: true + installImportLib: true + installDir: "lib" Group { fileTagsFilter: ["Exporter.qbs.module"] qbs.install: true diff --git a/tests/auto/blackbox/testdata/exports-qbs/tool.qbs b/tests/auto/blackbox/testdata/exports-qbs/tool.qbs index b0078a75c..655597cf7 100644 --- a/tests/auto/blackbox/testdata/exports-qbs/tool.qbs +++ b/tests/auto/blackbox/testdata/exports-qbs/tool.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import "helper.js" as Helper @@ -11,6 +10,7 @@ CppApplication { Depends { name: "Exporter.qbs" } Exporter.qbs.artifactTypes: ["installable", "blubb"] files: ["tool.cpp"] + install: true qbs.installPrefix: project.installPrefix Group { files: ["helper.js"] @@ -25,8 +25,6 @@ CppApplication { Group { fileTagsFilter: ["application"] - qbs.install: true - qbs.installDir: "bin" fileTags: toolTags } Group { diff --git a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs index d2e983c3e..619f40867 100644 --- a/tests/auto/blackbox/testdata/external-libs/external-libs.qbs +++ b/tests/auto/blackbox/testdata/external-libs/external-libs.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/fileDependencies/fileDependencies.qbs b/tests/auto/blackbox/testdata/fileDependencies/fileDependencies.qbs index e99e0932c..49f413807 100644 --- a/tests/auto/blackbox/testdata/fileDependencies/fileDependencies.qbs +++ b/tests/auto/blackbox/testdata/fileDependencies/fileDependencies.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { type: "application" diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs b/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs new file mode 100644 index 000000000..890fc51ce --- /dev/null +++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs @@ -0,0 +1,9 @@ +CppApplication { + consoleApplication: true + Group { + fileTagsFilter: "application" + qbs.install:true + qbs.installPrefix: product.name + qbs.installDir: "wrong" + } +} diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs b/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs new file mode 100644 index 000000000..eee20782e --- /dev/null +++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs @@ -0,0 +1,28 @@ +import qbs.TextFile + +MyApplication { + name: "myapp" + type: base.concat("extra-output") + files: "main.cpp" + Group { + fileTagsFilter: "application" + qbs.installDir: "binDir" + fileTags: "extra-input" + } + Rule { + inputs: "extra-input" + Artifact { + filePath: input.baseName + ".txt" + fileTags: "extra-output" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + } + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp b/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp new file mode 100644 index 000000000..237c8ce18 --- /dev/null +++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/tests/auto/blackbox/testdata/find/find-cli.qbs b/tests/auto/blackbox/testdata/find/find-cli.qbs index 63609b3b2..20d94803e 100644 --- a/tests/auto/blackbox/testdata/find/find-cli.qbs +++ b/tests/auto/blackbox/testdata/find/find-cli.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs index f26d92262..7ed5f5d96 100644 --- a/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs +++ b/tests/auto/blackbox/testdata/generated-artifact-as-input-to-dynamic-rule/p.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.TextFile @@ -46,8 +45,8 @@ Product { var cmd = new JavaScriptCommand(); var output = outputs["mytype.final"][0]; cmd.description = "generating " + output.fileName; - cmd.output = output; - cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + cmd.outputFilePath = output.filePath; + cmd.sourceCode = function() { File.copy(input.filePath, outputFilePath); }; return [cmd]; } } diff --git a/tests/auto/blackbox/testdata/generator/generator.qbs b/tests/auto/blackbox/testdata/generator/generator.qbs index 18f2caaea..d0857beb5 100644 --- a/tests/auto/blackbox/testdata/generator/generator.qbs +++ b/tests/auto/blackbox/testdata/generator/generator.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile CppApplication { diff --git a/tests/auto/blackbox/testdata/group-condition-change/group-condition-change.qbs b/tests/auto/blackbox/testdata/group-condition-change/group-condition-change.qbs index d8dccde39..ae1811375 100644 --- a/tests/auto/blackbox/testdata/group-condition-change/group-condition-change.qbs +++ b/tests/auto/blackbox/testdata/group-condition-change/group-condition-change.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property bool kaputt: true Product { diff --git a/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs b/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs index 5fa09c4d0..7347b1211 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { Depends { name: "dep" } diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper/helper.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper/helper.qbs index 3154986a6..cbd30a35d 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper/helper.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper/helper.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Module { diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper2/helper2.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper2/helper2.qbs index fbf15f6da..18d11c8f5 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper2/helper2.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper2/helper2.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper3/helper3.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper3/helper3.qbs index 00c619a38..de3e6171c 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper3/helper3.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper3/helper3.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper4/helper4.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper4/helper4.qbs index e2d668209..18dce4dc5 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper4/helper4.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper4/helper4.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } Depends { name: "helper5" } diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper5/helper5.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper5/helper5.qbs index 3e4e8923e..58c8144d6 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper5/helper5.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper5/helper5.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } Depends { diff --git a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper6/helper6.qbs b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper6/helper6.qbs index 736572570..8f73567e6 100644 --- a/tests/auto/blackbox/testdata/groups-in-modules/modules/helper6/helper6.qbs +++ b/tests/auto/blackbox/testdata/groups-in-modules/modules/helper6/helper6.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/ico/ico.qbs b/tests/auto/blackbox/testdata/ico/ico.qbs index 920189b85..e9d635820 100644 --- a/tests/auto/blackbox/testdata/ico/ico.qbs +++ b/tests/auto/blackbox/testdata/ico/ico.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { Depends { name: "ico" } diff --git a/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs b/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs index 2bff00f35..f5efbd14b 100644 --- a/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs +++ b/tests/auto/blackbox/testdata/import-assignment/import-assignment.qbs @@ -1,4 +1,3 @@ -import qbs import MyImport Product { diff --git a/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking-product.qbs b/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking-product.qbs index c229de889..c86a1bbb7 100644 --- a/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking-product.qbs +++ b/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking-product.qbs @@ -1,4 +1,3 @@ -import qbs import "irrelevant.js" as Irrelevant import "custom1prepare1.js" as Custom1Prepare import "custom2prepare" as Custom2Prepare diff --git a/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking.qbs b/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking.qbs index 009c0897f..c97e0c7f8 100644 --- a/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/import-change-tracking/import-change-tracking.qbs @@ -1,5 +1,3 @@ -import qbs - Project { qbsSearchPaths: ["."] references: "import-change-tracking-product.qbs" diff --git a/tests/auto/blackbox/testdata/import-in-properties-condition/import-in-properties-condition.qbs b/tests/auto/blackbox/testdata/import-in-properties-condition/import-in-properties-condition.qbs index 32b8d2a03..d4ed153af 100644 --- a/tests/auto/blackbox/testdata/import-in-properties-condition/import-in-properties-condition.qbs +++ b/tests/auto/blackbox/testdata/import-in-properties-condition/import-in-properties-condition.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "amodule" } } diff --git a/tests/auto/blackbox/testdata/import-in-properties-condition/modules/amodule/m.qbs b/tests/auto/blackbox/testdata/import-in-properties-condition/modules/amodule/m.qbs index 92ea2cd45..3402b16de 100644 --- a/tests/auto/blackbox/testdata/import-in-properties-condition/modules/amodule/m.qbs +++ b/tests/auto/blackbox/testdata/import-in-properties-condition/modules/amodule/m.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Module { diff --git a/tests/auto/blackbox/testdata/import-in-properties-condition/modules/depmodule/m.qbs b/tests/auto/blackbox/testdata/import-in-properties-condition/modules/depmodule/m.qbs index 4c2f9281d..3a4266b78 100644 --- a/tests/auto/blackbox/testdata/import-in-properties-condition/modules/depmodule/m.qbs +++ b/tests/auto/blackbox/testdata/import-in-properties-condition/modules/depmodule/m.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property string prop } diff --git a/tests/auto/blackbox/testdata/import-searchpath/import-searchpath.qbs b/tests/auto/blackbox/testdata/import-searchpath/import-searchpath.qbs index b4d0194a2..3dbb1f641 100644 --- a/tests/auto/blackbox/testdata/import-searchpath/import-searchpath.qbs +++ b/tests/auto/blackbox/testdata/import-searchpath/import-searchpath.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Project { qbsSearchPaths: ["qbs"] diff --git a/tests/auto/blackbox/testdata/import-searchpath/qbs/imports/CppApplication.qbs b/tests/auto/blackbox/testdata/import-searchpath/qbs/imports/CppApplication.qbs index 18dc695f3..bdef20fd8 100644 --- a/tests/auto/blackbox/testdata/import-searchpath/qbs/imports/CppApplication.qbs +++ b/tests/auto/blackbox/testdata/import-searchpath/qbs/imports/CppApplication.qbs @@ -1,4 +1,2 @@ -import qbs - Product { } diff --git a/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app1.qbs b/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app1.qbs index c12158d24..a973a2722 100644 --- a/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app1.qbs +++ b/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app1.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["somefile.cpp"] } diff --git a/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app2.qbs b/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app2.qbs index f6ae698a0..da7536315 100644 --- a/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app2.qbs +++ b/tests/auto/blackbox/testdata/import-searchpath/src/import-searchpath-app2.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.cpp"] } diff --git a/tests/auto/blackbox/testdata/importing-product/importing-product.qbs b/tests/auto/blackbox/testdata/importing-product/importing-product.qbs index e81f76077..dfc4cd65e 100644 --- a/tests/auto/blackbox/testdata/importing-product/importing-product.qbs +++ b/tests/auto/blackbox/testdata/importing-product/importing-product.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Project { diff --git a/tests/auto/blackbox/testdata/imports-conflict/imports-conflict.qbs b/tests/auto/blackbox/testdata/imports-conflict/imports-conflict.qbs index 1c6be24bd..4966b2f09 100644 --- a/tests/auto/blackbox/testdata/imports-conflict/imports-conflict.qbs +++ b/tests/auto/blackbox/testdata/imports-conflict/imports-conflict.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "Utils" diff --git a/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs b/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs index 452e4b5bd..182d1e232 100644 --- a/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs +++ b/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs b/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs index e894cfd49..8762a780a 100644 --- a/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs +++ b/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.Probes Module { @@ -8,7 +7,7 @@ Module { Probes.IncludeProbe { id: includeNode names: "fakeopenssl/sha.h" - platformPaths: [modulePath] + platformSearchPaths: [modulePath] } cpp.defines: includeNode.found ? 'TEXT="' + includeNode.path + '"' : undefined } diff --git a/tests/auto/blackbox/testdata/innosetup/innosetup.qbs b/tests/auto/blackbox/testdata/innosetup/innosetup.qbs index 679f1de8f..c9f6a22e8 100644 --- a/tests/auto/blackbox/testdata/innosetup/innosetup.qbs +++ b/tests/auto/blackbox/testdata/innosetup/innosetup.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/innosetupDependencies/innosetupDependencies.qbs b/tests/auto/blackbox/testdata/innosetupDependencies/innosetupDependencies.qbs index 17536ff8b..db65e127f 100644 --- a/tests/auto/blackbox/testdata/innosetupDependencies/innosetupDependencies.qbs +++ b/tests/auto/blackbox/testdata/innosetupDependencies/innosetupDependencies.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { @@ -42,7 +41,7 @@ Project { // This rule tries to provoke the installer into building too early (and the test // verifies that it does not) by causing the build of the installables to take // a lot longer. - inputs: ["qbs"] + multiplex: true outputFileTags: ["c"] outputArtifacts: { var artifacts = []; diff --git a/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs b/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs new file mode 100644 index 000000000..ef2c5c55b --- /dev/null +++ b/tests/auto/blackbox/testdata/input-tags-change-tracking/input-tags-change-tracking.qbs @@ -0,0 +1,63 @@ +import qbs.TextFile + +Product { + name: "p" + type: "p_tag" + property string generateInput + Group { + condition: generateInput == "no" + files: "input.txt" + fileTags: ["txt", "empty"] + } + Rule { + condition: generateInput == "static" + multiplex: true + Artifact { filePath: "input.txt"; fileTags: ["txt", "empty"] } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var out = new TextFile(output.filePath, TextFile.WriteOnly); + out.close(); + }; + return cmd; + } + } + Rule { + condition: generateInput == "dynamic" + multiplex: true + outputFileTags: ["txt", "empty"] + outputArtifacts: [{filePath: "input.txt", fileTags: ["txt", "empty"]}] + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var out = new TextFile(output.filePath, TextFile.WriteOnly); + out.close(); + }; + return cmd; + } + } + + Rule { + inputs: "txt" + outputFileTags: "p_tag" + outputArtifacts: { + if (input.fileTags.contains("empty")) + return []; + return [{ + filePath: input.fileTags.contains("y") ? "y.out" : "x.out", + fileTags: "p_tag" + }] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var out = new TextFile(output.filePath, TextFile.WriteOnly); + out.close(); + }; + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/input-tags-change-tracking/input.txt b/tests/auto/blackbox/testdata/input-tags-change-tracking/input.txt new file mode 100644 index 000000000..c6cac6926 --- /dev/null +++ b/tests/auto/blackbox/testdata/input-tags-change-tracking/input.txt @@ -0,0 +1 @@ +empty diff --git a/tests/auto/blackbox/testdata/inputs-from-dependencies/inputs-from-dependencies.qbs b/tests/auto/blackbox/testdata/inputs-from-dependencies/inputs-from-dependencies.qbs index 1b40abaeb..919060c73 100644 --- a/tests/auto/blackbox/testdata/inputs-from-dependencies/inputs-from-dependencies.qbs +++ b/tests/auto/blackbox/testdata/inputs-from-dependencies/inputs-from-dependencies.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "TextFileContainer1" diff --git a/tests/auto/blackbox/testdata/install-duplicates-no-error/install-duplicates-no-error.qbs b/tests/auto/blackbox/testdata/install-duplicates-no-error/install-duplicates-no-error.qbs index 3f2c4e974..a3282f941 100644 --- a/tests/auto/blackbox/testdata/install-duplicates-no-error/install-duplicates-no-error.qbs +++ b/tests/auto/blackbox/testdata/install-duplicates-no-error/install-duplicates-no-error.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "p1" diff --git a/tests/auto/blackbox/testdata/install-duplicates/install-duplicates.qbs b/tests/auto/blackbox/testdata/install-duplicates/install-duplicates.qbs index 2f91ba560..5edc83d81 100644 --- a/tests/auto/blackbox/testdata/install-duplicates/install-duplicates.qbs +++ b/tests/auto/blackbox/testdata/install-duplicates/install-duplicates.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Group { files: ["*.txt"] diff --git a/tests/auto/blackbox/testdata/install-locations/install-locations.qbs b/tests/auto/blackbox/testdata/install-locations/install-locations.qbs new file mode 100644 index 000000000..8a97f74a1 --- /dev/null +++ b/tests/auto/blackbox/testdata/install-locations/install-locations.qbs @@ -0,0 +1,26 @@ +Project { + property bool dummy: { + if (qbs.targetOS.contains("windows")) + console.info("is windows"); + else if (qbs.targetOS.contains("macos")) + console.info("is mac"); + else + console.info("is unix"); + } + CppApplication { + name: "theapp" + install: true + files: "main.cpp" + Group { + fileTagsFilter: "application" + fileTags: "some-tag" + } + } + DynamicLibrary { + name: "thelib" + install: true + installImportLib: true + Depends { name: "cpp" } + files: "thelib.cpp" + } +} diff --git a/tests/auto/blackbox/testdata/install-locations/main.cpp b/tests/auto/blackbox/testdata/install-locations/main.cpp new file mode 100644 index 000000000..237c8ce18 --- /dev/null +++ b/tests/auto/blackbox/testdata/install-locations/main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/tests/auto/blackbox/testdata/install-locations/thelib.cpp b/tests/auto/blackbox/testdata/install-locations/thelib.cpp new file mode 100644 index 000000000..d3877db26 --- /dev/null +++ b/tests/auto/blackbox/testdata/install-locations/thelib.cpp @@ -0,0 +1,3 @@ +#include "../dllexport.h" + +DLL_EXPORT void libFunc() {} diff --git a/tests/auto/blackbox/testdata/install-root-from-project-file/install-root-from-project-file.qbs b/tests/auto/blackbox/testdata/install-root-from-project-file/install-root-from-project-file.qbs index ea7284a05..80a63c956 100644 --- a/tests/auto/blackbox/testdata/install-root-from-project-file/install-root-from-project-file.qbs +++ b/tests/auto/blackbox/testdata/install-root-from-project-file/install-root-from-project-file.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" property string installRoot diff --git a/tests/auto/blackbox/testdata/install-tree/install-tree.qbs b/tests/auto/blackbox/testdata/install-tree/install-tree.qbs index cbd7300d6..dde39d231 100644 --- a/tests/auto/blackbox/testdata/install-tree/install-tree.qbs +++ b/tests/auto/blackbox/testdata/install-tree/install-tree.qbs @@ -1,7 +1,6 @@ -import qbs - CppApplication { files: ["main.cpp"] + qbs.installPrefix: "" Group { files: ["data/**/*.txt"] qbs.install: true diff --git a/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs index 822473157..2d37e85d6 100644 --- a/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs +++ b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.FileInfo import qbs.TextFile @@ -34,6 +33,7 @@ Project { property string installDir: "include" + qbs.installPrefix: "" Group { fileTagsFilter: "header" qbs.install: true diff --git a/tests/auto/blackbox/testdata/installable/installable.qbs b/tests/auto/blackbox/testdata/installable/installable.qbs index 7ce41867b..56feb6ec5 100644 --- a/tests/auto/blackbox/testdata/installable/installable.qbs +++ b/tests/auto/blackbox/testdata/installable/installable.qbs @@ -1,19 +1,17 @@ -import qbs import qbs.TextFile Project { CppApplication { type: ["application"] name: "app" + consoleApplication: true Group { files: ["main.cpp"] qbs.install: true } - Group { - fileTagsFilter: ["application"] - qbs.install: true - } + install: true + installDir: "" } Product { diff --git a/tests/auto/blackbox/testdata/installed-source-files/installed-source-files.qbs b/tests/auto/blackbox/testdata/installed-source-files/installed-source-files.qbs index 1aa564553..7b4d30091 100644 --- a/tests/auto/blackbox/testdata/installed-source-files/installed-source-files.qbs +++ b/tests/auto/blackbox/testdata/installed-source-files/installed-source-files.qbs @@ -1,8 +1,7 @@ -import qbs - CppApplication { consoleApplication: true files: ["main.cpp"] + qbs.installPrefix: "" Group { fileTagsFilter: ["cpp"] qbs.install: true diff --git a/tests/auto/blackbox/testdata/installed-transformer-output/qbs668.qbs b/tests/auto/blackbox/testdata/installed-transformer-output/qbs668.qbs index 99acc5585..aa40b7691 100644 --- a/tests/auto/blackbox/testdata/installed-transformer-output/qbs668.qbs +++ b/tests/auto/blackbox/testdata/installed-transformer-output/qbs668.qbs @@ -1,9 +1,9 @@ -import qbs 1.0 import qbs.TextFile Product { name: "install-test" type: ["text"] + qbs.installPrefix: "" Group { qbs.install: true qbs.installDir: "textfiles" diff --git a/tests/auto/blackbox/testdata/installed_artifact/installed_artifact.qbs b/tests/auto/blackbox/testdata/installed_artifact/installed_artifact.qbs index d1f9f54ea..f7ae7f5e0 100644 --- a/tests/auto/blackbox/testdata/installed_artifact/installed_artifact.qbs +++ b/tests/auto/blackbox/testdata/installed_artifact/installed_artifact.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Application { name: "installedApp" type: "application" diff --git a/tests/auto/blackbox/testdata/installpackage/installpackage.qbs b/tests/auto/blackbox/testdata/installpackage/installpackage.qbs index d04ecdd57..a0649a578 100644 --- a/tests/auto/blackbox/testdata/installpackage/installpackage.qbs +++ b/tests/auto/blackbox/testdata/installpackage/installpackage.qbs @@ -1,9 +1,10 @@ -import qbs - Project { CppApplication { name: "public_tool" - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } Depends { name: "mylib" } files: ["main.cpp"] Group { @@ -18,7 +19,10 @@ Project { files: ["main.cpp"] } DynamicLibrary { - bundle.isBundle: false + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.isBundle: false + } Depends { name: "cpp" } name: "mylib" files: ["lib.cpp"] diff --git a/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs b/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs index 65437311e..b08fcd4a3 100644 --- a/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs +++ b/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs @@ -1,7 +1,8 @@ -import qbs import qbs.TextFile Product { + name: "p" + property string errorType type: ["output"] Group { files: ["input.txt"] @@ -16,11 +17,15 @@ Product { prepare: { var cmd = new JavaScriptCommand(); cmd.description = "Creating output"; - cmd.textFile = new TextFile(input.filePath, TextFile.ReadOnly); - cmd.sourceCode = function() { - var content = textFile.readAll(); - textFile.close(); - } + if (product.errorType === "qobject") + cmd.dummy = new TextFile(input.filePath, TextFile.ReadOnly); + else if (product.errorType === "input") + cmd.dummy = input; + else if (product.errorType === "artifact") + cmd.dummy = product.artifacts.qbs[0]; + else + throw "invalid error type " + product.errorType; + cmd.sourceCode = function() { } return [cmd]; } } diff --git a/tests/auto/blackbox/testdata/invalid-extension-instantiation/invalid-extension-instantiation.qbs b/tests/auto/blackbox/testdata/invalid-extension-instantiation/invalid-extension-instantiation.qbs index ad2f55da4..d5e4dd5c7 100644 --- a/tests/auto/blackbox/testdata/invalid-extension-instantiation/invalid-extension-instantiation.qbs +++ b/tests/auto/blackbox/testdata/invalid-extension-instantiation/invalid-extension-instantiation.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment import qbs.File import qbs.FileInfo diff --git a/tests/auto/blackbox/testdata/invalid-install-dir/invalid-install-dir.qbs b/tests/auto/blackbox/testdata/invalid-install-dir/invalid-install-dir.qbs index f4a608904..57505712c 100644 --- a/tests/auto/blackbox/testdata/invalid-install-dir/invalid-install-dir.qbs +++ b/tests/auto/blackbox/testdata/invalid-install-dir/invalid-install-dir.qbs @@ -1,11 +1,7 @@ -import qbs - CppApplication { consoleApplication: true files: ["main.cpp"] - Group { - fileTagsFilter: ["application"] - qbs.install: true - qbs.installDir: "../whatever" - } + qbs.installPrefix: "" + install: true + installDir: "../whatever" } diff --git a/tests/auto/blackbox/testdata/invalid-library-names/invalid-library-names.qbs b/tests/auto/blackbox/testdata/invalid-library-names/invalid-library-names.qbs index 1ddfecd38..659b39962 100644 --- a/tests/auto/blackbox/testdata/invalid-library-names/invalid-library-names.qbs +++ b/tests/auto/blackbox/testdata/invalid-library-names/invalid-library-names.qbs @@ -1,5 +1,3 @@ -import qbs - Project { minimumQbsVersion: "1.6" property var values: [null, undefined, 5, [], ""] diff --git a/tests/auto/blackbox/testdata/jsextensions-binaryfile/binaryfile.qbs b/tests/auto/blackbox/testdata/jsextensions-binaryfile/binaryfile.qbs index 7d3ada851..1e7426744 100644 --- a/tests/auto/blackbox/testdata/jsextensions-binaryfile/binaryfile.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-binaryfile/binaryfile.qbs @@ -1,14 +1,10 @@ -import qbs import qbs.BinaryFile Product { type: ["dummy"] Rule { multiplex: true - Artifact { - filePath: "dummy.dat" - fileTags: ["dummy"] - } + outputFileTags: "dummy" prepare: { var commands = []; var cmd = new JavaScriptCommand(); diff --git a/tests/auto/blackbox/testdata/jsextensions-file/file.qbs b/tests/auto/blackbox/testdata/jsextensions-file/file.qbs index 2b0ec8de1..6adf714e2 100644 --- a/tests/auto/blackbox/testdata/jsextensions-file/file.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-file/file.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.FileInfo import qbs.TextFile @@ -7,10 +6,7 @@ Product { type: ["dummy"] Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["dummy"] - } + outputFileTags: "dummy" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/jsextensions-fileinfo/fileinfo.qbs b/tests/auto/blackbox/testdata/jsextensions-fileinfo/fileinfo.qbs index cf28b4014..244f2122e 100644 --- a/tests/auto/blackbox/testdata/jsextensions-fileinfo/fileinfo.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-fileinfo/fileinfo.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile @@ -6,10 +5,7 @@ Product { type: ["dummy"] Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["dummy"] - } + outputFileTags: "dummy" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs index c9c832ba4..be9e718df 100644 --- a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment import qbs.FileInfo import qbs.Process @@ -13,10 +12,7 @@ Project { Rule { multiplex: true inputs: ["application"] - Artifact { - filePath: "dummy.txt" - fileTags: ["dummy"] - } + outputFileTags: "dummy" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/jsextensions-propertylist/propertylist.qbs b/tests/auto/blackbox/testdata/jsextensions-propertylist/propertylist.qbs index a70b81625..aa1351543 100644 --- a/tests/auto/blackbox/testdata/jsextensions-propertylist/propertylist.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-propertylist/propertylist.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Process import qbs.PropertyList import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/jsextensions-temporarydir/jsextensions-temporarydir.qbs b/tests/auto/blackbox/testdata/jsextensions-temporarydir/jsextensions-temporarydir.qbs index fb54a45ec..c540e9196 100644 --- a/tests/auto/blackbox/testdata/jsextensions-temporarydir/jsextensions-temporarydir.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-temporarydir/jsextensions-temporarydir.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File import qbs.TemporaryDir diff --git a/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs b/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs index ef433a1e4..62b54b131 100644 --- a/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs +++ b/tests/auto/blackbox/testdata/jsextensions-textfile/textfile.qbs @@ -1,14 +1,10 @@ -import qbs import qbs.TextFile Product { type: ["dummy"] Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["dummy"] - } + outputFileTags: "dummy" prepare: { var commands = []; var cmd = new JavaScriptCommand(); diff --git a/tests/auto/blackbox/testdata/ld/ld.qbs b/tests/auto/blackbox/testdata/ld/ld.qbs index f95157012..25fede1b0 100644 --- a/tests/auto/blackbox/testdata/ld/ld.qbs +++ b/tests/auto/blackbox/testdata/ld/ld.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Library { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs b/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs index 3708140ad..61f76f4be 100644 --- a/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/lex_outfile/lex_outfile.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { qbsSearchPaths: ".." Depends { name: "bisonhelper" } diff --git a/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs b/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs index 3708140ad..61f76f4be 100644 --- a/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/lex_prefix/lex_prefix.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { qbsSearchPaths: ".." Depends { name: "bisonhelper" } diff --git a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs index 3708140ad..61f76f4be 100644 --- a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { qbsSearchPaths: ".." Depends { name: "bisonhelper" } diff --git a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs index fb1375598..7b0c1e515 100644 --- a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "lex_yacc" } consoleApplication: true diff --git a/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs b/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs index 298190996..7e89b317e 100644 --- a/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs +++ b/tests/auto/blackbox/testdata/lexyacc/yacc_output/yacc_output.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "lex_yacc" } lex_yacc.outputTag: "cpp" diff --git a/tests/auto/blackbox/testdata/linkerMode/linkerMode.qbs b/tests/auto/blackbox/testdata/linkerMode/linkerMode.qbs index 05e3eabed..1be50c0aa 100644 --- a/tests/auto/blackbox/testdata/linkerMode/linkerMode.qbs +++ b/tests/auto/blackbox/testdata/linkerMode/linkerMode.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { consoleApplication: true diff --git a/tests/auto/blackbox/testdata/linkerscripts/linkerscripts.qbs b/tests/auto/blackbox/testdata/linkerscripts/linkerscripts.qbs index 42b3884ea..b30a498bb 100644 --- a/tests/auto/blackbox/testdata/linkerscripts/linkerscripts.qbs +++ b/tests/auto/blackbox/testdata/linkerscripts/linkerscripts.qbs @@ -1,5 +1,3 @@ -import qbs - DynamicLibrary { type: base.concat("custom") Depends { name: "cpp" } @@ -12,10 +10,7 @@ DynamicLibrary { Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["custom"] - } + outputFileTags: "custom" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; @@ -26,8 +21,7 @@ DynamicLibrary { } } - Group { - fileTagsFilter: ["dynamiclibrary"] - qbs.install: true - } + qbs.installPrefix: "" + install: true + installDir: "" } diff --git a/tests/auto/blackbox/testdata/list-products/list-products.qbs b/tests/auto/blackbox/testdata/list-products/list-products.qbs index 559a7d274..5431b9371 100644 --- a/tests/auto/blackbox/testdata/list-products/list-products.qbs +++ b/tests/auto/blackbox/testdata/list-products/list-products.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/blackbox/testdata/list-properties-with-outer/list-properties-with-outer.qbs b/tests/auto/blackbox/testdata/list-properties-with-outer/list-properties-with-outer.qbs index 3b0b3be49..ba157a7ac 100644 --- a/tests/auto/blackbox/testdata/list-properties-with-outer/list-properties-with-outer.qbs +++ b/tests/auto/blackbox/testdata/list-properties-with-outer/list-properties-with-outer.qbs @@ -1,5 +1,3 @@ -import qbs - Product { type: ["outtype"] Depends { name: "higher" } diff --git a/tests/auto/blackbox/testdata/list-properties-with-outer/modules/higher/higher.qbs b/tests/auto/blackbox/testdata/list-properties-with-outer/modules/higher/higher.qbs index a8d1b186f..ddb7b6f40 100644 --- a/tests/auto/blackbox/testdata/list-properties-with-outer/modules/higher/higher.qbs +++ b/tests/auto/blackbox/testdata/list-properties-with-outer/modules/higher/higher.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lower" } lower.listProp: ["higher"] diff --git a/tests/auto/blackbox/testdata/list-properties-with-outer/modules/lower/lower.qbs b/tests/auto/blackbox/testdata/list-properties-with-outer/modules/lower/lower.qbs index 3d5824bc2..63c97aa76 100644 --- a/tests/auto/blackbox/testdata/list-properties-with-outer/modules/lower/lower.qbs +++ b/tests/auto/blackbox/testdata/list-properties-with-outer/modules/lower/lower.qbs @@ -1,14 +1,9 @@ -import qbs - Module { property stringList listProp Rule { inputs: ["intype"] - Artifact { - filePath: "dummy.out" - fileTags: ["outtype"] - } + outputFileTags: "outtype" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/list-property-order/modules/higher1/higher1.qbs b/tests/auto/blackbox/testdata/list-property-order/modules/higher1/higher1.qbs index c56dd33bc..67c7c790a 100644 --- a/tests/auto/blackbox/testdata/list-property-order/modules/higher1/higher1.qbs +++ b/tests/auto/blackbox/testdata/list-property-order/modules/higher1/higher1.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lower" } lower.listProp: ["higher1"] diff --git a/tests/auto/blackbox/testdata/list-property-order/modules/higher2/higher2.qbs b/tests/auto/blackbox/testdata/list-property-order/modules/higher2/higher2.qbs index 75600ffa4..3ca22f51c 100644 --- a/tests/auto/blackbox/testdata/list-property-order/modules/higher2/higher2.qbs +++ b/tests/auto/blackbox/testdata/list-property-order/modules/higher2/higher2.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lower" } lower.listProp: ["higher2"] diff --git a/tests/auto/blackbox/testdata/list-property-order/modules/higher3/higher3.qbs b/tests/auto/blackbox/testdata/list-property-order/modules/higher3/higher3.qbs index 5372b92db..f534cf8bf 100644 --- a/tests/auto/blackbox/testdata/list-property-order/modules/higher3/higher3.qbs +++ b/tests/auto/blackbox/testdata/list-property-order/modules/higher3/higher3.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lower" } lower.listProp: ["higher3"] diff --git a/tests/auto/blackbox/testdata/list-property-order/modules/lower/lower.qbs b/tests/auto/blackbox/testdata/list-property-order/modules/lower/lower.qbs index eeed377bc..c7462676d 100644 --- a/tests/auto/blackbox/testdata/list-property-order/modules/lower/lower.qbs +++ b/tests/auto/blackbox/testdata/list-property-order/modules/lower/lower.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property stringList listProp diff --git a/tests/auto/blackbox/testdata/list-property-order/product.qbs b/tests/auto/blackbox/testdata/list-property-order/product.qbs index ef5e5c827..e92494693 100644 --- a/tests/auto/blackbox/testdata/list-property-order/product.qbs +++ b/tests/auto/blackbox/testdata/list-property-order/product.qbs @@ -1,5 +1,3 @@ -import qbs - Product { type: "outtype" name: "toplevel" diff --git a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs index 15b5906af..ec5b0b358 100644 --- a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs +++ b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs @@ -1,5 +1,3 @@ -import qbs - Project { LoadableModule { Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs b/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs index 2b4d1f241..650f07104 100644 --- a/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs +++ b/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { type: ["application"] diff --git a/tests/auto/blackbox/testdata/makefile-generator/app.qbs b/tests/auto/blackbox/testdata/makefile-generator/app.qbs index 103f71ecf..dfd67276e 100644 --- a/tests/auto/blackbox/testdata/makefile-generator/app.qbs +++ b/tests/auto/blackbox/testdata/makefile-generator/app.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "the app" consoleApplication: true @@ -14,9 +12,5 @@ CppApplication { files: "main.cpp" qbs.installPrefix: "/usr/local" - Group { - fileTagsFilter: "application" - qbs.install: true - qbs.installDir: "bin" - } + install: true } diff --git a/tests/auto/blackbox/testdata/maximum-c-language-version/maximum-c-language-version.qbs b/tests/auto/blackbox/testdata/maximum-c-language-version/maximum-c-language-version.qbs index 2ac47b66a..320494d00 100644 --- a/tests/auto/blackbox/testdata/maximum-c-language-version/maximum-c-language-version.qbs +++ b/tests/auto/blackbox/testdata/maximum-c-language-version/maximum-c-language-version.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" property bool enableNewestModule: true diff --git a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newermodule/newermodule.qbs b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newermodule/newermodule.qbs index 4dd343b3b..d5b015e42 100644 --- a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newermodule/newermodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newermodule/newermodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cLanguageVersion: "c99" diff --git a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newestmodule/newestmodule.qbs b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newestmodule/newestmodule.qbs index f8316a35e..5437957fe 100644 --- a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newestmodule/newestmodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/newestmodule/newestmodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cLanguageVersion: "c11" diff --git a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/oldmodule/oldmodule.qbs b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/oldmodule/oldmodule.qbs index a753b3e3e..10e530098 100644 --- a/tests/auto/blackbox/testdata/maximum-c-language-version/modules/oldmodule/oldmodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-c-language-version/modules/oldmodule/oldmodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cLanguageVersion: "c90" diff --git a/tests/auto/blackbox/testdata/maximum-cxx-language-version/maximum-cxx-language-version.qbs b/tests/auto/blackbox/testdata/maximum-cxx-language-version/maximum-cxx-language-version.qbs index 5dd298aa8..71933cf60 100644 --- a/tests/auto/blackbox/testdata/maximum-cxx-language-version/maximum-cxx-language-version.qbs +++ b/tests/auto/blackbox/testdata/maximum-cxx-language-version/maximum-cxx-language-version.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" property bool enableNewestModule: true diff --git a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newermodule/newermodule.qbs b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newermodule/newermodule.qbs index dfc28b946..88b1da212 100644 --- a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newermodule/newermodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newermodule/newermodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cxxLanguageVersion: "c++14" diff --git a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newestmodule/newestmodule.qbs b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newestmodule/newestmodule.qbs index f306a5389..f99932b10 100644 --- a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newestmodule/newestmodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/newestmodule/newestmodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cxxLanguageVersion: "c++17" diff --git a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/oldmodule/oldmodule.qbs b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/oldmodule/oldmodule.qbs index b05c855a3..73d3bf16a 100644 --- a/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/oldmodule/oldmodule.qbs +++ b/tests/auto/blackbox/testdata/maximum-cxx-language-version/modules/oldmodule/oldmodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "cpp" } cpp.cxxLanguageVersion: "c++11" diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/fakewindows.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/fakewindows.qbs index f536da6ac..1a56e0b7e 100644 --- a/tests/auto/blackbox/testdata/minimumSystemVersion/fakewindows.qbs +++ b/tests/auto/blackbox/testdata/minimumSystemVersion/fakewindows.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities // non-existent versions of Windows should print a QBS warning diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs index 82cce3e07..8440da779 100644 --- a/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs +++ b/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs @@ -1,5 +1,3 @@ -import qbs - // just to make sure three-digit minimum versions work on macOS // this only affects the value of __MAC_OS_X_VERSION_MIN_REQUIRED, // not the actual LC_VERSION_MIN_MACOSX command which is limited to two diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs index 2af95134a..f6ecab418 100644 --- a/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs +++ b/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities // a specific version of the operating systems is specified diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs index 2285e20ba..a5ea620fd 100644 --- a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs +++ b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities // no minimum versions are specified, and explicitly set to undefined in diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs index ac0a7abdc..0eeb2d547 100644 --- a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs +++ b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities // no minimum versions are specified so the profile defaults will be used diff --git a/tests/auto/blackbox/testdata/missing-dependency/missing-dependency.qbs b/tests/auto/blackbox/testdata/missing-dependency/missing-dependency.qbs index a30ac2a70..6bb8b96f2 100644 --- a/tests/auto/blackbox/testdata/missing-dependency/missing-dependency.qbs +++ b/tests/auto/blackbox/testdata/missing-dependency/missing-dependency.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/missing-override-prefix/missing-override-prefix.qbs b/tests/auto/blackbox/testdata/missing-override-prefix/missing-override-prefix.qbs index 6d16a3c53..86718b571 100644 --- a/tests/auto/blackbox/testdata/missing-override-prefix/missing-override-prefix.qbs +++ b/tests/auto/blackbox/testdata/missing-override-prefix/missing-override-prefix.qbs @@ -1,3 +1 @@ -import qbs - Product { } diff --git a/tests/auto/blackbox/testdata/missing-project-file/project-dir/missing-project-file.qbs b/tests/auto/blackbox/testdata/missing-project-file/project-dir/missing-project-file.qbs index a294cbd24..421bad1f0 100644 --- a/tests/auto/blackbox/testdata/missing-project-file/project-dir/missing-project-file.qbs +++ b/tests/auto/blackbox/testdata/missing-project-file/project-dir/missing-project-file.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: [ "file.cpp", diff --git a/tests/auto/blackbox/testdata/moved-file-dependency/moved-file-dependency.qbs b/tests/auto/blackbox/testdata/moved-file-dependency/moved-file-dependency.qbs index 6252f98ed..797198686 100644 --- a/tests/auto/blackbox/testdata/moved-file-dependency/moved-file-dependency.qbs +++ b/tests/auto/blackbox/testdata/moved-file-dependency/moved-file-dependency.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { cpp.includePaths: ["subdir1", "subdir2"] files: ["main.cpp"] diff --git a/tests/auto/blackbox/testdata/multiple-changes/multiple-changes.qbs b/tests/auto/blackbox/testdata/multiple-changes/multiple-changes.qbs index 254e2b4da..51e6b1a5c 100644 --- a/tests/auto/blackbox/testdata/multiple-changes/multiple-changes.qbs +++ b/tests/auto/blackbox/testdata/multiple-changes/multiple-changes.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property bool prop: false Product { diff --git a/tests/auto/blackbox/testdata/multiple-configurations/multiple-configurations.qbs b/tests/auto/blackbox/testdata/multiple-configurations/multiple-configurations.qbs index f8371e983..f6fd16ba2 100644 --- a/tests/auto/blackbox/testdata/multiple-configurations/multiple-configurations.qbs +++ b/tests/auto/blackbox/testdata/multiple-configurations/multiple-configurations.qbs @@ -1,5 +1,3 @@ -import qbs - Project { StaticLibrary { name: "lib" diff --git a/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs index b36ea5be9..3994bd95f 100644 --- a/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs +++ b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "tool" diff --git a/tests/auto/blackbox/testdata/nested-groups/modules/themodule/themodule.qbs b/tests/auto/blackbox/testdata/nested-groups/modules/themodule/themodule.qbs index ffca11cdf..73426ddf5 100644 --- a/tests/auto/blackbox/testdata/nested-groups/modules/themodule/themodule.qbs +++ b/tests/auto/blackbox/testdata/nested-groups/modules/themodule/themodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Group { cpp.defines: ["REQUIRED_FOR_FILE3"] diff --git a/tests/auto/blackbox/testdata/nested-groups/nested-groups.qbs b/tests/auto/blackbox/testdata/nested-groups/nested-groups.qbs index 827eda64e..88f5ae30e 100644 --- a/tests/auto/blackbox/testdata/nested-groups/nested-groups.qbs +++ b/tests/auto/blackbox/testdata/nested-groups/nested-groups.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { consoleApplication: true Depends { name: "themodule" } diff --git a/tests/auto/blackbox/testdata/nested-properties/modules/higherlevel/higher-level.qbs b/tests/auto/blackbox/testdata/nested-properties/modules/higherlevel/higher-level.qbs index a3c117efd..071737c36 100644 --- a/tests/auto/blackbox/testdata/nested-properties/modules/higherlevel/higher-level.qbs +++ b/tests/auto/blackbox/testdata/nested-properties/modules/higherlevel/higher-level.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lowerlevel" } lowerlevel.propDependency: "value in higherlevel" diff --git a/tests/auto/blackbox/testdata/nested-properties/modules/lowerlevel/lower-level.qbs b/tests/auto/blackbox/testdata/nested-properties/modules/lowerlevel/lower-level.qbs index 6b2d00587..f8b6a7dc0 100644 --- a/tests/auto/blackbox/testdata/nested-properties/modules/lowerlevel/lower-level.qbs +++ b/tests/auto/blackbox/testdata/nested-properties/modules/lowerlevel/lower-level.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property string propDependency: "value in lowerlevel module" property string prop: propDependency @@ -7,10 +5,7 @@ Module { Rule { inputs: ["dummy-input"] - Artifact { - filePath: "dummy.out" - fileTags: "mytype" - } + outputFileTags: "mytype" prepare: { var cmd = new JavaScriptCommand(); cmd.sourceCode = function() { }; diff --git a/tests/auto/blackbox/testdata/nested-properties/product.qbs b/tests/auto/blackbox/testdata/nested-properties/product.qbs index 916cee151..e38813b72 100644 --- a/tests/auto/blackbox/testdata/nested-properties/product.qbs +++ b/tests/auto/blackbox/testdata/nested-properties/product.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "dep" diff --git a/tests/auto/blackbox/testdata/new-output-artifact/new-output-artifact.qbs b/tests/auto/blackbox/testdata/new-output-artifact/new-output-artifact.qbs index 10e0e4305..b297a3f61 100644 --- a/tests/auto/blackbox/testdata/new-output-artifact/new-output-artifact.qbs +++ b/tests/auto/blackbox/testdata/new-output-artifact/new-output-artifact.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { @@ -9,6 +8,7 @@ Product { files: ["input.txt"] fileTags: ["input"] } + qbs.installPrefix: "" Group { fileTagsFilter: product.type qbs.install: true diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp b/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp new file mode 100644 index 000000000..20cfe21da --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/lib.cpp @@ -0,0 +1 @@ +static void someFunc() {} diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/lib.h b/tests/auto/blackbox/testdata/no-exported-symbols/lib.h new file mode 100644 index 000000000..48fa2de97 --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/lib.h @@ -0,0 +1,6 @@ +#ifndef TEST_LIB +#define TEST_LIB + +inline int success() { return 0; } + +#endif diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp b/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp new file mode 100644 index 000000000..a76122e19 --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/main.cpp @@ -0,0 +1,6 @@ +#include <lib.h> + +int main() +{ + return success(); +} diff --git a/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs b/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs new file mode 100644 index 000000000..4bda00caf --- /dev/null +++ b/tests/auto/blackbox/testdata/no-exported-symbols/no-exported-symbols.qbs @@ -0,0 +1,28 @@ +Project { + DynamicLibrary { + name: "the_lib" + Depends { name: "cpp" } + files: ["lib.cpp", "lib.h"] + Export { + Depends { name: "cpp" } + cpp.includePaths: path + } + + Probe { + id: toolchainProbe + property stringList toolchain: qbs.toolchain + configure: { + if (toolchain.contains("msvc")) + console.info("compiler is MSVC") + else + console.info("compiler is not MSVC") + } + } + } + CppApplication { + name: "the_app" + property bool link + Depends { name: "the_lib"; cpp.link: product.link } + files: "main.cpp" + } +} diff --git a/tests/auto/blackbox/testdata/no-profile/no-profile.qbs b/tests/auto/blackbox/testdata/no-profile/no-profile.qbs index cc251c6ab..6fd7dd07a 100644 --- a/tests/auto/blackbox/testdata/no-profile/no-profile.qbs +++ b/tests/auto/blackbox/testdata/no-profile/no-profile.qbs @@ -1,5 +1,3 @@ -import qbs - Product { property bool dummy: { console.info("profile: " + project.profile); } } diff --git a/tests/auto/blackbox/testdata/nodejs/hello.qbs b/tests/auto/blackbox/testdata/nodejs/hello.qbs index d5e92209a..c19e455db 100644 --- a/tests/auto/blackbox/testdata/nodejs/hello.qbs +++ b/tests/auto/blackbox/testdata/nodejs/hello.qbs @@ -1,5 +1,3 @@ -import qbs - NodeJSApplication { nodejs.applicationFile: "hello.js" name: "hello" diff --git a/tests/auto/blackbox/testdata/non-broken-files-in-broken-product/non-broken-files-in-broken-product.qbs b/tests/auto/blackbox/testdata/non-broken-files-in-broken-product/non-broken-files-in-broken-product.qbs index 1ec764dfa..abd41fb6b 100644 --- a/tests/auto/blackbox/testdata/non-broken-files-in-broken-product/non-broken-files-in-broken-product.qbs +++ b/tests/auto/blackbox/testdata/non-broken-files-in-broken-product/non-broken-files-in-broken-product.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { consoleApplication: true files: ["fine.cpp", "broken.cpp"] diff --git a/tests/auto/blackbox/testdata/non-default-product/non-default-product.qbs b/tests/auto/blackbox/testdata/non-default-product/non-default-product.qbs index 498344975..6e006e831 100644 --- a/tests/auto/blackbox/testdata/non-default-product/non-default-product.qbs +++ b/tests/auto/blackbox/testdata/non-default-product/non-default-product.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "default app" diff --git a/tests/auto/blackbox/testdata/nsis/hello.qbs b/tests/auto/blackbox/testdata/nsis/hello.qbs index b7f3da505..a161a6998 100644 --- a/tests/auto/blackbox/testdata/nsis/hello.qbs +++ b/tests/auto/blackbox/testdata/nsis/hello.qbs @@ -1,5 +1,3 @@ -import qbs - NSISSetup { condition: qbs.targetOS.contains("windows") name: "Qbs Hello" diff --git a/tests/auto/blackbox/testdata/nsisDependencies/nsisDependencies.qbs b/tests/auto/blackbox/testdata/nsisDependencies/nsisDependencies.qbs index 7f19bf8d7..d8185aabf 100644 --- a/tests/auto/blackbox/testdata/nsisDependencies/nsisDependencies.qbs +++ b/tests/auto/blackbox/testdata/nsisDependencies/nsisDependencies.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile @@ -37,7 +36,7 @@ Project { // This rule tries to provoke the installer into building too early (and the test // verifies that it does not) by causing the build of the installables to take // a lot longer. - inputs: ["qbs"] + multiplex: true outputFileTags: ["c"] outputArtifacts: { var artifacts = []; diff --git a/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs b/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs index 1ef57bae7..d52246578 100644 --- a/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs +++ b/tests/auto/blackbox/testdata/out-of-date-marking/out-of-date-marking.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile CppApplication { diff --git a/tests/auto/blackbox/testdata/output-artifact-auto-tagging/output-artifact-auto-tagging.qbs b/tests/auto/blackbox/testdata/output-artifact-auto-tagging/output-artifact-auto-tagging.qbs index a9090f3db..7ec8fd916 100644 --- a/tests/auto/blackbox/testdata/output-artifact-auto-tagging/output-artifact-auto-tagging.qbs +++ b/tests/auto/blackbox/testdata/output-artifact-auto-tagging/output-artifact-auto-tagging.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File CppApplication { diff --git a/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs b/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs index b26b0f31f..b69dd0da8 100644 --- a/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs +++ b/tests/auto/blackbox/testdata/overrideProjectProperties/helper_lib.qbs @@ -1,5 +1,3 @@ -import qbs - DynamicLibrary { name: "helperLib" files: "helperlib.cpp" diff --git a/tests/auto/blackbox/testdata/overrideProjectProperties/overrideProjectProperties.qbs b/tests/auto/blackbox/testdata/overrideProjectProperties/overrideProjectProperties.qbs index 6e8ef62a1..650606fbd 100644 --- a/tests/auto/blackbox/testdata/overrideProjectProperties/overrideProjectProperties.qbs +++ b/tests/auto/blackbox/testdata/overrideProjectProperties/overrideProjectProperties.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { property string nameSuffix: "" property bool someBool diff --git a/tests/auto/blackbox/testdata/overrideProjectProperties/project_using_helper_lib.qbs b/tests/auto/blackbox/testdata/overrideProjectProperties/project_using_helper_lib.qbs index c61716e6e..1eb21cdd1 100644 --- a/tests/auto/blackbox/testdata/overrideProjectProperties/project_using_helper_lib.qbs +++ b/tests/auto/blackbox/testdata/overrideProjectProperties/project_using_helper_lib.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { property bool linkSuccessfully: false references: linkSuccessfully ? ["helper_lib.qbs"] : [] diff --git a/tests/auto/blackbox/testdata/pch-change-tracking/pch-change-tracking.qbs b/tests/auto/blackbox/testdata/pch-change-tracking/pch-change-tracking.qbs index 2cfb17337..3da526fdb 100644 --- a/tests/auto/blackbox/testdata/pch-change-tracking/pch-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/pch-change-tracking/pch-change-tracking.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: [ "header1.h", diff --git a/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs b/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs index 514de7ecb..a81b8f6c9 100644 --- a/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs +++ b/tests/auto/blackbox/testdata/per-group-define-in-export-item/per-group-define-in-export-item.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "dep" diff --git a/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/modules/themodule/themodule.qbs b/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/modules/themodule/themodule.qbs index 2b33922a2..991876f6b 100644 --- a/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/modules/themodule/themodule.qbs +++ b/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/modules/themodule/themodule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Probes Module { @@ -11,10 +10,7 @@ Module { Rule { multiplex: true - Artifact { - filePath: "dummy.out" - fileTags: ["theType"] - } + outputFileTags: "theType" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/pkg-config.qbs b/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/pkg-config.qbs index 0eac3cca0..11498ebdb 100644 --- a/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/pkg-config.qbs +++ b/tests/auto/blackbox/testdata/pkg-config-probe-sysroot/pkg-config.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property string packageBaseName diff --git a/tests/auto/blackbox/testdata/pkg-config-probe/modules/themodule/themodule.qbs b/tests/auto/blackbox/testdata/pkg-config-probe/modules/themodule/themodule.qbs index 81dfa955f..d5488da1f 100644 --- a/tests/auto/blackbox/testdata/pkg-config-probe/modules/themodule/themodule.qbs +++ b/tests/auto/blackbox/testdata/pkg-config-probe/modules/themodule/themodule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Probes Module { @@ -18,10 +17,7 @@ Module { Rule { multiplex: true - Artifact { - filePath: "dummy.out" - fileTags: ["theType"] - } + outputFileTags: "theType" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/pkg-config-probe/pkg-config.qbs b/tests/auto/blackbox/testdata/pkg-config-probe/pkg-config.qbs index db831fbc2..d4dc3b92b 100644 --- a/tests/auto/blackbox/testdata/pkg-config-probe/pkg-config.qbs +++ b/tests/auto/blackbox/testdata/pkg-config-probe/pkg-config.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property string packageBaseName diff --git a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs index f003a71cb..c619b33ef 100644 --- a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs +++ b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "myapp" diff --git a/tests/auto/blackbox/testdata/precompiled-and-prefix-headers/precompiled-and-prefix-headers.qbs b/tests/auto/blackbox/testdata/precompiled-and-prefix-headers/precompiled-and-prefix-headers.qbs index b30f76874..bbd524e23 100644 --- a/tests/auto/blackbox/testdata/precompiled-and-prefix-headers/precompiled-and-prefix-headers.qbs +++ b/tests/auto/blackbox/testdata/precompiled-and-prefix-headers/precompiled-and-prefix-headers.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "MyApp" consoleApplication: true diff --git a/tests/auto/blackbox/testdata/prevent-floating-point-values/prevent-floating-point-values.qbs b/tests/auto/blackbox/testdata/prevent-floating-point-values/prevent-floating-point-values.qbs index 619e44f20..bd1d3162a 100644 --- a/tests/auto/blackbox/testdata/prevent-floating-point-values/prevent-floating-point-values.qbs +++ b/tests/auto/blackbox/testdata/prevent-floating-point-values/prevent-floating-point-values.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" property bool dummy: { console.info("version: " + version); } diff --git a/tests/auto/blackbox/testdata/probe-change-tracking/probe-change-tracking.qbs b/tests/auto/blackbox/testdata/probe-change-tracking/probe-change-tracking.qbs index ff37985a4..6007a33ac 100644 --- a/tests/auto/blackbox/testdata/probe-change-tracking/probe-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/probe-change-tracking/probe-change-tracking.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Probe { id: tlpProbe diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/dependee.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/dependee.qbs index 121ec6c39..fe81cf55c 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/dependee.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/dependee.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "dependee" Depends { name: "myothermodule" } diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/dependency.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/dependency.qbs index 1413777dc..eea5180ef 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/dependency.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/dependency.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "dependency" Export { diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/depmodule/depmodule.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/depmodule/depmodule.qbs index b880d6dac..41c6cfe50 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/depmodule/depmodule.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/depmodule/depmodule.qbs @@ -1,15 +1,10 @@ -import qbs - Module { property string prop property stringList listProp: [] Rule { inputs: ["dep-in"] - Artifact { - filePath: "dummy.txt" - fileTags: ["dep-out"] - } + outputFileTags: "dep-out" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "Creating dep-out artifact"; diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/mymodule/mymodule.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/mymodule/mymodule.qbs index 9f3657f34..89d544f7e 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/mymodule/mymodule.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/mymodule/mymodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "depmodule" } Probe { @@ -12,10 +10,7 @@ Module { Rule { inputs: ["in"] - Artifact { - filePath: "dummy2.txt" - fileTags: ["out"] - } + outputFileTags: "out" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "Creating out artifact"; diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/myothermodule/myothermodule.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/myothermodule/myothermodule.qbs index d3009f532..4ea5dd077 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/modules/myothermodule/myothermodule.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/modules/myothermodule/myothermodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "depmodule" } depmodule.listProp: ["myother"] diff --git a/tests/auto/blackbox/testdata/probe-in-exported-module/probe-in-exported-module.qbs b/tests/auto/blackbox/testdata/probe-in-exported-module/probe-in-exported-module.qbs index 4e0f13f60..398090195 100644 --- a/tests/auto/blackbox/testdata/probe-in-exported-module/probe-in-exported-module.qbs +++ b/tests/auto/blackbox/testdata/probe-in-exported-module/probe-in-exported-module.qbs @@ -1,5 +1,3 @@ -import qbs - Project { references: [ "dependee.qbs", "dependency.qbs" ] } diff --git a/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs b/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs index 36842e40b..9846eacef 100644 --- a/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs +++ b/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs @@ -1,17 +1,16 @@ -import qbs import qbs.Probes CppApplication { Probes.PathProbe { id: probe1 names: ["bin/tool"] - platformPaths: [product.sourceDirectory] + platformSearchPaths: [product.sourceDirectory] } Probes.PathProbe { id: probe2 names: ["tool"] - platformPaths: [product.sourceDirectory + "/bin"] + platformSearchPaths: [product.sourceDirectory + "/bin"] } targetName: { diff --git a/tests/auto/blackbox/testdata/probes-and-array-properties/modules/mymodule/mymodule.qbs b/tests/auto/blackbox/testdata/probes-and-array-properties/modules/mymodule/mymodule.qbs index 6479bdfac..e5c368a88 100644 --- a/tests/auto/blackbox/testdata/probes-and-array-properties/modules/mymodule/mymodule.qbs +++ b/tests/auto/blackbox/testdata/probes-and-array-properties/modules/mymodule/mymodule.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Probe { id: propProbe @@ -15,11 +13,7 @@ Module { Rule { multiplex: true - alwaysRun: true - Artifact { - filePath: "dummy" - fileTags: ["the-output"] - } + outputFileTags: "the-output" prepare: { var cmd = new JavaScriptCommand(); cmd.description = "generating dummy"; diff --git a/tests/auto/blackbox/testdata/probes-and-array-properties/probes-and-array-properties.qbs b/tests/auto/blackbox/testdata/probes-and-array-properties/probes-and-array-properties.qbs index c7d88ec14..70ca8e1de 100644 --- a/tests/auto/blackbox/testdata/probes-and-array-properties/probes-and-array-properties.qbs +++ b/tests/auto/blackbox/testdata/probes-and-array-properties/probes-and-array-properties.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "theProduct" type: ["the-output"] diff --git a/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs b/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs index 660c088a0..19fc67f71 100644 --- a/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs +++ b/tests/auto/blackbox/testdata/probes-and-shadow-products/probes-and-shadow-products.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "p" multiplexByQbsProperties: "buildVariants" diff --git a/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/inner/inner.qbs b/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/inner/inner.qbs index b6d39b021..5a254b49b 100644 --- a/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/inner/inner.qbs +++ b/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/inner/inner.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Probes Module { diff --git a/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/outer/outer.qbs b/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/outer/outer.qbs index 71b745f44..4472d573b 100644 --- a/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/outer/outer.qbs +++ b/tests/auto/blackbox/testdata/probes-in-nested-modules/modules/outer/outer.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "inner" } diff --git a/tests/auto/blackbox/testdata/probes-in-nested-modules/probes-in-nested-modules.qbs b/tests/auto/blackbox/testdata/probes-in-nested-modules/probes-in-nested-modules.qbs index ffc273e18..877300c1a 100644 --- a/tests/auto/blackbox/testdata/probes-in-nested-modules/probes-in-nested-modules.qbs +++ b/tests/auto/blackbox/testdata/probes-in-nested-modules/probes-in-nested-modules.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs b/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs index f3d789842..5bc1fd613 100644 --- a/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs +++ b/tests/auto/blackbox/testdata/product-dependencies-by-type/modules/myconfig/myconfig.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property bool typeDecider: true } diff --git a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs index 1297a3942..8fa761a2d 100644 --- a/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs +++ b/tests/auto/blackbox/testdata/product-dependencies-by-type/product-dependencies-by-type.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/productproperties/app.qbs b/tests/auto/blackbox/testdata/productproperties/app.qbs index 405d08adb..b867aec3d 100644 --- a/tests/auto/blackbox/testdata/productproperties/app.qbs +++ b/tests/auto/blackbox/testdata/productproperties/app.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Product { consoleApplication: true type: "application" diff --git a/tests/auto/blackbox/testdata/productproperties/header.qbs b/tests/auto/blackbox/testdata/productproperties/header.qbs index 5c3e2db63..42f9c88d9 100644 --- a/tests/auto/blackbox/testdata/productproperties/header.qbs +++ b/tests/auto/blackbox/testdata/productproperties/header.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/productproperties/productproperties.qbs b/tests/auto/blackbox/testdata/productproperties/productproperties.qbs index 75c6224bc..79fdc34a2 100644 --- a/tests/auto/blackbox/testdata/productproperties/productproperties.qbs +++ b/tests/auto/blackbox/testdata/productproperties/productproperties.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { property string blubbProp: "5" references: ["header.qbs", "app.qbs"] diff --git a/tests/auto/blackbox/testdata/project_filepath_check/project1.qbs b/tests/auto/blackbox/testdata/project_filepath_check/project1.qbs index 5fc79d432..253992dd0 100644 --- a/tests/auto/blackbox/testdata/project_filepath_check/project1.qbs +++ b/tests/auto/blackbox/testdata/project_filepath_check/project1.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - CppApplication { files: "main.cpp" } diff --git a/tests/auto/blackbox/testdata/project_filepath_check/project2.qbs b/tests/auto/blackbox/testdata/project_filepath_check/project2.qbs index 9abdac987..8bae2dd60 100644 --- a/tests/auto/blackbox/testdata/project_filepath_check/project2.qbs +++ b/tests/auto/blackbox/testdata/project_filepath_check/project2.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - CppApplication { files: "main2.cpp" } diff --git a/tests/auto/blackbox/testdata/properties-in-export-items/properties-in-export-items.qbs b/tests/auto/blackbox/testdata/properties-in-export-items/properties-in-export-items.qbs index db9f3b2b4..a13578f95 100644 --- a/tests/auto/blackbox/testdata/properties-in-export-items/properties-in-export-items.qbs +++ b/tests/auto/blackbox/testdata/properties-in-export-items/properties-in-export-items.qbs @@ -1,5 +1,3 @@ -import qbs - Project { minimumQbsVersion: "1.6" diff --git a/tests/auto/blackbox/testdata/property-assignment-in-failed-module/modules/m/m.qbs b/tests/auto/blackbox/testdata/property-assignment-in-failed-module/modules/m/m.qbs index 38b15d807..8170c1991 100644 --- a/tests/auto/blackbox/testdata/property-assignment-in-failed-module/modules/m/m.qbs +++ b/tests/auto/blackbox/testdata/property-assignment-in-failed-module/modules/m/m.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property bool doFail Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/property-assignment-in-failed-module/property-assignment-in-failed-module.qbs b/tests/auto/blackbox/testdata/property-assignment-in-failed-module/property-assignment-in-failed-module.qbs index 8a3a6f359..baf315bfc 100644 --- a/tests/auto/blackbox/testdata/property-assignment-in-failed-module/property-assignment-in-failed-module.qbs +++ b/tests/auto/blackbox/testdata/property-assignment-in-failed-module/property-assignment-in-failed-module.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "app" Depends { name: "m"; required: false } diff --git a/tests/auto/blackbox/testdata/property-assignment-on-non-present-module/property-assignment-on-non-present-module.qbs b/tests/auto/blackbox/testdata/property-assignment-on-non-present-module/property-assignment-on-non-present-module.qbs index 4484a2542..a01d6c561 100644 --- a/tests/auto/blackbox/testdata/property-assignment-on-non-present-module/property-assignment-on-non-present-module.qbs +++ b/tests/auto/blackbox/testdata/property-assignment-on-non-present-module/property-assignment-on-non-present-module.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "nein"; required: false } nein.doch: "ohhh!" diff --git a/tests/auto/blackbox/testdata/property-precedence/dep.qbs b/tests/auto/blackbox/testdata/property-precedence/dep.qbs index c464b7d24..9f9668ceb 100644 --- a/tests/auto/blackbox/testdata/property-precedence/dep.qbs +++ b/tests/auto/blackbox/testdata/property-precedence/dep.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "dep" Export { diff --git a/tests/auto/blackbox/testdata/property-precedence/modules/leaf/leaf.qbs b/tests/auto/blackbox/testdata/property-precedence/modules/leaf/leaf.qbs index 1ccc95939..1bfb1a1b8 100644 --- a/tests/auto/blackbox/testdata/property-precedence/modules/leaf/leaf.qbs +++ b/tests/auto/blackbox/testdata/property-precedence/modules/leaf/leaf.qbs @@ -1,16 +1,10 @@ -import qbs - Module { property string scalarProp: "leaf" property stringList listProp: ["leaf"] Rule { inputs: ["rule-input"] - Artifact { - filePath: "dummy" - fileTags: ["rule-output"] - alwaysUpdated: false - } + outputFileTags: "rule-output" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/property-precedence/modules/nonleaf/nonleaf.qbs b/tests/auto/blackbox/testdata/property-precedence/modules/nonleaf/nonleaf.qbs index d67b261c1..a829da09d 100644 --- a/tests/auto/blackbox/testdata/property-precedence/modules/nonleaf/nonleaf.qbs +++ b/tests/auto/blackbox/testdata/property-precedence/modules/nonleaf/nonleaf.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "leaf" } diff --git a/tests/auto/blackbox/testdata/property-precedence/property-precedence.qbs b/tests/auto/blackbox/testdata/property-precedence/property-precedence.qbs index 5246c8a7b..1691376e8 100644 --- a/tests/auto/blackbox/testdata/property-precedence/property-precedence.qbs +++ b/tests/auto/blackbox/testdata/property-precedence/property-precedence.qbs @@ -1,5 +1,3 @@ -import qbs - Project { references: ["dep.qbs"] Product { diff --git a/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs b/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs index 14cdc570e..b1e4a1fdc 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/modules/TestModule/module.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Module { diff --git a/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs b/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs index da9a862c5..f13b1986e 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/propertyChanges.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.Environment import qbs.File import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/propertyChanges/ruletest.qbs b/tests/auto/blackbox/testdata/propertyChanges/ruletest.qbs index 21d6f75ef..1d8ea961c 100644 --- a/tests/auto/blackbox/testdata/propertyChanges/ruletest.qbs +++ b/tests/auto/blackbox/testdata/propertyChanges/ruletest.qbs @@ -1,5 +1,3 @@ -import qbs - Product { name: "ruletest" type: "test-output" diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook.proto b/tests/auto/blackbox/testdata/protobuf/addressbook.proto new file mode 100644 index 000000000..b4b33b4c6 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/addressbook.proto @@ -0,0 +1,51 @@ +// See README.txt for information and build instructions. +// +// Note: START and END tags are used in comments to define sections used in +// tutorials. They are not part of the syntax for Protocol Buffers. +// +// To get an in-depth walkthrough of this file and the related examples, see: +// https://developers.google.com/protocol-buffers/docs/tutorials + +// [START declaration] +syntax = "proto3"; +package tutorial; + +import "google/protobuf/timestamp.proto"; +// [END declaration] + +// [START java_declaration] +option java_package = "com.example.tutorial"; +option java_outer_classname = "AddressBookProtos"; +// [END java_declaration] + +// [START csharp_declaration] +option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; +// [END csharp_declaration] + +// [START messages] +message Person { + string name = 1; + int32 id = 2; // Unique ID number for this person. + string email = 3; + + enum PhoneType { + MOBILE = 0; + HOME = 1; + WORK = 2; + } + + message PhoneNumber { + string number = 1; + PhoneType type = 2; + } + + repeated PhoneNumber phones = 4; + + google.protobuf.Timestamp last_updated = 5; +} + +// Our address book file is just one of these. +message AddressBook { + repeated Person people = 1; +} +// [END messages] diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs new file mode 100644 index 000000000..a5a4caf75 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs @@ -0,0 +1,21 @@ +import qbs + +CppApplication { + name: "addressbook_cpp" + consoleApplication: true + condition: hasProtobuf + + Depends { name: "cpp" } + cpp.cxxLanguageVersion: "c++11" + + Depends { name: "protobuf.cpp"; required: false } + property bool hasProtobuf: { + console.info("has protobuf: " + protobuf.cpp.present); + return protobuf.cpp.present; + } + + files: [ + "addressbook.proto", + "main.cpp", + ] +} diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs new file mode 100644 index 000000000..be68abfee --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs @@ -0,0 +1,19 @@ +import qbs + +CppApplication { + name: "addressbook_objc" + consoleApplication: true + condition: hasProtobuf + + Depends { name: "cpp" } + Depends { name: "protobuf.objc"; required: false } + property bool hasProtobuf: { + console.info("has protobuf: " + protobuf.objc.present); + return protobuf.objc.present; + } + + files: [ + "addressbook.proto", + "main.m", + ] +} diff --git a/tests/auto/blackbox/testdata/protobuf/import-main.cpp b/tests/auto/blackbox/testdata/protobuf/import-main.cpp new file mode 100644 index 000000000..6d90cdf16 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/import-main.cpp @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Ivan Komissarov +** Contact: abbapoh@gmail.com +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include <import.pb.h> + +int main() +{ + MyMessage message; + message.set_msg("msg"); + return 0; +} diff --git a/tests/auto/blackbox/testdata/protobuf/import.proto b/tests/auto/blackbox/testdata/protobuf/import.proto new file mode 100644 index 000000000..d11e83b7a --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/import.proto @@ -0,0 +1,6 @@ +syntax = "proto2"; +import "subdir/myenum.proto"; + +message MyMessage { + required string msg = 1; +} diff --git a/tests/auto/blackbox/testdata/protobuf/import.qbs b/tests/auto/blackbox/testdata/protobuf/import.qbs new file mode 100644 index 000000000..4c4de063f --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/import.qbs @@ -0,0 +1,23 @@ +import qbs + +CppApplication { + name: "app" + consoleApplication: true + condition: hasProtobuf + + protobuf.cpp.importPaths: [sourceDirectory] + + cpp.cxxLanguageVersion: "c++11" + + Depends { name: "protobuf.cpp"; required: false } + property bool hasProtobuf: { + console.info("has protobuf: " + protobuf.cpp.present); + return protobuf.cpp.present; + } + + files: [ + "import.proto", + "import-main.cpp", + "subdir/myenum.proto", + ] +} diff --git a/tests/auto/blackbox/testdata/protobuf/main.cpp b/tests/auto/blackbox/testdata/protobuf/main.cpp new file mode 100644 index 000000000..c93c46717 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/main.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Ivan Komissarov +** Contact: abbapoh@gmail.com +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include <google/protobuf/util/time_util.h> +#include <string> + +#include "addressbook.pb.h" + +using google::protobuf::util::TimeUtil; + +int main(int /*argc*/, char* /*argv*/[]) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + tutorial::AddressBook addressBook; + + auto person = addressBook.add_people(); + person->set_name("name"); + person->set_id(1); + person->set_email("email"); + + auto phone_number = person->add_phones(); + phone_number->set_number("number"); + phone_number->set_type(tutorial::Person::MOBILE); + + *person->mutable_last_updated() = TimeUtil::SecondsToTimestamp(time(nullptr)); + + google::protobuf::ShutdownProtobufLibrary(); + + return 0; +} + diff --git a/tests/auto/blackbox/testdata/protobuf/main.m b/tests/auto/blackbox/testdata/protobuf/main.m new file mode 100644 index 000000000..e9d7ce66a --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/main.m @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Ivan Komissarov +** Contact: abbapoh@gmail.com +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#import "Addressbook.pbobjc.h" + +int main(int argc, char* argv[]) +{ + AddressBook *addressBook = [[AddressBook alloc] init]; + + Person *person = [[Person alloc] init]; + person.name = @"name"; + person.id_p = 1; + person.email = @"email"; + + Person_PhoneNumber *number = [[Person_PhoneNumber alloc] init]; + number.number = @"number"; + number.type = Person_PhoneType_Mobile; + + [addressBook.peopleArray addObject:person]; + [addressBook release]; + + return 0; +} diff --git a/tests/auto/blackbox/testdata/protobuf/needs-import-dir-main.cpp b/tests/auto/blackbox/testdata/protobuf/needs-import-dir-main.cpp new file mode 100644 index 000000000..d6faf9e84 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/needs-import-dir-main.cpp @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Ivan Komissarov +** Contact: abbapoh@gmail.com +** +** This file is part of Qbs. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms and +** conditions see http://www.qt.io/terms-conditions. For further information +** use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +#include <needs-import-dir.pb.h> + +int main() +{ + MyMessage message; + message.set_msg("msg"); + return 0; +} diff --git a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.proto b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.proto new file mode 100644 index 000000000..0d0cb6578 --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.proto @@ -0,0 +1,6 @@ +syntax = "proto2"; +import "myenum.proto"; + +message MyMessage { + required string msg = 1; +} diff --git a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs new file mode 100644 index 000000000..788bbc93c --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs @@ -0,0 +1,24 @@ +import qbs + +CppApplication { + name: "app" + consoleApplication: true + condition: hasProtobuf + + property path theImportDir + protobuf.cpp.importPaths: (theImportDir ? [theImportDir] : []).concat([sourceDirectory]) + + cpp.cxxLanguageVersion: "c++11" + + Depends { name: "protobuf.cpp"; required: false } + property bool hasProtobuf: { + console.info("has protobuf: " + protobuf.cpp.present); + return protobuf.cpp.present; + } + + files: [ + "needs-import-dir.proto", + "needs-import-dir-main.cpp", + "subdir/myenum.proto", + ] +} diff --git a/tests/auto/blackbox/testdata/protobuf/subdir/myenum.proto b/tests/auto/blackbox/testdata/protobuf/subdir/myenum.proto new file mode 100644 index 000000000..0b82869fc --- /dev/null +++ b/tests/auto/blackbox/testdata/protobuf/subdir/myenum.proto @@ -0,0 +1,6 @@ +syntax = "proto2"; + +enum MyEnum { + VAL1 = 0; + VAL2 = 1; +} diff --git a/tests/auto/blackbox/testdata/pseudo-multiplexing/pseudo-multiplexing.qbs b/tests/auto/blackbox/testdata/pseudo-multiplexing/pseudo-multiplexing.qbs index 0639adc8a..88c565ba2 100644 --- a/tests/auto/blackbox/testdata/pseudo-multiplexing/pseudo-multiplexing.qbs +++ b/tests/auto/blackbox/testdata/pseudo-multiplexing/pseudo-multiplexing.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "a" diff --git a/tests/auto/blackbox/testdata/qbsVersion/qbs-version.qbs b/tests/auto/blackbox/testdata/qbsVersion/qbs-version.qbs index d7ef0d68b..ced0f3a33 100644 --- a/tests/auto/blackbox/testdata/qbsVersion/qbs-version.qbs +++ b/tests/auto/blackbox/testdata/qbsVersion/qbs-version.qbs @@ -1,5 +1,3 @@ -import qbs - Project { property string qbsVersion property int qbsVersionMajor diff --git a/tests/auto/blackbox/testdata/rad-after-incomplete-build/project_with_rule.qbs b/tests/auto/blackbox/testdata/rad-after-incomplete-build/project_with_rule.qbs index 42ec452db..ca71ab930 100644 --- a/tests/auto/blackbox/testdata/rad-after-incomplete-build/project_with_rule.qbs +++ b/tests/auto/blackbox/testdata/rad-after-incomplete-build/project_with_rule.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/recursive_renaming/recursive_renaming.qbs b/tests/auto/blackbox/testdata/recursive_renaming/recursive_renaming.qbs index 5c2c4ec48..b49e9c53f 100644 --- a/tests/auto/blackbox/testdata/recursive_renaming/recursive_renaming.qbs +++ b/tests/auto/blackbox/testdata/recursive_renaming/recursive_renaming.qbs @@ -1,6 +1,5 @@ -import qbs 1.0 - Product { + qbs.installPrefix: "" Group { qbs.install: true qbs.installSourceBase: "." diff --git a/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs b/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs index 703a65e0e..4e9da01d3 100644 --- a/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs +++ b/tests/auto/blackbox/testdata/recursive_wildcards/recursive_wildcards.qbs @@ -1,8 +1,8 @@ -import qbs import qbs.TextFile Product { type: ["txt.out"] + qbs.installPrefix: "" Group { files: "dir/**" qbs.install: true diff --git a/tests/auto/blackbox/testdata/referenceErrorInExport/referenceErrorInExport.qbs b/tests/auto/blackbox/testdata/referenceErrorInExport/referenceErrorInExport.qbs index 91069f629..d64244f0f 100644 --- a/tests/auto/blackbox/testdata/referenceErrorInExport/referenceErrorInExport.qbs +++ b/tests/auto/blackbox/testdata/referenceErrorInExport/referenceErrorInExport.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { Depends { name: "other" } diff --git a/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs b/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs index e6f3cf66b..d42a760dd 100644 --- a/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs +++ b/tests/auto/blackbox/testdata/renameDependency/before/renameDependency.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["*.cpp", "*.h"] } diff --git a/tests/auto/blackbox/testdata/reproducible-build/reproducible-build.qbs b/tests/auto/blackbox/testdata/reproducible-build/reproducible-build.qbs index ebf2ba639..f7ed8e61a 100644 --- a/tests/auto/blackbox/testdata/reproducible-build/reproducible-build.qbs +++ b/tests/auto/blackbox/testdata/reproducible-build/reproducible-build.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { name: "the product" files: ["file1.cpp", "file2.cpp", "main.cpp"] diff --git a/tests/auto/blackbox/testdata/require-deprecated/require.qbs b/tests/auto/blackbox/testdata/require-deprecated/require.qbs index d30a15805..87d8b054b 100644 --- a/tests/auto/blackbox/testdata/require-deprecated/require.qbs +++ b/tests/auto/blackbox/testdata/require-deprecated/require.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import 'blubb.js' as blubb Product { diff --git a/tests/auto/blackbox/testdata/require/require.qbs b/tests/auto/blackbox/testdata/require/require.qbs index d30a15805..87d8b054b 100644 --- a/tests/auto/blackbox/testdata/require/require.qbs +++ b/tests/auto/blackbox/testdata/require/require.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import 'blubb.js' as blubb Product { diff --git a/tests/auto/blackbox/testdata/rescue-transformer-data/modules/m/m.qbs b/tests/auto/blackbox/testdata/rescue-transformer-data/modules/m/m.qbs index 03fdf7a6b..640d2c3b3 100644 --- a/tests/auto/blackbox/testdata/rescue-transformer-data/modules/m/m.qbs +++ b/tests/auto/blackbox/testdata/rescue-transformer-data/modules/m/m.qbs @@ -1,5 +1,3 @@ -import qbs - Module { property bool p diff --git a/tests/auto/blackbox/testdata/rescue-transformer-data/transformer-data-rescue.qbs b/tests/auto/blackbox/testdata/rescue-transformer-data/transformer-data-rescue.qbs index 2eafcc01d..4d266bbd4 100644 --- a/tests/auto/blackbox/testdata/rescue-transformer-data/transformer-data-rescue.qbs +++ b/tests/auto/blackbox/testdata/rescue-transformer-data/transformer-data-rescue.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { type: base.concat(["out"]) Depends { name: "m" } diff --git a/tests/auto/blackbox/testdata/response-files/response-files.qbs b/tests/auto/blackbox/testdata/response-files/response-files.qbs index 73eb720fe..fbb6f0518 100644 --- a/tests/auto/blackbox/testdata/response-files/response-files.qbs +++ b/tests/auto/blackbox/testdata/response-files/response-files.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile @@ -13,6 +12,7 @@ Project { type: ["text"] Depends { name: "cpp" } Depends { name: "cat-response-file" } + qbs.installPrefix: "" Group { fileTagsFilter: ["text"] qbs.install: true diff --git a/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs b/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs new file mode 100644 index 000000000..8af84bcd7 --- /dev/null +++ b/tests/auto/blackbox/testdata/retagged-output-artifact/retagged-output-artifact.qbs @@ -0,0 +1,42 @@ +import qbs.File +import qbs.TextFile + +Product { + name: "p" + type: "p_type" + property bool useTag1 + Rule { + multiplex: true + outputFileTags: ["tag1", "tag2"] + outputArtifacts: [{filePath: "a1.txt", fileTags: product.useTag1 ? "tag1" : "tag2"}] + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + }; + return cmd; + } + } + Rule { + inputs: "tag1" + Artifact { filePath: "a2.txt"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return cmd; + } + } + Rule { + inputs: "tag2" + Artifact { filePath: "a3.txt"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.filePath; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/rule-connection-with-excluded-inputs/rule-connection-with-excluded-inputs.qbs b/tests/auto/blackbox/testdata/rule-connection-with-excluded-inputs/rule-connection-with-excluded-inputs.qbs new file mode 100644 index 000000000..9d6482f90 --- /dev/null +++ b/tests/auto/blackbox/testdata/rule-connection-with-excluded-inputs/rule-connection-with-excluded-inputs.qbs @@ -0,0 +1,40 @@ +Product { + name: "p" + type: "p_type" + Rule { + multiplex: true + Artifact { filePath: "x.txt"; fileTags: "x" } + Artifact { filePath: "y.txt"; fileTags: "y" } + Artifact { filePath: "p.txt"; fileTags: "p_type" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() {}; + return cmd; + } + } + Rule { + multiplex: true + Artifact { filePath: "x2.txt"; fileTags: "x" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() {}; + return cmd; + } + } + Rule { + multiplex: true + inputs: "x" + excludedInputs: "y" + Artifact { filePath: "dummy"; fileTags: "p_type" } + prepare: { + console.info("inputs.x: " + (inputs.x ? inputs.x.length : 0)); + console.info("inputs.y: " + (inputs.y ? inputs.y.length : 0)); + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() {}; + return cmd; + } + } +} diff --git a/tests/auto/blackbox/testdata/rule-with-no-inputs/rule-with-no-inputs.qbs b/tests/auto/blackbox/testdata/rule-with-no-inputs/rule-with-no-inputs.qbs index 6e2bf4430..9c0f01217 100644 --- a/tests/auto/blackbox/testdata/rule-with-no-inputs/rule-with-no-inputs.qbs +++ b/tests/auto/blackbox/testdata/rule-with-no-inputs/rule-with-no-inputs.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/rule-with-non-required-inputs/rule-with-non-required-inputs.qbs b/tests/auto/blackbox/testdata/rule-with-non-required-inputs/rule-with-non-required-inputs.qbs index 6719bc69d..1bd9beebf 100644 --- a/tests/auto/blackbox/testdata/rule-with-non-required-inputs/rule-with-non-required-inputs.qbs +++ b/tests/auto/blackbox/testdata/rule-with-non-required-inputs/rule-with-non-required-inputs.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs index 187367388..0044537cb 100644 --- a/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs +++ b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.FileInfo import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs b/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs index 766bf3c5d..a8f7ffad2 100644 --- a/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs +++ b/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import "templates/zorduct.qbs" as Zorduct Project { diff --git a/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs b/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs index 8f19a5a6d..cddad8c30 100644 --- a/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs +++ b/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Product { type: ["application", "zort"] consoleApplication: true diff --git a/tests/auto/blackbox/testdata/ruleCycle/ruleCycle.qbs b/tests/auto/blackbox/testdata/ruleCycle/ruleCycle.qbs index 6898afeac..1c5d61d95 100644 --- a/tests/auto/blackbox/testdata/ruleCycle/ruleCycle.qbs +++ b/tests/auto/blackbox/testdata/ruleCycle/ruleCycle.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { name: "the cycle of life" diff --git a/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs b/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs index b28d7b822..48bdff904 100644 --- a/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs +++ b/tests/auto/blackbox/testdata/separate-debug-info/separate-debug-info.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "app1" diff --git a/tests/auto/blackbox/testdata/setup-build-environment/modules/buildenv/buildenv.qbs b/tests/auto/blackbox/testdata/setup-build-environment/modules/buildenv/buildenv.qbs index 9beb22393..9213c6469 100644 --- a/tests/auto/blackbox/testdata/setup-build-environment/modules/buildenv/buildenv.qbs +++ b/tests/auto/blackbox/testdata/setup-build-environment/modules/buildenv/buildenv.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment Module { diff --git a/tests/auto/blackbox/testdata/setup-build-environment/modules/m/m.qbs b/tests/auto/blackbox/testdata/setup-build-environment/modules/m/m.qbs index 81cf47bcd..74e718c50 100644 --- a/tests/auto/blackbox/testdata/setup-build-environment/modules/m/m.qbs +++ b/tests/auto/blackbox/testdata/setup-build-environment/modules/m/m.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/setup-build-environment/setup-build-environment.qbs b/tests/auto/blackbox/testdata/setup-build-environment/setup-build-environment.qbs index 3248815f0..c5a7e87e0 100644 --- a/tests/auto/blackbox/testdata/setup-build-environment/setup-build-environment.qbs +++ b/tests/auto/blackbox/testdata/setup-build-environment/setup-build-environment.qbs @@ -1,5 +1,3 @@ -import qbs - Project { Product { name: "first_product" diff --git a/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs b/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs index 9f841effd..b5ac8b289 100644 --- a/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs +++ b/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { @@ -8,12 +7,11 @@ Project { files: ["lib1.cpp"] - Group { - condition: !qbs.targetOS.contains("darwin") - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - qbs.installDir: "/lib1" - } + install: !qbs.targetOS.contains("darwin") + installImportLib: true + installDir: "lib1" + importLibInstallDir: installDir + Group { condition: qbs.targetOS.contains("darwin") fileTagsFilter: ["bundle.content"] @@ -41,16 +39,15 @@ Project { files: ["lib3.cpp"] - Properties { + Properties { condition: qbs.targetOS.contains("darwin") bundle.isBundle: false } - Group { - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - qbs.installDir: "/lib3" - } + install: true + installImportLib: true + installDir: "lib3" + importLibInstallDir: installDir } DynamicLibrary { // Non-dependency, referred to by name @@ -59,16 +56,15 @@ Project { files: ["lib4.cpp"] - Properties { + Properties { condition: qbs.targetOS.contains("darwin") bundle.isBundle: false } - Group { - fileTagsFilter: ["dynamiclibrary", "dynamiclibrary_import"] - qbs.install: true - qbs.installDir: "/lib4" - } + install: true + installImportLib: true + installDir: "lib4" + importLibInstallDir: installDir } DynamicLibrary { // Recursive product dependency diff --git a/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs b/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs index 44d8013b9..aac0692a8 100644 --- a/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs +++ b/tests/auto/blackbox/testdata/smart-relinking/smart-relinking.qbs @@ -1,5 +1,3 @@ -import qbs - Project { minimumQbsVersion: "1.6" Probe { diff --git a/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/main.cpp b/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/main.cpp new file mode 100644 index 000000000..237c8ce18 --- /dev/null +++ b/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/main.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/module_with_files.qbs b/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/module_with_files.qbs new file mode 100644 index 000000000..514248d27 --- /dev/null +++ b/tests/auto/blackbox/testdata/source-artifact-changes/modules/module_with_files/module_with_files.qbs @@ -0,0 +1,15 @@ +Module { + property stringList fileTags + property bool overrideTags + property bool filesAreTargets + + Depends { name: "cpp" } + + Group { + prefix: path + '/' + files: "main.cpp" + fileTags: product.module_with_files.fileTags + overrideTags: product.module_with_files.overrideTags + filesAreTargets: product.module_with_files.filesAreTargets + } +} diff --git a/tests/auto/blackbox/testdata/source-artifact-changes/source-artifact-changes.qbs b/tests/auto/blackbox/testdata/source-artifact-changes/source-artifact-changes.qbs new file mode 100644 index 000000000..de56376df --- /dev/null +++ b/tests/auto/blackbox/testdata/source-artifact-changes/source-artifact-changes.qbs @@ -0,0 +1,56 @@ +CppApplication { + name: "app" + type: base.concat("dummy") + consoleApplication: true + + Properties { + condition: qbs.targetOS.contains("darwin") + bundle.embedInfoPlist: false + } + + Probe { + id: toolchainProbe + property stringList toolchain: qbs.toolchain + configure: { + console.info("is gcc: " + toolchain.contains("gcc")); + found = true; + } + } + + Rule { + multiplex: true + inputs: "cpp" + Artifact { + filePath: "dummy" + fileTags: "dummy" + cpp.cxxLanguageVersion: "hoppla" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() { + if (output.cpp.cxxLanguageVersion !== "hoppla") + throw "This cannot be!"; + }; + return cmd; + } + } + + Rule { + multiplex: true + inputs: "cpp" + requiresInputs: false + Artifact { filePath: "dummy2"; fileTags: "dummy" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.silent = true; + cmd.sourceCode = function() { + console.info("cpp artifacts: " + + (product.artifacts.cpp ? product.artifacts.cpp.length : 0)) + }; + return cmd; + } + } + + Depends { name: "module_with_files" } +} diff --git a/tests/auto/blackbox/testdata/source-artifact-in-inputs-from-dependencies/source-artifact-in-inputs-from-dependencies.qbs b/tests/auto/blackbox/testdata/source-artifact-in-inputs-from-dependencies/source-artifact-in-inputs-from-dependencies.qbs index ef038a687..3486667f9 100644 --- a/tests/auto/blackbox/testdata/source-artifact-in-inputs-from-dependencies/source-artifact-in-inputs-from-dependencies.qbs +++ b/tests/auto/blackbox/testdata/source-artifact-in-inputs-from-dependencies/source-artifact-in-inputs-from-dependencies.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/soversion/soversion.qbs b/tests/auto/blackbox/testdata/soversion/soversion.qbs index d024c25b9..6ce2144c0 100644 --- a/tests/auto/blackbox/testdata/soversion/soversion.qbs +++ b/tests/auto/blackbox/testdata/soversion/soversion.qbs @@ -1,5 +1,3 @@ -import qbs - DynamicLibrary { name: "mylib" property bool useVersion diff --git a/tests/auto/blackbox/testdata/static-lib-without-sources/static-lib-without-sources.qbs b/tests/auto/blackbox/testdata/static-lib-without-sources/static-lib-without-sources.qbs index 6109b428c..32a58c94b 100644 --- a/tests/auto/blackbox/testdata/static-lib-without-sources/static-lib-without-sources.qbs +++ b/tests/auto/blackbox/testdata/static-lib-without-sources/static-lib-without-sources.qbs @@ -1,5 +1,3 @@ -import qbs - Project { StaticLibrary { name: "a" diff --git a/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs b/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs index b3fba23fe..8abd12869 100644 --- a/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs +++ b/tests/auto/blackbox/testdata/subprofile-change-tracking/subprofile-change-tracking.qbs @@ -1,5 +1,3 @@ -import qbs - Project { CppApplication { name: "app1"; files: ["main1.cpp"] } CppApplication { diff --git a/tests/auto/blackbox/testdata/successive-changes/successive-changes.qbs b/tests/auto/blackbox/testdata/successive-changes/successive-changes.qbs index f42ca4096..77df81e39 100644 --- a/tests/auto/blackbox/testdata/successive-changes/successive-changes.qbs +++ b/tests/auto/blackbox/testdata/successive-changes/successive-changes.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/suspicious-calls/copy-command.qbs b/tests/auto/blackbox/testdata/suspicious-calls/copy-command.qbs index e01435fc0..3d43ef1f5 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/copy-command.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/copy-command.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { @@ -9,10 +8,7 @@ Product { } Rule { inputs: ["in"] - Artifact { - filePath: "dummy.txt" - fileTags: ["out"] - } + outputFileTags: "out" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/suspicious-calls/copy-eval.qbs b/tests/auto/blackbox/testdata/suspicious-calls/copy-eval.qbs index 93bfca81d..b074c00cf 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/copy-eval.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/copy-eval.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { diff --git a/tests/auto/blackbox/testdata/suspicious-calls/copy-prepare.qbs b/tests/auto/blackbox/testdata/suspicious-calls/copy-prepare.qbs index b6098e8de..0408c9d5a 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/copy-prepare.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/copy-prepare.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { @@ -9,10 +8,7 @@ Product { } Rule { inputs: ["in"] - Artifact { - filePath: "dummy.txt" - fileTags: ["out"] - } + outputFileTags: "out" prepare: { File.copy(input.filePath, output.filePath); var cmd = new JavaScriptCommand(); diff --git a/tests/auto/blackbox/testdata/suspicious-calls/copy-probe.qbs b/tests/auto/blackbox/testdata/suspicious-calls/copy-probe.qbs index dd97839c2..f47b204d5 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/copy-probe.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/copy-probe.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { diff --git a/tests/auto/blackbox/testdata/suspicious-calls/direntries-command.qbs b/tests/auto/blackbox/testdata/suspicious-calls/direntries-command.qbs index d15351c25..c20d6f2ef 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/direntries-command.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/direntries-command.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { @@ -9,10 +8,7 @@ Product { } Rule { inputs: ["in"] - Artifact { - filePath: "dummy.txt" - fileTags: ["out"] - } + outputFileTags: "out" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/suspicious-calls/direntries-eval.qbs b/tests/auto/blackbox/testdata/suspicious-calls/direntries-eval.qbs index 4cd0d634e..2a759d93a 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/direntries-eval.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/direntries-eval.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { diff --git a/tests/auto/blackbox/testdata/suspicious-calls/direntries-prepare.qbs b/tests/auto/blackbox/testdata/suspicious-calls/direntries-prepare.qbs index 6f7320110..7b39a8969 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/direntries-prepare.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/direntries-prepare.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { @@ -9,10 +8,7 @@ Product { } Rule { inputs: ["in"] - Artifact { - filePath: "dummy.txt" - fileTags: ["out"] - } + outputFileTags: "out" prepare: { var dummy = File.directoryEntries(product.sourceDirectory, File.Files); var cmd = new JavaScriptCommand(); diff --git a/tests/auto/blackbox/testdata/suspicious-calls/direntries-probe.qbs b/tests/auto/blackbox/testdata/suspicious-calls/direntries-probe.qbs index d2c8b8ded..fff82df81 100644 --- a/tests/auto/blackbox/testdata/suspicious-calls/direntries-probe.qbs +++ b/tests/auto/blackbox/testdata/suspicious-calls/direntries-probe.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.File Product { diff --git a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs index 624b1abb0..2d3d64b00 100644 --- a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs +++ b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs b/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs index fc47c450f..4aa36142d 100644 --- a/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs +++ b/tests/auto/blackbox/testdata/symlink-removal/symlink-removal.qbs @@ -1,14 +1,10 @@ -import qbs import qbs.File Product { type: "removal" Rule { multiplex: true - Artifact { - filePath: "dummy" - fileTags: product.type - } + outputFileTags: "removal" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; diff --git a/tests/auto/blackbox/testdata/system-include-paths/system-include-paths.qbs b/tests/auto/blackbox/testdata/system-include-paths/system-include-paths.qbs index 081d40202..9c644fc2a 100644 --- a/tests/auto/blackbox/testdata/system-include-paths/system-include-paths.qbs +++ b/tests/auto/blackbox/testdata/system-include-paths/system-include-paths.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { files: ["main.cpp"] cpp.systemIncludePaths: ["subdir"] diff --git a/tests/auto/blackbox/testdata/system-run-paths/system-run-paths.qbs b/tests/auto/blackbox/testdata/system-run-paths/system-run-paths.qbs index 81778d6f7..6e2137173 100644 --- a/tests/auto/blackbox/testdata/system-run-paths/system-run-paths.qbs +++ b/tests/auto/blackbox/testdata/system-run-paths/system-run-paths.qbs @@ -1,11 +1,10 @@ -import qbs - Project { property bool setRunPaths Product { name: "theLib" type: ["dynamiclibrary"] Depends { name: "cpp" } + qbs.installPrefix: "" Group { fileTagsFilter: product.type qbs.install: true diff --git a/tests/auto/blackbox/testdata/texttemplate/cdefgabc.txt.in b/tests/auto/blackbox/testdata/texttemplate/cdefgabc.txt.in new file mode 100644 index 000000000..9e3a753bc --- /dev/null +++ b/tests/auto/blackbox/testdata/texttemplate/cdefgabc.txt.in @@ -0,0 +1 @@ +${c} ${d} ${e} ${f} ${g} ${a} ${b} ${c} diff --git a/tests/auto/blackbox/testdata/texttemplate/expected/lalala.txt b/tests/auto/blackbox/testdata/texttemplate/expected/lalala.txt new file mode 100644 index 000000000..c47434717 --- /dev/null +++ b/tests/auto/blackbox/testdata/texttemplate/expected/lalala.txt @@ -0,0 +1 @@ +do re mi fa so la ti do diff --git a/tests/auto/blackbox/testdata/texttemplate/expected/output.txt b/tests/auto/blackbox/testdata/texttemplate/expected/output.txt new file mode 100644 index 000000000..5c4b1a82a --- /dev/null +++ b/tests/auto/blackbox/testdata/texttemplate/expected/output.txt @@ -0,0 +1,12 @@ +foo bar baz +fu bar baz +foo BAR baz +foo bar buzz +fu BAR baz +fu bar buzz +fu BAR buzz +fooBARbaz +foo\BARbaz +foo\\BARbaz +foo\\\BARbaz +foo${bar}baz diff --git a/tests/auto/blackbox/testdata/texttemplate/output.txt.in b/tests/auto/blackbox/testdata/texttemplate/output.txt.in new file mode 100644 index 000000000..f5f645b73 --- /dev/null +++ b/tests/auto/blackbox/testdata/texttemplate/output.txt.in @@ -0,0 +1,12 @@ +foo bar baz +${foo} bar baz +foo ${bar} baz +foo bar ${baz} +${foo} ${bar} baz +${foo} bar ${baz} +${foo} ${bar} ${baz} +foo${bar}baz +foo\${bar}baz +foo\\${bar}baz +foo\\\${bar}baz +foo${$}{bar}baz diff --git a/tests/auto/blackbox/testdata/texttemplate/texttemplatetest.qbs b/tests/auto/blackbox/testdata/texttemplate/texttemplatetest.qbs new file mode 100644 index 000000000..6abda64f9 --- /dev/null +++ b/tests/auto/blackbox/testdata/texttemplate/texttemplatetest.qbs @@ -0,0 +1,24 @@ +Product { + name: "one" + type: ["text"] + files: ["output.txt.in"] + Depends { name: "texttemplate" } + texttemplate.dict: ({ + foo: "fu", + bar: "BAR", + baz: "buzz", + }) + Group { + files: ["cdefgabc.txt.in"] + texttemplate.outputFileName: "lalala.txt" + texttemplate.dict: ({ + c: "do", + d: "re", + e: "mi", + f: "fa", + g: "so", + a: "la", + b: "ti", + }) + } +} diff --git a/tests/auto/blackbox/testdata/toplevel-searchpath/qbs-resources/imports/MyProduct.qbs b/tests/auto/blackbox/testdata/toplevel-searchpath/qbs-resources/imports/MyProduct.qbs index 6d16a3c53..86718b571 100644 --- a/tests/auto/blackbox/testdata/toplevel-searchpath/qbs-resources/imports/MyProduct.qbs +++ b/tests/auto/blackbox/testdata/toplevel-searchpath/qbs-resources/imports/MyProduct.qbs @@ -1,3 +1 @@ -import qbs - Product { } diff --git a/tests/auto/blackbox/testdata/toplevel-searchpath/toplevel-searchpath.qbs b/tests/auto/blackbox/testdata/toplevel-searchpath/toplevel-searchpath.qbs index 2dd54a81f..8ca6cfca9 100644 --- a/tests/auto/blackbox/testdata/toplevel-searchpath/toplevel-searchpath.qbs +++ b/tests/auto/blackbox/testdata/toplevel-searchpath/toplevel-searchpath.qbs @@ -1,3 +1 @@ -import qbs - MyProduct { } diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs b/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs index 469aff097..f4b9ba21f 100644 --- a/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs +++ b/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { name: 'someapp' diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs b/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs index fc647cdbe..bb0ab7d44 100644 --- a/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs +++ b/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { Product { name: 'someapp' diff --git a/tests/auto/blackbox/testdata/trackExternalProductChanges/trackExternalProductChanges.qbs b/tests/auto/blackbox/testdata/trackExternalProductChanges/trackExternalProductChanges.qbs index 232c8ea41..534f49ff2 100644 --- a/tests/auto/blackbox/testdata/trackExternalProductChanges/trackExternalProductChanges.qbs +++ b/tests/auto/blackbox/testdata/trackExternalProductChanges/trackExternalProductChanges.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Environment import "fileList.js" as FileList diff --git a/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs b/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs index c0e5c4715..869ce238b 100644 --- a/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs +++ b/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs b/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs index 7ac895c5f..ebe31bf26 100644 --- a/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs +++ b/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs @@ -1,4 +1,3 @@ -import qbs 1.0 import qbs.TextFile Project { diff --git a/tests/auto/blackbox/testdata/trackProducts/after/product3.qbs b/tests/auto/blackbox/testdata/trackProducts/after/product3.qbs index 4dac755c0..bd9cdc009 100644 --- a/tests/auto/blackbox/testdata/trackProducts/after/product3.qbs +++ b/tests/auto/blackbox/testdata/trackProducts/after/product3.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Product { Depends { name: "cpp" } type: "application" diff --git a/tests/auto/blackbox/testdata/trackProducts/after/trackProducts.qbs b/tests/auto/blackbox/testdata/trackProducts/after/trackProducts.qbs index 343405c08..2935ed1df 100644 --- a/tests/auto/blackbox/testdata/trackProducts/after/trackProducts.qbs +++ b/tests/auto/blackbox/testdata/trackProducts/after/trackProducts.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { name: "trackProducts" diff --git a/tests/auto/blackbox/testdata/trackProducts/before/product1.qbs b/tests/auto/blackbox/testdata/trackProducts/before/product1.qbs index 60e8b0924..48176c809 100644 --- a/tests/auto/blackbox/testdata/trackProducts/before/product1.qbs +++ b/tests/auto/blackbox/testdata/trackProducts/before/product1.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Product { Depends { name: "cpp" } type: "application" diff --git a/tests/auto/blackbox/testdata/trackProducts/before/product2.qbs b/tests/auto/blackbox/testdata/trackProducts/before/product2.qbs index 5490b8844..be250486d 100644 --- a/tests/auto/blackbox/testdata/trackProducts/before/product2.qbs +++ b/tests/auto/blackbox/testdata/trackProducts/before/product2.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Product { Depends { name: "cpp" } type: "application" diff --git a/tests/auto/blackbox/testdata/trackProducts/before/trackProducts.qbs b/tests/auto/blackbox/testdata/trackProducts/before/trackProducts.qbs index 6d5555c68..8b5edb6bf 100644 --- a/tests/auto/blackbox/testdata/trackProducts/before/trackProducts.qbs +++ b/tests/auto/blackbox/testdata/trackProducts/before/trackProducts.qbs @@ -1,5 +1,3 @@ -import qbs 1.0 - Project { name: "trackProducts" diff --git a/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/a/a.qbs b/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/a/a.qbs index adec14e41..ffe7ef70a 100644 --- a/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/a/a.qbs +++ b/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/a/a.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "b"; required: false } } diff --git a/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/b/b.qbs b/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/b/b.qbs index fb38b600a..ba08b862b 100644 --- a/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/b/b.qbs +++ b/tests/auto/blackbox/testdata/transitive-optional-dependencies/modules/b/b.qbs @@ -1,5 +1,3 @@ -import qbs - Module { condition: false } diff --git a/tests/auto/blackbox/testdata/transitive-optional-dependencies/transitive-optional-dependencies.qbs b/tests/auto/blackbox/testdata/transitive-optional-dependencies/transitive-optional-dependencies.qbs index 08860b057..6171fa94f 100644 --- a/tests/auto/blackbox/testdata/transitive-optional-dependencies/transitive-optional-dependencies.qbs +++ b/tests/auto/blackbox/testdata/transitive-optional-dependencies/transitive-optional-dependencies.qbs @@ -1,5 +1,3 @@ -import qbs - Product { Depends { name: "a" } } diff --git a/tests/auto/blackbox/testdata/typescript/typescript.qbs b/tests/auto/blackbox/testdata/typescript/typescript.qbs index b6604830f..28c62eb45 100644 --- a/tests/auto/blackbox/testdata/typescript/typescript.qbs +++ b/tests/auto/blackbox/testdata/typescript/typescript.qbs @@ -1,5 +1,3 @@ -import qbs - Project { NodeJSApplication { Depends { name: "typescript" } diff --git a/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/usings-as-sole-inputs-non-multiplexed.qbs b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/usings-as-sole-inputs-non-multiplexed.qbs index 7d4087620..cd2d23895 100644 --- a/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/usings-as-sole-inputs-non-multiplexed.qbs +++ b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/usings-as-sole-inputs-non-multiplexed.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo import qbs.TextFile diff --git a/tests/auto/blackbox/testdata/variant-suffix/variant-suffix.qbs b/tests/auto/blackbox/testdata/variant-suffix/variant-suffix.qbs index b919f84eb..b6e025e4c 100644 --- a/tests/auto/blackbox/testdata/variant-suffix/variant-suffix.qbs +++ b/tests/auto/blackbox/testdata/variant-suffix/variant-suffix.qbs @@ -1,5 +1,3 @@ -import qbs - StaticLibrary { name: "l" @@ -22,11 +20,8 @@ StaticLibrary { cpp.staticLibraryPrefix: "lib" cpp.staticLibrarySuffix: ".ext" - Group { - fileTagsFilter: ["staticlibrary"] - qbs.install: true - qbs.installDir: "lib" - } + qbs.installPrefix: "" + install: true Depends { name: "cpp" } diff --git a/tests/auto/blackbox/testdata/vcs/vcstest.qbs b/tests/auto/blackbox/testdata/vcs/vcstest.qbs index 11d001743..5d359e2c7 100644 --- a/tests/auto/blackbox/testdata/vcs/vcstest.qbs +++ b/tests/auto/blackbox/testdata/vcs/vcstest.qbs @@ -1,5 +1,3 @@ -import qbs - CppApplication { Depends { name: "vcs" } vcs.headerFileName: "my-repo-state.h" diff --git a/tests/auto/blackbox/testdata/versioncheck/modules/higher/higher.qbs b/tests/auto/blackbox/testdata/versioncheck/modules/higher/higher.qbs index 4a9c85ceb..c5ab20f58 100644 --- a/tests/auto/blackbox/testdata/versioncheck/modules/higher/higher.qbs +++ b/tests/auto/blackbox/testdata/versioncheck/modules/higher/higher.qbs @@ -1,5 +1,3 @@ -import qbs - Module { Depends { name: "lower" diff --git a/tests/auto/blackbox/testdata/versioncheck/modules/lower/lower.qbs b/tests/auto/blackbox/testdata/versioncheck/modules/lower/lower.qbs index 9322b53b1..cd8c6471d 100644 --- a/tests/auto/blackbox/testdata/versioncheck/modules/lower/lower.qbs +++ b/tests/auto/blackbox/testdata/versioncheck/modules/lower/lower.qbs @@ -1,3 +1 @@ -import qbs - Module { } diff --git a/tests/auto/blackbox/testdata/versioncheck/versioncheck.qbs b/tests/auto/blackbox/testdata/versioncheck/versioncheck.qbs index 8214428f1..63bef1d75 100644 --- a/tests/auto/blackbox/testdata/versioncheck/versioncheck.qbs +++ b/tests/auto/blackbox/testdata/versioncheck/versioncheck.qbs @@ -1,5 +1,3 @@ -import qbs - Product { property string requestedMinVersion property string requestedMaxVersion diff --git a/tests/auto/blackbox/testdata/versionscript/versionscript.qbs b/tests/auto/blackbox/testdata/versionscript/versionscript.qbs index 0309d3e06..cc5c7b1cc 100644 --- a/tests/auto/blackbox/testdata/versionscript/versionscript.qbs +++ b/tests/auto/blackbox/testdata/versionscript/versionscript.qbs @@ -1,5 +1,3 @@ -import qbs - DynamicLibrary { type: base.concat("custom") Depends { name: "cpp" } @@ -12,10 +10,7 @@ DynamicLibrary { Rule { multiplex: true - Artifact { - filePath: "dummy.txt" - fileTags: ["custom"] - } + outputFileTags: "custom" prepare: { var cmd = new JavaScriptCommand(); cmd.silent = true; @@ -26,8 +21,7 @@ DynamicLibrary { } } - Group { - fileTagsFilter: ["dynamiclibrary"] - qbs.install: true - } + qbs.installPrefix: "" + install: true + installDir: "" } diff --git a/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs b/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs index 4ab93af28..f3bcff2cd 100644 --- a/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs +++ b/tests/auto/blackbox/testdata/whole-archive/whole-archive.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.Utilities Project { diff --git a/tests/auto/blackbox/testdata/wildcard_renaming/wildcard_renaming.qbs b/tests/auto/blackbox/testdata/wildcard_renaming/wildcard_renaming.qbs index 4cb2c071c..124161880 100644 --- a/tests/auto/blackbox/testdata/wildcard_renaming/wildcard_renaming.qbs +++ b/tests/auto/blackbox/testdata/wildcard_renaming/wildcard_renaming.qbs @@ -1,6 +1,5 @@ -import qbs 1.0 - Product { + qbs.installPrefix: "" Group { qbs.install: true files: "*" diff --git a/tests/auto/blackbox/testdata/wildcards-and-rules/wildcards-and-rules.qbs b/tests/auto/blackbox/testdata/wildcards-and-rules/wildcards-and-rules.qbs index 88fadd3a5..f6662529d 100644 --- a/tests/auto/blackbox/testdata/wildcards-and-rules/wildcards-and-rules.qbs +++ b/tests/auto/blackbox/testdata/wildcards-and-rules/wildcards-and-rules.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Product { diff --git a/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs b/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs index eabb6da1e..07f61ba2c 100644 --- a/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs +++ b/tests/auto/blackbox/testdata/wix/WiXInstallers.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.FileInfo Project { diff --git a/tests/auto/blackbox/testdata/wixDependencies/wixDependencies.qbs b/tests/auto/blackbox/testdata/wixDependencies/wixDependencies.qbs index 2d9763ef1..d42a18054 100644 --- a/tests/auto/blackbox/testdata/wixDependencies/wixDependencies.qbs +++ b/tests/auto/blackbox/testdata/wixDependencies/wixDependencies.qbs @@ -1,4 +1,3 @@ -import qbs import qbs.TextFile Project { @@ -35,7 +34,7 @@ Project { // This rule tries to provoke the installer into building too early (and the test // verifies that it does not) by causing the build of the installables to take // a lot longer. - inputs: ["qbs"] + multiplex: true outputFileTags: ["c"] outputArtifacts: { var artifacts = []; diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 598836c81..de0e2c26d 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -259,6 +259,19 @@ void TestBlackbox::tar() QCOMPARE(listContents.readAllStandardOutput(), listFile.readAll()); } +void TestBlackbox::textTemplate() +{ + QVERIFY(QDir::setCurrent(testDataDir + "/texttemplate")); + rmDirR(relativeBuildDir()); + QCOMPARE(runQbs(), 0); + QString outputFilePath = relativeProductBuildDir("one") + "/output.txt"; + QString expectedOutputFilePath = QFINDTESTDATA("expected/output.txt"); + TEXT_FILE_COMPARE(outputFilePath, expectedOutputFilePath); + outputFilePath = relativeProductBuildDir("one") + "/lalala.txt"; + expectedOutputFilePath = QFINDTESTDATA("expected/lalala.txt"); + TEXT_FILE_COMPARE(outputFilePath, expectedOutputFilePath); +} + static QStringList sortedFileList(const QByteArray &ba) { auto list = QString::fromUtf8(ba).split(QRegExp("[\r\n]"), QString::SkipEmptyParts); @@ -329,12 +342,15 @@ TestBlackbox::TestBlackbox() : TestBlackboxBase (SRCDIR "/testdata", "blackbox") void TestBlackbox::addFileTagToGeneratedArtifact() { QDir::setCurrent(testDataDir + "/add-filetag-to-generated-artifact"); - QCOMPARE(runQbs(), 0); + QCOMPARE(runQbs(QStringList("project.enableTagging:true")), 0); QVERIFY2(m_qbsStdout.contains("compressing my_app"), m_qbsStdout.constData()); const QString compressedAppFilePath = relativeProductBuildDir("my_compressed_app") + '/' + qbs::Internal::HostOsInfo::appendExecutableSuffix("compressed-my_app"); QVERIFY(regularFileExists(compressedAppFilePath)); + QCOMPARE(runQbs(QbsRunParameters("resolve", QStringList("project.enableTagging:false"))), 0); + QCOMPARE(runQbs(), 0); + QVERIFY(!regularFileExists(compressedAppFilePath)); } void TestBlackbox::alwaysRun() @@ -392,7 +408,7 @@ void TestBlackbox::artifactsMapChangeTracking() const QString projectFile("artifacts-map-change-tracking.qbs"); REPLACE_IN_FILE(projectFile, "TheBinary", "TheNewBinary"); QCOMPARE(runQbs(QStringList{"-p", "TheApp"}), 0); - QEXPECT_FAIL("", "change tracking could become even more fine-grained", Continue); + QVERIFY2(!m_qbsStdout.contains("running rule for test.cpp"), m_qbsStdout.constData()); QVERIFY2(!m_qbsStdout.contains("creating test.cpp"), m_qbsStdout.constData()); QVERIFY2(m_qbsStdout.contains("linking"), m_qbsStdout.constData()); @@ -473,11 +489,7 @@ void TestBlackbox::artifactsMapInvalidation() const QString projectDir = testDataDir + "/artifacts-map-invalidation"; QDir::setCurrent(projectDir); QCOMPARE(runQbs(), 0); - QFile sourceFile("file.in"); - QVERIFY2(sourceFile.open(QIODevice::ReadOnly), qPrintable(sourceFile.errorString())); - QFile generatedFile(relativeProductBuildDir("p") + "/myfile.out"); - QVERIFY2(generatedFile.open(QIODevice::ReadOnly), qPrintable(generatedFile.errorString())); - QCOMPARE(sourceFile.readAll(), generatedFile.readAll()); + TEXT_FILE_COMPARE(relativeProductBuildDir("p") + "/myfile.out", "file.in"); } void TestBlackbox::artifactsMapRaceCondition() @@ -720,6 +732,19 @@ void TestBlackbox::changedFiles() QVERIFY2(m_qbsStdout.contains("file1.cpp"), m_qbsStdout.constData()); } +void TestBlackbox::changedInputsFromDependencies() +{ + QDir::setCurrent(testDataDir + "/changed-inputs-from-dependencies"); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("final prepare script"), m_qbsStdout.constData()); + QCOMPARE(runQbs(), 0); + QVERIFY2(!m_qbsStdout.contains("final prepare script"), m_qbsStdout.constData()); + WAIT_FOR_NEW_TIMESTAMP(); + touch("input.txt"); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("final prepare script"), m_qbsStdout.constData()); +} + void TestBlackbox::changedRuleInputs() { QDir::setCurrent(testDataDir + "/changed-rule-inputs"); @@ -2217,7 +2242,7 @@ void TestBlackbox::referenceErrorInExport() params.expectFailure = true; QVERIFY(runQbs(params) != 0); QVERIFY(m_qbsStderr.contains( - "referenceErrorInExport.qbs:17:12 ReferenceError: Can't find variable: includePaths")); + "referenceErrorInExport.qbs:15:12 ReferenceError: Can't find variable: includePaths")); } void TestBlackbox::reproducibleBuild() @@ -2278,6 +2303,29 @@ void TestBlackbox::responseFiles() QCOMPARE(lines, expected); } +void TestBlackbox::retaggedOutputArtifact() +{ + QDir::setCurrent(testDataDir + "/retagged-output-artifact"); + QbsRunParameters resolveParams("resolve"); + resolveParams.arguments = QStringList("products.p.useTag1:true"); + QCOMPARE(runQbs(resolveParams), 0); + QCOMPARE(runQbs(), 0); + const QString a2 = relativeProductBuildDir("p") + "/a2.txt"; + const QString a3 = relativeProductBuildDir("p") + "/a3.txt"; + QVERIFY2(QFile::exists(a2), qPrintable(a2)); + QVERIFY2(!QFile::exists(a3), qPrintable(a3)); + resolveParams.arguments = QStringList("products.p.useTag1:false"); + QCOMPARE(runQbs(resolveParams), 0); + QCOMPARE(runQbs(), 0); + QVERIFY2(!QFile::exists(a2), qPrintable(a2)); + QVERIFY2(QFile::exists(a3), qPrintable(a3)); + resolveParams.arguments = QStringList("products.p.useTag1:true"); + QCOMPARE(runQbs(resolveParams), 0); + QCOMPARE(runQbs(), 0); + QVERIFY2(QFile::exists(a2), qPrintable(a2)); + QVERIFY2(!QFile::exists(a3), qPrintable(a3)); +} + void TestBlackbox::ruleConditions() { QDir::setCurrent(testDataDir + "/ruleConditions"); @@ -2288,6 +2336,14 @@ void TestBlackbox::ruleConditions() QVERIFY(!QFileInfo(relativeProductBuildDir("unzorted") + "/unzorted.foo.narf.zort").exists()); } +void TestBlackbox::ruleConnectionWithExcludedInputs() +{ + QDir::setCurrent(testDataDir + "/rule-connection-with-excluded-inputs"); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("inputs.x: 2") && m_qbsStdout.contains("inputs.y: 0"), + m_qbsStdout.constData()); +} + void TestBlackbox::ruleCycle() { QDir::setCurrent(testDataDir + "/ruleCycle"); @@ -2525,6 +2581,82 @@ void TestBlackbox::soVersion_data() QTest::newRow("no version, empty soVersion") << QString("") << false << QString("libmylib.so"); } +void TestBlackbox::sourceArtifactChanges() +{ + QDir::setCurrent(testDataDir + "/source-artifact-changes"); + bool useCustomFileTags = false; + bool overrideFileTags = true; + bool filesAreTargets = false; + bool useCxx11 = false; + const QString appFilePath = QDir::currentPath() + '/' + relativeExecutableFilePath("app"); + static const auto b2s = [](bool b) { return QString(b ? "true" : "false"); }; + const auto resolveParams = [&useCustomFileTags, &overrideFileTags, &filesAreTargets, &useCxx11] { + return QbsRunParameters("resolve", QStringList{ + "modules.module_with_files.overrideTags:" + b2s(overrideFileTags), + "modules.module_with_files.filesAreTargets:" + b2s(filesAreTargets), + "modules.module_with_files.fileTags:" + QString(useCustomFileTags ? "custom" : "cpp"), + "modules.cpp.cxxLanguageVersion:" + QString(useCxx11 ? "c++11" : "c++98") + }); + }; +#define VERIFY_COMPILATION(expected) \ + do { \ + QVERIFY2(m_qbsStdout.contains("compiling main.cpp") == expected, m_qbsStdout.constData()); \ + QVERIFY2(QFile::exists(appFilePath) == expected, qPrintable(appFilePath)); \ + if (expected) \ + QVERIFY2(m_qbsStdout.contains("cpp artifacts: 1"), m_qbsStdout.constData()); \ + else \ + QVERIFY2(m_qbsStdout.contains("cpp artifacts: 0"), m_qbsStdout.constData()); \ + } while (false) + + // Initial build. + QCOMPARE(runQbs(resolveParams()), 0); + QVERIFY2(m_qbsStdout.contains("is gcc: "), m_qbsStdout.constData()); + const bool isGcc = m_qbsStdout.contains("is gcc: true"); + QCOMPARE(runQbs(), 0); + VERIFY_COMPILATION(true); + + // Overwrite the file tags. Now the source file is no longer tagged "cpp" and nothing + // should get built. + WAIT_FOR_NEW_TIMESTAMP(); + touch("modules/module_with_files/main.cpp"); + useCustomFileTags = true; + QCOMPARE(runQbs(resolveParams()), 0); + QCOMPARE(runQbs(), 0); + VERIFY_COMPILATION(false); + + // Now the custom file tag exists in addition to "cpp", and the app should get built again. + overrideFileTags = false; + QCOMPARE(runQbs(resolveParams()), 0); + QCOMPARE(runQbs(), 0); + VERIFY_COMPILATION(true); + + // Mark the cpp file as a module target. Now it will no longer be considered an input + // by the compiler rule, and nothing should get built. + WAIT_FOR_NEW_TIMESTAMP(); + touch("modules/module_with_files/main.cpp"); + filesAreTargets = true; + QCOMPARE(runQbs(resolveParams()), 0); + QCOMPARE(runQbs(), 0); + VERIFY_COMPILATION(false); + + // Now just revert the last change. + filesAreTargets = false; + QCOMPARE(runQbs(resolveParams()), 0); + QCOMPARE(runQbs(), 0); + VERIFY_COMPILATION(true); + + // Change a relevant cpp property. A rebuild is expected. + useCxx11 = true; + QCOMPARE(runQbs(resolveParams()), 0); + QCOMPARE(runQbs(QStringList({"--command-echo-mode", "command-line"})), 0); + if (isGcc) { + QVERIFY2(m_qbsStdout.contains("-std=c++11") || m_qbsStdout.contains("-std=c++0x"), + m_qbsStdout.constData()); + } + +#undef VERIFY_COMPILATION +} + void TestBlackbox::overrideProjectProperties() { QDir::setCurrent(testDataDir + "/overrideProjectProperties"); @@ -2672,10 +2804,8 @@ void TestBlackbox::pluginDependency() QVERIFY2(!m_qbsStdout.contains("linking"), m_qbsStdout.constData()); QCOMPARE(runQbs(QStringList{"--command-echo-mode", "command-line"}), 0); output = m_qbsStdout + '\n' + m_qbsStderr; - if (!HostOsInfo::isMacosHost()) { // TODO: Remove in master - QVERIFY2(!output.contains("plugin1"), output.constData()); - QVERIFY2(!output.contains("helper2"), output.constData()); - } + QVERIFY2(!output.contains("plugin1"), output.constData()); + QVERIFY2(!output.contains("helper2"), output.constData()); QVERIFY2(output.contains("plugin2"), output.constData()); // Test change tracking for parameter in Depends item. @@ -3189,6 +3319,11 @@ void TestBlackbox::erroneousFiles_data() << "Error in Rule\\.outputArtifacts\\[0\\]\n\r?" "Property fileTags for artifact 'outputArtifacts-missing-fileTags\\.txt' " "must be a non-empty string list\\."; + QTest::newRow("texttemplate-unknown-placeholder") + << "Placeholder 'what' is not defined in textemplate.dict for 'boom.txt.in'"; + QTest::newRow("tag-mismatch") + << "tag-mismatch.qbs:8:18.*Artifact '.*dummy1' has undeclared file tags " + "\\[\"y\",\"z\"\\]."; } void TestBlackbox::erroneousFiles() @@ -3200,8 +3335,8 @@ void TestBlackbox::erroneousFiles() QVERIFY(runQbs(params) != 0); QString err = QString::fromLocal8Bit(m_qbsStderr); if (!err.contains(QRegExp(errorMessage))) { - qDebug() << "Output: " << err; - qDebug() << "Expected: " << errorMessage; + qDebug().noquote() << "Output: " << err; + qDebug().noquote() << "Expected: " << errorMessage; QFAIL("Unexpected error message."); } } @@ -3220,25 +3355,25 @@ void TestBlackbox::errorInfo() QCOMPARE(runQbs(resolveParams), 0); buildParams.arguments = resolveParams.arguments; QVERIFY(runQbs(buildParams) != 0); - QVERIFY2(m_qbsStderr.contains("error-info.qbs:25"), m_qbsStderr); + QVERIFY2(m_qbsStderr.contains("error-info.qbs:24"), m_qbsStderr); resolveParams.arguments = QStringList() << "project.fail2:true"; QCOMPARE(runQbs(resolveParams), 0); buildParams.arguments = resolveParams.arguments; QVERIFY(runQbs(buildParams) != 0); - QVERIFY2(m_qbsStderr.contains("error-info.qbs:37"), m_qbsStderr); + QVERIFY2(m_qbsStderr.contains("error-info.qbs:36"), m_qbsStderr); resolveParams.arguments = QStringList() << "project.fail3:true"; QCOMPARE(runQbs(resolveParams), 0); buildParams.arguments = resolveParams.arguments; QVERIFY(runQbs(buildParams) != 0); - QVERIFY2(m_qbsStderr.contains("error-info.qbs:52"), m_qbsStderr); + QVERIFY2(m_qbsStderr.contains("error-info.qbs:51"), m_qbsStderr); resolveParams.arguments = QStringList() << "project.fail4:true"; QCOMPARE(runQbs(resolveParams), 0); buildParams.arguments = resolveParams.arguments; QVERIFY(runQbs(buildParams) != 0); - QVERIFY2(m_qbsStderr.contains("error-info.qbs:67"), m_qbsStderr); + QVERIFY2(m_qbsStderr.contains("error-info.qbs:66"), m_qbsStderr); resolveParams.arguments = QStringList() << "project.fail5:true"; QCOMPARE(runQbs(resolveParams), 0); @@ -3257,7 +3392,7 @@ void TestBlackbox::errorInfo() buildParams.arguments = resolveParams.arguments; QVERIFY(runQbs(buildParams) != 0); QVERIFY2(m_qbsStderr.contains("JavaScriptCommand.sourceCode"), m_qbsStderr); - QVERIFY2(m_qbsStderr.contains("error-info.qbs:58"), m_qbsStderr); + QVERIFY2(m_qbsStderr.contains("error-info.qbs:57"), m_qbsStderr); } void TestBlackbox::escapedLinkerFlags() @@ -3409,12 +3544,8 @@ void TestBlackbox::exportsPkgconfig() QCOMPARE(generatedPcFile.readAll().replace("\r", ""), sourcePcFile.readAll().replace("\r", "")); sourcePcFile.close(); generatedPcFile.close(); - sourcePcFile.setFileName("TheSecondLib.pc"); - generatedPcFilePath = relativeProductBuildDir("TheSecondLib") + "/TheSecondLib.pc"; - generatedPcFile.setFileName(generatedPcFilePath); - QVERIFY2(sourcePcFile.open(QIODevice::ReadOnly), qPrintable(sourcePcFile.errorString())); - QVERIFY2(generatedPcFile.open(QIODevice::ReadOnly), qPrintable(generatedPcFile.errorString())); - QCOMPARE(generatedPcFile.readAll(), sourcePcFile.readAll()); + TEXT_FILE_COMPARE(relativeProductBuildDir("TheSecondLib") + "/TheSecondLib.pc", + "TheSecondLib.pc"); WAIT_FOR_NEW_TIMESTAMP(); touch("firstlib.cpp"); QCOMPARE(runQbs(), 0); @@ -3546,6 +3677,17 @@ void TestBlackbox::fileDependencies() QVERIFY(!m_qbsStdout.contains("compiling zort.cpp")); } +void TestBlackbox::fileTagsFilterMerging() +{ + QDir::setCurrent(testDataDir + "/filetagsfilter-merging"); + QCOMPARE(runQbs(QStringList{"-f", "filetagsfilter-merging.qbs"}), 0); + const QString installedApp = defaultInstallRoot + "/myapp/binDir/" + + QFileInfo(relativeExecutableFilePath("myapp")).fileName(); + QVERIFY2(QFile::exists(installedApp), qPrintable(installedApp)); + const QString otherOutput = relativeProductBuildDir("myapp") + "/myapp.txt"; + QVERIFY2(QFile::exists(otherOutput), qPrintable(otherOutput)); +} + void TestBlackbox::installedTransformerOutput() { QDir::setCurrent(testDataDir + "/installed-transformer-output"); @@ -3554,6 +3696,59 @@ void TestBlackbox::installedTransformerOutput() QVERIFY2(QFile::exists(installedFilePath), qPrintable(installedFilePath)); } +void TestBlackbox::installLocations_data() +{ + QTest::addColumn<QString>("binDir"); + QTest::addColumn<QString>("dllDir"); + QTest::addColumn<QString>("libDir"); + QTest::newRow("explicit values") << QString("bindir") << QString("dlldir") << QString("libdir"); + QTest::newRow("default values") << QString() << QString() << QString(); +} + +void TestBlackbox::installLocations() +{ + QDir::setCurrent(testDataDir + "/install-locations"); + QFETCH(QString, binDir); + QFETCH(QString, dllDir); + QFETCH(QString, libDir); + QbsRunParameters params("resolve"); + if (!binDir.isEmpty()) + params.arguments.push_back("products.theapp.installDir:" + binDir); + if (!dllDir.isEmpty()) + params.arguments.push_back("products.thelib.installDir:" + dllDir); + if (!libDir.isEmpty()) + params.arguments.push_back("products.thelib.importLibInstallDir:" + libDir); + QCOMPARE(runQbs(params), 0); + const bool isWindows = m_qbsStdout.contains("is windows"); + const bool isMac = m_qbsStdout.contains("is mac"); + const bool isUnix = m_qbsStdout.contains("is unix"); + QVERIFY(isWindows || isMac || isUnix); + QCOMPARE(runQbs(QbsRunParameters(QStringList("--clean-install-root"))), 0); + const QString dllFileName = isWindows ? "thelib.dll" : isMac ? "thelib" : "libthelib.so"; + const QString appFileName = isWindows ? "theapp.exe" : "theapp"; + if (binDir.isEmpty()) + binDir = isMac ? "/Applications" : "/bin"; + if (dllDir.isEmpty()) + dllDir = isMac ? "/Library/Frameworks" : isWindows ? "/bin" : "/lib"; + if (libDir.isEmpty()) + libDir = "/lib"; + if (isMac) { + binDir += "/theapp.app/Contents/MacOS"; + dllDir += "/thelib.framework"; + } + const QString installRoot = QDir::currentPath() + "/default/install-root"; + const QString installPrefix = isWindows ? QString() : "/usr/local"; + const QString fullInstallPrefix = installRoot + '/' + installPrefix + '/'; + const QString appFilePath = fullInstallPrefix + binDir + '/' + appFileName; + QVERIFY2(QFile::exists(appFilePath), qPrintable(appFilePath)); + const QString dllFilePath = fullInstallPrefix + dllDir + '/' + dllFileName; + QVERIFY2(QFile::exists(dllFilePath), qPrintable(dllFilePath)); + if (isWindows) { + const QString libFilePath = fullInstallPrefix + libDir + "/thelib.lib"; + QVERIFY2(QFile::exists(libFilePath), qPrintable(libFilePath)); + } +} + void TestBlackbox::inputsFromDependencies() { QDir::setCurrent(testDataDir + "/inputs-from-dependencies"); @@ -3637,9 +3832,21 @@ void TestBlackbox::installTree() QVERIFY(QFile::exists(installRoot + "content/subdir2/baz.txt")); } +void TestBlackbox::invalidCommandProperty_data() +{ + QTest::addColumn<QString>("errorType"); + + QTest::newRow("assigning QObject") << QString("qobject"); + QTest::newRow("assigning input artifact") << QString("input"); + QTest::newRow("assigning other artifact") << QString("artifact"); +} + void TestBlackbox::invalidCommandProperty() { QDir::setCurrent(testDataDir + "/invalid-command-property"); + QFETCH(QString, errorType); + QCOMPARE(runQbs(QbsRunParameters("resolve", QStringList("products.p.errorType:" + errorType))), + 0); QbsRunParameters params; params.expectFailure = true; QVERIFY(runQbs(params) != 0); @@ -3684,7 +3891,7 @@ void TestBlackbox::invalidExtensionInstantiation() params.expectFailure = true; params.arguments << (QString("products.theProduct.extension:") + QTest::currentDataTag()); QVERIFY(runQbs(params) != 0); - QVERIFY2(m_qbsStderr.contains("invalid-extension-instantiation.qbs:18") + QVERIFY2(m_qbsStderr.contains("invalid-extension-instantiation.qbs:17") && m_qbsStderr.contains('\'' + QByteArray(QTest::currentDataTag()) + "' cannot be instantiated"), m_qbsStderr.constData()); @@ -3958,7 +4165,7 @@ void TestBlackbox::symbolLinkMode() QbsRunParameters params; params.command = "run"; const QStringList commonArgs{"-p", "driver", "--setup-run-env-config", - "ignore-lib-dependencies"}; + "ignore-lib-dependencies", "qbs.installPrefix:''"}; rmDirR(relativeBuildDir()); params.arguments = QStringList() << commonArgs << "project.shouldInstallLibrary:true"; @@ -3990,7 +4197,7 @@ void TestBlackbox::linkerMode() QSKIP("only applies on Unix"); QDir::setCurrent(testDataDir + "/linkerMode"); - QCOMPARE(runQbs(), 0); + QCOMPARE(runQbs(QbsRunParameters(QStringList("qbs.installPrefix:''"))), 0); auto testCondition = [&](const QString &lang, const std::function<bool(const QByteArray &)> &condition) { @@ -4294,6 +4501,37 @@ void TestBlackbox::newOutputArtifact() QVERIFY(regularFileExists(the100thArtifact)); } +void TestBlackbox::noExportedSymbols_data() +{ + QTest::addColumn<bool>("link"); + QTest::addColumn<bool>("dryRun"); + QTest::newRow("link") << true << false; + QTest::newRow("link (dry run)") << true << true; + QTest::newRow("do not link") << false << false; +} + +void TestBlackbox::noExportedSymbols() +{ + QDir::setCurrent(testDataDir + "/no-exported-symbols"); + QFETCH(bool, link); + QFETCH(bool, dryRun); + QCOMPARE(runQbs(QbsRunParameters("resolve", QStringList{"--force-probe-execution", + QString("products.the_app.link:") + (link ? "true" : "false")})), 0); + const bool isMsvc = m_qbsStdout.contains("compiler is MSVC"); + const bool isNotMsvc = m_qbsStdout.contains("compiler is not MSVC"); + QVERIFY2(isMsvc || isNotMsvc, m_qbsStdout.constData()); + if (isNotMsvc) + QSKIP("Test applies with MSVC only"); + QbsRunParameters buildParams; + if (dryRun) + buildParams.arguments << "--dry-run"; + buildParams.expectFailure = link && !dryRun; + QCOMPARE(runQbs(buildParams) == 0, !buildParams.expectFailure); + QVERIFY2(m_qbsStderr.contains("This typically happens when a DLL does not export " + "any symbols.") == buildParams.expectFailure, + m_qbsStderr.constData()); +} + void TestBlackbox::noProfile() { QDir::setCurrent(testDataDir + "/no-profile"); @@ -4733,6 +4971,40 @@ void TestBlackbox::propertiesInExportItems() QVERIFY2(m_qbsStderr.isEmpty(), m_qbsStderr.constData()); } +void TestBlackbox::protobuf_data() +{ + QTest::addColumn<QString>("projectFile"); + QTest::addColumn<QStringList>("properties"); + QTest::addColumn<bool>("successExpected"); + QTest::newRow("cpp") << QString("addressbook_cpp.qbs") << QStringList() << true; + QTest::newRow("objc") << QString("addressbook_objc.qbs") << QStringList() << true; + QTest::newRow("import") << QString("import.qbs") << QStringList() << true; + QTest::newRow("missing import dir") << QString("needs-import-dir.qbs") + << QStringList() << false; + QTest::newRow("provided import dir") + << QString("needs-import-dir.qbs") + << QStringList("products.app.theImportDir:subdir") << true; +} + +void TestBlackbox::protobuf() +{ + QDir::setCurrent(testDataDir + "/protobuf"); + QFETCH(QString, projectFile); + QFETCH(QStringList, properties); + QFETCH(bool, successExpected); + rmDirR(relativeBuildDir()); + QbsRunParameters resolveParams("resolve", QStringList{"-f", projectFile} << properties); + QCOMPARE(runQbs(resolveParams), 0); + const bool withProtobuf = m_qbsStdout.contains("has protobuf: true"); + const bool withoutProtobuf = m_qbsStdout.contains("has protobuf: false"); + QVERIFY2(withProtobuf || withoutProtobuf, m_qbsStdout.constData()); + if (withoutProtobuf) + QSKIP("protobuf module not present"); + QbsRunParameters runParams("run"); + runParams.expectFailure = !successExpected; + QCOMPARE(runQbs(runParams) == 0, successExpected); +} + void TestBlackbox::pseudoMultiplexing() { // This is "pseudo-multiplexing" on all platforms that initialize qbs.architectures @@ -5175,6 +5447,44 @@ void TestBlackbox::autotestWithDependencies() && m_qbsStdout.contains("i am the helper"), m_qbsStdout.constData()); } +void TestBlackbox::autotests_data() +{ + QTest::addColumn<QString>("evilPropertySpec"); + QTest::addColumn<QByteArray>("expectedErrorMessage"); + QTest::newRow("missing arguments") << QString("products.test1.autotest.arguments:[]") + << QByteArray("This test needs exactly one argument"); + QTest::newRow("missing working dir") << QString("products.test2.autotest.workingDir:''") + << QByteArray("Test resource not found"); + QTest::newRow("missing flaky specifier") + << QString("products.test3.autotest.allowFailure:false") + << QByteArray("I am an awful test"); + QTest::newRow("everything's fine") << QString() << QByteArray(); +} + +void TestBlackbox::autotests() +{ + QDir::setCurrent(testDataDir + "/autotests"); + QFETCH(QString, evilPropertySpec); + QFETCH(QByteArray, expectedErrorMessage); + QbsRunParameters resolveParams("resolve"); + if (!evilPropertySpec.isEmpty()) + resolveParams.arguments << evilPropertySpec; + QCOMPARE(runQbs(resolveParams), 0); + QbsRunParameters testParams(QStringList{"-p", "autotest-runner"}); + if (!evilPropertySpec.isEmpty()) + testParams.expectFailure = true; + QCOMPARE(runQbs(testParams) == 0, !testParams.expectFailure); + if (testParams.expectFailure) { + QVERIFY2(m_qbsStderr.contains(expectedErrorMessage), m_qbsStderr.constData()); + return; + } + QVERIFY2(m_qbsStdout.contains("Running test test1") + && m_qbsStdout.contains("Running test test2") + && m_qbsStdout.contains("Running test test3"), m_qbsStdout.constData()); + QCOMPARE(m_qbsStdout.count("PASS"), 2); + QCOMPARE(m_qbsStderr.count("FAIL"), 1); +} + void TestBlackbox::auxiliaryInputsFromDependencies() { QDir::setCurrent(testDataDir + "/aux-inputs-from-deps"); @@ -5727,6 +6037,47 @@ void TestBlackbox::innoSetupDependencies() QVERIFY(regularFileExists(relativeBuildDir() + "/qbs.setup.test.exe")); } +void TestBlackbox::inputTagsChangeTracking_data() +{ + QTest::addColumn<QString>("generateInput"); + QTest::newRow("source artifact") << QString("no"); + QTest::newRow("generated artifact (static)") << QString("static"); + QTest::newRow("generated artifact (dynamic)") << QString("dynamic"); +} + +void TestBlackbox::inputTagsChangeTracking() +{ + QDir::setCurrent(testDataDir + "/input-tags-change-tracking"); + const QString xOut = QDir::currentPath() + '/' + relativeProductBuildDir("p") + "/x.out"; + const QString yOut = QDir::currentPath() + '/' + relativeProductBuildDir("p") + "/y.out"; + QFETCH(QString, generateInput); + const QbsRunParameters resolveParams("resolve", + QStringList("products.p.generateInput:" + generateInput)); + QCOMPARE(runQbs(resolveParams), 0); + QCOMPARE(runQbs(), 0); + QVERIFY(m_qbsStdout.contains("generating input.txt") == (generateInput == "static")); + QVERIFY2(!QFile::exists(xOut), qPrintable(xOut)); + QVERIFY2(!QFile::exists(yOut), qPrintable(yOut)); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("input-tags-change-tracking.qbs", "Tags: [\"txt\", \"empty\"]", + "Tags: \"txt\""); + QCOMPARE(runQbs(), 0); + QVERIFY2(QFile::exists(xOut), qPrintable(xOut)); + QVERIFY2(!QFile::exists(yOut), qPrintable(yOut)); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("input-tags-change-tracking.qbs", "Tags: \"txt\"", + "Tags: [\"txt\", \"y\"]"); + QCOMPARE(runQbs(), 0); + QVERIFY2(!QFile::exists(xOut), qPrintable(xOut)); + QVERIFY2(QFile::exists(yOut), qPrintable(yOut)); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("input-tags-change-tracking.qbs", "Tags: [\"txt\", \"y\"]", + "Tags: [\"txt\", \"empty\"]"); + QCOMPARE(runQbs(), 0); + QVERIFY2(!QFile::exists(xOut), qPrintable(xOut)); + QVERIFY2(!QFile::exists(yOut), qPrintable(yOut)); +} + void TestBlackbox::outputArtifactAutoTagging() { QDir::setCurrent(testDataDir + QLatin1String("/output-artifact-auto-tagging")); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 58cc8f6fb..874690ad2 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -48,6 +48,8 @@ private slots: void artifactScanning(); void assembly(); void autotestWithDependencies(); + void autotests_data(); + void autotests(); void auxiliaryInputsFromDependencies(); void badInterpreter(); void bomSources(); @@ -57,6 +59,7 @@ private slots: void buildGraphVersions(); void changedFiles_data(); void changedFiles(); + void changedInputsFromDependencies(); void changedRuleInputs(); void changeInDisabledProduct(); void changeInImportedFile(); @@ -111,6 +114,7 @@ private slots: void exportsQbs(); void externalLibs(); void fileDependencies(); + void fileTagsFilterMerging(); void generatedArtifactAsInputToDynamicRule(); void generator(); void generator_data(); @@ -125,6 +129,8 @@ private slots: void includeLookup(); void innoSetup(); void innoSetupDependencies(); + void inputTagsChangeTracking_data(); + void inputTagsChangeTracking(); void inputsFromDependencies(); void installable(); void installableAsAuxiliaryInput(); @@ -133,9 +139,12 @@ private slots: void installDuplicatesNoError(); void installedSourceFiles(); void installedTransformerOutput(); + void installLocations_data(); + void installLocations(); void installPackage(); void installRootFromProjectFile(); void installTree(); + void invalidCommandProperty_data(); void invalidCommandProperty(); void invalidExtensionInstantiation(); void invalidExtensionInstantiation_data(); @@ -178,6 +187,8 @@ private slots: void nestedGroups(); void nestedProperties(); void newOutputArtifact(); + void noExportedSymbols_data(); + void noExportedSymbols(); void noProfile(); void noSuchProfile(); void nodejs(); @@ -211,6 +222,8 @@ private slots: void propertyPrecedence(); void properQuoting(); void propertiesInExportItems(); + void protobuf_data(); + void protobuf(); void pseudoMultiplexing(); void qbsConfig(); void qbsVersion(); @@ -226,7 +239,9 @@ private slots: void requireDeprecated(); void rescueTransformerData(); void responseFiles(); + void retaggedOutputArtifact(); void ruleConditions(); + void ruleConnectionWithExcludedInputs(); void ruleCycle(); void ruleWithNoInputs(); void ruleWithNonRequiredInputs(); @@ -236,6 +251,7 @@ private slots: void smartRelinking_data(); void soVersion(); void soVersion_data(); + void sourceArtifactChanges(); void subProfileChangeTracking(); void successiveChanges(); void symbolLinkMode(); @@ -251,6 +267,7 @@ private slots: void systemRunPaths(); void systemRunPaths_data(); void tar(); + void textTemplate(); void toolLookup(); void topLevelSearchPath(); void trackAddFile(); diff --git a/tests/auto/blackbox/tst_blackboxandroid.cpp b/tests/auto/blackbox/tst_blackboxandroid.cpp index a551a77c4..bf47c241c 100644 --- a/tests/auto/blackbox/tst_blackboxandroid.cpp +++ b/tests/auto/blackbox/tst_blackboxandroid.cpp @@ -69,14 +69,22 @@ TestBlackboxAndroid::TestBlackboxAndroid() { } +static QString theProfileName(bool forQt) +{ + return forQt ? "qbs_autotests-android-qt" : profileName(); +} + void TestBlackboxAndroid::android() { QFETCH(QString, projectDir); QFETCH(QStringList, productNames); QFETCH(QList<QByteArrayList>, expectedFilesLists); + QFETCH(QStringList, customProperties); const SettingsPtr s = settings(); - Profile p(profileName(), s.get()); + Profile p(theProfileName(projectDir == "qml-app"), s.get()); + if (!p.exists()) + p = Profile("none", s.get()); int status; const auto androidPaths = findAndroid(&status, p.name()); QCOMPARE(status, 0); @@ -100,12 +108,21 @@ void TestBlackboxAndroid::android() static const QStringList configNames { "debug", "release" }; for (const QString &configName : configNames) { auto currentExpectedFilesLists = expectedFilesLists; - QbsRunParameters params(QStringList { "--command-echo-mode", "command-line", - "modules.Android.ndk.platform:android-21", - "config:" + configName }); - params.profile = p.name(); - QCOMPARE(runQbs(params), 0); + const QString configArgument = "config:" + configName; + QbsRunParameters resolveParams("resolve"); + resolveParams.arguments << "modules.Android.ndk.platform:android-21" << configArgument + << customProperties; + resolveParams.profile = p.name(); + QCOMPARE(runQbs(resolveParams), 0); + QbsRunParameters buildParams(QStringList{"--command-echo-mode", "command-line", + configArgument}); + buildParams.profile = p.name(); + QCOMPARE(runQbs(buildParams), 0); for (const QString &productName : qAsConst(productNames)) { + const QByteArray tag(QTest::currentDataTag()); + const bool isIncrementalBuild = tag.startsWith("qml app") && tag != "qml app"; + QCOMPARE(m_qbsStdout.count("Generating BuildConfig.java"), + isIncrementalBuild ? 0 : productNames.size()); QVERIFY(m_qbsStdout.contains(productName.toLocal8Bit() + ".apk")); const QString apkFilePath = relativeProductBuildDir(productName, configName) + '/' + productName + ".apk"; @@ -123,7 +140,7 @@ void TestBlackboxAndroid::android() QByteArrayList missingExpectedFiles; QByteArrayList expectedFiles = currentExpectedFilesLists.takeFirst(); for (const QByteArray &expectedFile : expectedFiles) { - if (expectedFile.endsWith("/gdbserver") && configName == "release") + if (expectedFile.endsWith("/libgdbserver.so") && configName == "release") continue; auto it = std::find(actualFiles.begin(), actualFiles.end(), expectedFile); if (it != actualFiles.end()) { @@ -139,10 +156,15 @@ void TestBlackboxAndroid::android() auto isFileSharedObject = [](const QByteArray &f) { return f.endsWith(".so"); }; - if (none_of(actualFiles, isFileSharedObject)) + const auto isQmlToolingLib = [](const QByteArray &f) { + return f.contains("qmltooling"); + }; + if (none_of(actualFiles, isFileSharedObject) + || std::all_of(actualFiles.cbegin(), actualFiles.cend(), isQmlToolingLib)) { QWARN(msg); - else + } else { QFAIL(msg); + } } } @@ -169,6 +191,7 @@ void TestBlackboxAndroid::android_data() { const SettingsPtr s = settings(); const Profile p(profileName(), s.get()); + const Profile pQt(theProfileName(true), s.get()); QStringList archsStringList = p.value(QLatin1String("qbs.architectures")).toStringList(); if (archsStringList.empty()) archsStringList << QStringLiteral("armv7a"); // must match default in common.qbs @@ -179,10 +202,19 @@ void TestBlackboxAndroid::android_data() .replace("armv5te", "armeabi") .replace("arm64", "arm64-v8a"); }); - const bool usesClang = p.value(QLatin1String("qbs.toolchainType")).toString() == "clang"; - const auto cxxLibPath = [usesClang](const QByteArray &oldcxxLib) { + const auto cxxLibPath = [&p, &pQt](const QByteArray &oldcxxLib, bool forQt) { + const bool usesClang = (forQt ? pQt : p).value(QLatin1String("qbs.toolchainType")) + .toString() == "clang"; return QByteArray("lib/${ARCH}/") + (usesClang ? "libc++_shared.so" : oldcxxLib); }; + const QByteArrayList archsForQt = { pQt.value("qbs.architecture").toString().toUtf8() }; + QByteArrayList ndkArchsForQt = archsForQt; + if (ndkArchsForQt.first() == "armv7a") + ndkArchsForQt.first() = "armeabi-v7a"; + else if (ndkArchsForQt.first() == "armv5te") + ndkArchsForQt.first() = "armeabi"; + else if (ndkArchsForQt.first() == "arm64") + ndkArchsForQt.first() = "arm64-v8a"; auto expandArchs = [] (const QByteArrayList &archs, const QByteArrayList &lst) { const QByteArray &archPlaceHolder = "${ARCH}"; @@ -200,25 +232,136 @@ void TestBlackboxAndroid::android_data() const QByteArrayList commonFiles = expandArchs(archs, { "AndroidManifest.xml", "META-INF/ANDROIDD.RSA", "META-INF/ANDROIDD.SF", - "META-INF/MANIFEST.MF", "classes.dex", "resources.arsc" + "META-INF/MANIFEST.MF", "classes.dex" }); QTest::addColumn<QString>("projectDir"); QTest::addColumn<QStringList>("productNames"); QTest::addColumn<QList<QByteArrayList>>("expectedFilesLists"); + QTest::addColumn<QStringList>("customProperties"); QTest::newRow("teapot") - << "teapot" << QStringList("com.sample.teapot") + << "teapot" << QStringList("TeapotNativeActivity") << (QList<QByteArrayList>() << commonFiles + expandArchs(archs, { + "resources.arsc", "assets/Shaders/ShaderPlain.fsh", "assets/Shaders/VS_ShaderPlain.vsh", - "lib/${ARCH}/gdbserver", - cxxLibPath("libgnustl_shared.so"), + "lib/${ARCH}/libgdbserver.so", + cxxLibPath("libgnustl_shared.so", false), "lib/${ARCH}/libTeapotNativeActivity.so", - "res/layout/widgets.xml"})); + "res/layout/widgets.xml"})) + << QStringList(); + QTest::newRow("minimal-native") + << "minimal-native" << QStringList("minimalnative") + << (QList<QByteArrayList>() << commonFiles + expandArchs({archs.first()}, { + "lib/${ARCH}/libminimalnative.so", + cxxLibPath("libstlport_shared.so", false), + "lib/${ARCH}/libdependency.so"})) + << QStringList{"products.minimalnative.multiplexByQbsProperties:[]", + "modules.qbs.architecture:" + archsStringList.first()}; + QTest::newRow("qml app") + << "qml-app" << QStringList("qmlapp") + << (QList<QByteArrayList>() << commonFiles + expandArchs(ndkArchsForQt, { + "resources.arsc", + "assets/--Added-by-androiddeployqt--/qml/QtQuick.2/plugins.qmltypes", + "assets/--Added-by-androiddeployqt--/qml/QtQuick.2/qmldir", + "assets/--Added-by-androiddeployqt--/qml/QtQuick/Window.2/plugins.qmltypes", + "assets/--Added-by-androiddeployqt--/qml/QtQuick/Window.2/qmldir", + "assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list", + "lib/${ARCH}/libgdbserver.so", + cxxLibPath("libgnustl_shared.so", true), + "lib/${ARCH}/libplugins_bearer_libqandroidbearer.so", + "lib/${ARCH}/libplugins_imageformats_libqgif.so", + "lib/${ARCH}/libplugins_imageformats_libqicns.so", + "lib/${ARCH}/libplugins_imageformats_libqico.so", + "lib/${ARCH}/libplugins_imageformats_libqjpeg.so", + "lib/${ARCH}/libplugins_imageformats_libqtga.so", + "lib/${ARCH}/libplugins_imageformats_libqtiff.so", + "lib/${ARCH}/libplugins_imageformats_libqwbmp.so", + "lib/${ARCH}/libplugins_imageformats_libqwebp.so", + "lib/${ARCH}/libplugins_platforms_android_libqtforandroid.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_debugger.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_inspector.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_local.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_messages.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_native.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_nativedebugger.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_profiler.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_preview.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_quickprofiler.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_server.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_tcp.so", + "lib/${ARCH}/libqml_QtQuick.2_libqtquick2plugin.so", + "lib/${ARCH}/libqml_QtQuick_Window.2_libwindowplugin.so", + "lib/${ARCH}/libQt5Core.so", + "lib/${ARCH}/libQt5Gui.so", + "lib/${ARCH}/libQt5Network.so", + "lib/${ARCH}/libQt5Qml.so", + "lib/${ARCH}/libQt5QuickParticles.so", + "lib/${ARCH}/libQt5Quick.so", + "lib/${ARCH}/libqmlapp.so", + "res/layout/splash.xml"})) + << QStringList{"modules.Android.sdk.automaticSources:false", + "modules.qbs.architecture:" + archsForQt.first()}; + QTest::newRow("qml app using Ministro") + << "qml-app" << QStringList("qmlapp") + << (QList<QByteArrayList>() << commonFiles + expandArchs(ndkArchsForQt, { + "resources.arsc", + "assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list", + "lib/${ARCH}/libgdbserver.so", + cxxLibPath("libgnustl_shared.so", true), + "lib/${ARCH}/libqmlapp.so", + "res/layout/splash.xml"})) + << QStringList{"modules.Qt.android_support.useMinistro:true", + "modules.Android.sdk.automaticSources:false"}; + QTest::newRow("qml app with custom metadata") + << "qml-app" << QStringList("qmlapp") + << (QList<QByteArrayList>() << commonFiles + expandArchs(ndkArchsForQt, { + "resources.arsc", + "assets/--Added-by-androiddeployqt--/qml/QtQuick.2/plugins.qmltypes", + "assets/--Added-by-androiddeployqt--/qml/QtQuick.2/qmldir", + "assets/--Added-by-androiddeployqt--/qml/QtQuick/Window.2/plugins.qmltypes", + "assets/--Added-by-androiddeployqt--/qml/QtQuick/Window.2/qmldir", + "assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list", + "assets/dummyasset.txt", + "lib/${ARCH}/libgdbserver.so", + cxxLibPath("libgnustl_shared.so", true), + "lib/${ARCH}/libplugins_bearer_libqandroidbearer.so", + "lib/${ARCH}/libplugins_imageformats_libqgif.so", + "lib/${ARCH}/libplugins_imageformats_libqicns.so", + "lib/${ARCH}/libplugins_imageformats_libqico.so", + "lib/${ARCH}/libplugins_imageformats_libqjpeg.so", + "lib/${ARCH}/libplugins_imageformats_libqtga.so", + "lib/${ARCH}/libplugins_imageformats_libqtiff.so", + "lib/${ARCH}/libplugins_imageformats_libqwbmp.so", + "lib/${ARCH}/libplugins_imageformats_libqwebp.so", + "lib/${ARCH}/libplugins_platforms_android_libqtforandroid.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_debugger.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_inspector.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_local.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_messages.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_native.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_nativedebugger.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_profiler.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_preview.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_quickprofiler.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_server.so", + "lib/${ARCH}/libplugins_qmltooling_libqmldbg_tcp.so", + "lib/${ARCH}/libqml_QtQuick.2_libqtquick2plugin.so", + "lib/${ARCH}/libqml_QtQuick_Window.2_libwindowplugin.so", + "lib/${ARCH}/libQt5Core.so", + "lib/${ARCH}/libQt5Gui.so", + "lib/${ARCH}/libQt5Network.so", + "lib/${ARCH}/libQt5Qml.so", + "lib/${ARCH}/libQt5QuickParticles.so", + "lib/${ARCH}/libQt5Quick.so", + "lib/${ARCH}/libqmlapp.so", + "res/layout/splash.xml"})) + << QStringList("modules.Android.sdk.automaticSources:true"); QTest::newRow("no native") << "no-native" << QStringList("com.example.android.basicmediadecoder") << (QList<QByteArrayList>() << commonFiles + expandArchs(archs, { + "resources.arsc", "res/drawable-hdpi-v4/ic_action_play_disabled.png", "res/drawable-hdpi-v4/ic_action_play.png", "res/drawable-hdpi-v4/ic_launcher.png", @@ -234,34 +377,41 @@ void TestBlackboxAndroid::android_data() "res/layout/sample_main.xml", "res/menu/action_menu.xml", "res/menu-v11/action_menu.xml", - "res/raw/vid_bigbuckbunny.mp4"})); + "res/raw/vid_bigbuckbunny.mp4"})) + << QStringList(); + QTest::newRow("aidl") << "aidl" << QStringList("io.qbs.aidltest") + << QList<QByteArrayList>{commonFiles} << QStringList(); QTest::newRow("multiple libs") << "multiple-libs-per-apk" << QStringList("twolibs") << (QList<QByteArrayList>() << commonFiles + expandArchs(archs, { - "lib/${ARCH}/gdbserver", + "resources.arsc", + "lib/${ARCH}/libgdbserver.so", "lib/${ARCH}/liblib1.so", "lib/${ARCH}/liblib2.so", - cxxLibPath("libstlport_shared.so")})); + cxxLibPath("libstlport_shared.so", false)})) + << QStringList(); QByteArrayList expectedFiles1 = (commonFiles + expandArchs(QByteArrayList{"armeabi-v7a", "x86"}, { - "lib/${ARCH}/gdbserver", + "resources.arsc", + "lib/${ARCH}/libgdbserver.so", "lib/${ARCH}/libp1lib1.so", - cxxLibPath("libstlport_shared.so")}) + cxxLibPath("libstlport_shared.so", false)}) + expandArchs(QByteArrayList{archs}, { - "lib/${ARCH}/gdbserver", + "resources.arsc", + "lib/${ARCH}/libgdbserver.so", "lib/${ARCH}/libp1lib2.so", - cxxLibPath("libstlport_shared.so")})).toSet().toList(); + cxxLibPath("libstlport_shared.so", false)})).toSet().toList(); QByteArrayList expectedFiles2 = commonFiles + expandArchs(archs, { - "lib/${ARCH}/gdbserver", + "lib/${ARCH}/libgdbserver.so", "lib/${ARCH}/libp2lib1.so", "lib/${ARCH}/libp2lib2.so", - cxxLibPath("libstlport_shared.so")}); - expectedFiles2.removeOne("resources.arsc"); + cxxLibPath("libstlport_shared.so", false)}); QTest::newRow("multiple apks") << "multiple-apks-per-project" << (QStringList() << "twolibs1" << "twolibs2") - << QList<QByteArrayList>{expectedFiles1, expectedFiles2}; + << QList<QByteArrayList>{expectedFiles1, expectedFiles2} + << QStringList(); } QTEST_MAIN(TestBlackboxAndroid) diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp index b3ba13f04..0cb4d5abb 100644 --- a/tests/auto/blackbox/tst_blackboxapple.cpp +++ b/tests/auto/blackbox/tst_blackboxapple.cpp @@ -80,9 +80,9 @@ void TestBlackboxApple::appleMultiConfig() const bool supportsX86 = xcodeVersion < qbs::Version(10); QDir::setCurrent(testDataDir + "/apple-multiconfig"); - - QCOMPARE(runQbs(QbsRunParameters(QStringList(QString("project.enableX86:") - + (supportsX86 ? "true" : "false")))), 0); + QCOMPARE(runQbs(QbsRunParameters(QStringList{ + "qbs.installPrefix:''", + QString("project.enableX86:") + (supportsX86 ? "true" : "false")})), 0); QVERIFY(QFileInfo2(defaultInstallRoot + "/singleapp.app/Contents/MacOS/singleapp").isExecutable()); QVERIFY(QFileInfo2(defaultInstallRoot + "/singleapp.app/Contents/Info.plist").isRegularFile()); @@ -303,7 +303,7 @@ void TestBlackboxApple::bundleStructure() QFETCH(bool, isShallow); QDir::setCurrent(testDataDir + "/bundle-structure"); - QbsRunParameters params; + QbsRunParameters params(QStringList{"qbs.installPrefix:''"}); params.arguments << "project.buildableProducts:" + productName; if (isShallow) { // Coerce shallow bundles - don't set bundle.isShallow directly because we want to test the @@ -644,7 +644,7 @@ void TestBlackboxApple::embedInfoPlist() { QDir::setCurrent(testDataDir + QLatin1String("/embedInfoPlist")); - QbsRunParameters params; + QbsRunParameters params(QStringList{"qbs.installPrefix:''"}); QCOMPARE(runQbs(params), 0); QVERIFY(!getEmbeddedBinaryPlist(defaultInstallRoot + "/app").isEmpty()); diff --git a/tests/auto/blackbox/tst_blackboxbase.cpp b/tests/auto/blackbox/tst_blackboxbase.cpp index b07f14553..e1844b69c 100644 --- a/tests/auto/blackbox/tst_blackboxbase.cpp +++ b/tests/auto/blackbox/tst_blackboxbase.cpp @@ -46,9 +46,9 @@ using qbs::Profile; static QString initQbsExecutableFilePath() { - const QString qbsInstallRoot = QString::fromLocal8Bit(qgetenv("QBS_INSTALL_ROOT")); - return HostOsInfo::appendExecutableSuffix(QDir::cleanPath(!qbsInstallRoot.isEmpty() - ? qbsInstallRoot + QLatin1String("/bin/qbs") + const QString qbsInstallDir = QString::fromLocal8Bit(qgetenv("QBS_INSTALL_DIR")); + return HostOsInfo::appendExecutableSuffix(QDir::cleanPath(!qbsInstallDir.isEmpty() + ? qbsInstallDir + QLatin1String("/bin/qbs") : QCoreApplication::applicationDirPath() + QLatin1String("/qbs"))); } diff --git a/tests/auto/blackbox/tst_blackboxjava.cpp b/tests/auto/blackbox/tst_blackboxjava.cpp index 59553f8dc..0ea3c41ce 100644 --- a/tests/auto/blackbox/tst_blackboxjava.cpp +++ b/tests/auto/blackbox/tst_blackboxjava.cpp @@ -79,8 +79,7 @@ void TestBlackboxJava::java() QStringList() << "Jet" << "Ship" << "Vehicles"; QStringList classFiles1 = QStringList(classFiles) << "io/qt/qbs/HelloWorld" << "NoPackage"; for (QString &classFile : classFiles1) { - classFile = relativeProductBuildDir("class_collection") + "/classes/" - + classFile + ".class"; + classFile = relativeProductBuildDir("cc") + "/classes/" + classFile + ".class"; QVERIFY2(regularFileExists(classFile), qPrintable(classFile)); } diff --git a/tests/auto/blackbox/tst_blackboxjoblimits.cpp b/tests/auto/blackbox/tst_blackboxjoblimits.cpp new file mode 100644 index 000000000..0c366759d --- /dev/null +++ b/tests/auto/blackbox/tst_blackboxjoblimits.cpp @@ -0,0 +1,173 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "tst_blackboxbase.h" + +#include "../shared.h" +#include <tools/profile.h> + +class TestBlackboxJobLimits : public TestBlackboxBase +{ + Q_OBJECT + +public: + TestBlackboxJobLimits(); + +private slots: + void jobLimits_data(); + void jobLimits(); +}; + +TestBlackboxJobLimits::TestBlackboxJobLimits() + : TestBlackboxBase (SRCDIR "/testdata-joblimits", "blackbox-joblimits") +{ +} + +void TestBlackboxJobLimits::jobLimits_data() +{ + QTest::addColumn<int>("projectJobCount"); + QTest::addColumn<int>("productJobCount"); + QTest::addColumn<int>("moduleJobCount"); + QTest::addColumn<int>("prefsJobCount"); + QTest::addColumn<int>("cliJobCount"); + QTest::addColumn<bool>("projectPrecedence"); + QTest::addColumn<bool>("expectSuccess"); + for (int projectJobCount = -1; projectJobCount <= 1; ++projectJobCount) { + for (int productJobCount = -1; productJobCount <= 1; ++productJobCount) { + for (int moduleJobCount = -1; moduleJobCount <= 1; ++moduleJobCount) { + for (int prefsJobCount = -1; prefsJobCount <= 1; ++prefsJobCount) { + for (int cliJobCount = -1; cliJobCount <= 1; ++cliJobCount) { + QString description = QString("project:%1/" + "product:%2/module:%3/prefs:%4/cli:%5/project precedence") + .arg(projectJobCount).arg(productJobCount).arg(moduleJobCount) + .arg(prefsJobCount).arg(cliJobCount).toLocal8Bit(); + bool expectSuccess; + switch (productJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (projectJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (moduleJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (cliJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: expectSuccess = prefsJobCount == 1; break; + } + break; + } + break; + } + break; + } + QTest::newRow(qPrintable(description)) + << projectJobCount << productJobCount << moduleJobCount + << prefsJobCount << cliJobCount << true << expectSuccess; + description = QString("project:%1/" + "product:%2/module:%3/prefs:%4/cli:%5/default precedence") + .arg(projectJobCount).arg(productJobCount).arg(moduleJobCount) + .arg(prefsJobCount).arg(cliJobCount).toLocal8Bit(); + switch (cliJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (prefsJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (productJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: + switch (projectJobCount) { + case 1: expectSuccess = true; break; + case 0: expectSuccess = false; break; + case -1: expectSuccess = moduleJobCount == 1; break; + } + break; + } + break; + } + break; + } + QTest::newRow(qPrintable(description)) + << projectJobCount << productJobCount << moduleJobCount + << prefsJobCount << cliJobCount << false << expectSuccess; + } + } + } + } + } +} + +void TestBlackboxJobLimits::jobLimits() +{ + QDir::setCurrent(testDataDir + "/job-limits"); + QFETCH(int, projectJobCount); + QFETCH(int, productJobCount); + QFETCH(int, moduleJobCount); + QFETCH(int, prefsJobCount); + QFETCH(int, cliJobCount); + QFETCH(bool, projectPrecedence); + QFETCH(bool, expectSuccess); + SettingsPtr theSettings = settings(); + qbs::Internal::TemporaryProfile profile("jobLimitsProfile", theSettings.get()); + profile.p.setValue("preferences.jobLimit.singleton", prefsJobCount); + theSettings->sync(); + QbsRunParameters resolveParams("resolve"); + resolveParams.profile = profile.p.name(); + resolveParams.arguments << ("project.projectJobCount:" + QString::number(projectJobCount)) + << ("project.productJobCount:" + QString::number(productJobCount)) + << ("project.moduleJobCount:" + QString::number(moduleJobCount)); + QCOMPARE(runQbs(resolveParams), 0); + QbsRunParameters buildParams; + buildParams.expectFailure = !expectSuccess; + if (cliJobCount != -1) + buildParams.arguments << "--job-limits" << ("singleton:" + QString::number(cliJobCount)); + if (projectPrecedence) + buildParams.arguments << "--enforce-project-job-limits"; + buildParams.profile = profile.p.name(); + const int exitCode = runQbs(buildParams); + if (expectSuccess) + QCOMPARE(exitCode, 0); + else if (exitCode == 0) + QSKIP("no failure with no limit in place, result inconclusive"); + else + QVERIFY2(m_qbsStderr.contains("exclusive"), m_qbsStderr.constData()); + if (exitCode == 0) + QCOMPARE(m_qbsStdout.count("Running tool"), 7); +} + +QTEST_MAIN(TestBlackboxJobLimits) + +#include <tst_blackboxjoblimits.moc> diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp index 3ab2c601c..3441255e2 100644 --- a/tests/auto/blackbox/tst_blackboxqt.cpp +++ b/tests/auto/blackbox/tst_blackboxqt.cpp @@ -64,6 +64,17 @@ void TestBlackboxQt::validateTestProfile() "in the global search paths.")); } +void TestBlackboxQt::addQObjectMacroToGeneratedCppFile() +{ + QDir::setCurrent(testDataDir + "/add-qobject-macro-to-generated-cpp-file"); + QCOMPARE(runQbs(), 0); + QVERIFY2(!m_qbsStdout.contains("moc"), m_qbsStdout.constData()); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("object.cpp.in", "// ", ""); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("moc"), m_qbsStdout.constData()); +} + void TestBlackboxQt::autoQrc() { QDir::setCurrent(testDataDir + "/auto-qrc"); @@ -134,6 +145,21 @@ void TestBlackboxQt::dbusInterfaces() QCOMPARE(runQbs(), 0); } +void TestBlackboxQt::includedMocCpp() +{ + QDir::setCurrent(testDataDir + "/included-moc-cpp"); + QCOMPARE(runQbs(), 0); + QVERIFY2(!m_qbsStdout.contains("compiling moc_myobject.cpp"), m_qbsStdout.constData()); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("myobject.cpp", "#include <moc_myobject.cpp", "// #include <moc_myobject.cpp"); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("compiling moc_myobject.cpp"), m_qbsStdout.constData()); + WAIT_FOR_NEW_TIMESTAMP(); + REPLACE_IN_FILE("myobject.cpp", "// #include <moc_myobject.cpp", "#include <moc_myobject.cpp"); + QCOMPARE(runQbs(), 0); + QVERIFY2(!m_qbsStdout.contains("compiling moc_myobject.cpp"), m_qbsStdout.constData()); +} + void TestBlackboxQt::lrelease() { QDir::setCurrent(testDataDir + QLatin1String("/lrelease")); @@ -230,6 +256,56 @@ void TestBlackboxQt::pluginMetaData() QVERIFY2(m_qbsStdout.contains("moc"), m_qbsStdout.constData()); } +void TestBlackboxQt::pluginSupport_data() +{ + QTest::addColumn<bool>("invalidPlugin"); + QTest::newRow("request valid plugins") << false; + QTest::newRow("request invalid plugin") << true; +} + +void TestBlackboxQt::pluginSupport() +{ + QDir::setCurrent(testDataDir + "/plugin-support"); + QFETCH(bool, invalidPlugin); + QbsRunParameters resolveParams("resolve"); + if (invalidPlugin) { + resolveParams.arguments << "modules.m1.useDummy:true"; + resolveParams.expectFailure = true; + } + QCOMPARE(runQbs(resolveParams) == 0, !invalidPlugin); + if (invalidPlugin) { + QVERIFY2(m_qbsStderr.contains("Plugin 'dummy' of type 'imageformats' was requested, " + "but is not available"), m_qbsStderr.constData()); + return; + } + const bool isStaticQt = m_qbsStdout.contains("static Qt: true"); + const bool isDynamicQt = m_qbsStdout.contains("static Qt: false"); + QVERIFY(isStaticQt != isDynamicQt); + if (isStaticQt) + QVERIFY2(m_qbsStdout.contains("platform plugin count: 1"), m_qbsStdout.constData()); + else + QVERIFY2(m_qbsStdout.contains("platform plugin count: 0"), m_qbsStdout.constData()); + const auto extractList = [this](const char sep) { + const int listStartIndex = m_qbsStdout.indexOf(sep); + const int listEndIndex = m_qbsStdout.indexOf(sep, listStartIndex + 1); + const QByteArray listString = m_qbsStdout.mid(listStartIndex + 1, + listEndIndex - listStartIndex - 1); + return listString.isEmpty() ? QByteArrayList() : listString.split(','); + }; + const QByteArrayList enabledPlugins = extractList('%'); + if (isStaticQt) + QCOMPARE(enabledPlugins.size(), 2); + else + QVERIFY(enabledPlugins.empty()); + const QByteArrayList allPlugins = extractList('#'); + QVERIFY(allPlugins.size() >= enabledPlugins.size()); + QCOMPARE(runQbs(), 0); + for (const QByteArray &plugin : allPlugins) { + QCOMPARE(m_qbsStdout.contains("qt_plugin_import_" + plugin + ".cpp"), + enabledPlugins.contains(plugin)); + } +} + void TestBlackboxQt::qmlDebugging() { QDir::setCurrent(testDataDir + "/qml-debugging"); @@ -371,6 +447,7 @@ void TestBlackboxQt::track_qrc() QVERIFY2(!m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); const QString fileName = relativeExecutableFilePath("i"); QVERIFY2(regularFileExists(fileName), qPrintable(fileName)); + QDateTime dt = QFileInfo(fileName).lastModified(); WAIT_FOR_NEW_TIMESTAMP(); { @@ -383,16 +460,42 @@ void TestBlackboxQt::track_qrc() REPLACE_IN_FILE("i.qbs", "//\"test.cpp\"", "\"test.cpp\""); waitForFileUnlock(); QCOMPARE(runQbs(QbsRunParameters("run")), 0); - QVERIFY2(m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); + QVERIFY2(m_qbsStdout.contains("rcc bla.qrc"), m_qbsStdout.constData()); QVERIFY2(m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); QVERIFY(regularFileExists(fileName)); QVERIFY(dt < QFileInfo(fileName).lastModified()); + WAIT_FOR_NEW_TIMESTAMP(); touch("i.qbs"); QCOMPARE(runQbs(), 0); QVERIFY2(m_qbsStdout.contains("Resolving"), m_qbsStdout.constData()); QVERIFY2(!m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); QVERIFY2(!m_qbsStdout.contains("compiling test.cpp"), m_qbsStdout.constData()); + + // Turn on big resources. + WAIT_FOR_NEW_TIMESTAMP(); + QCOMPARE(runQbs(QbsRunParameters("resolve", {"modules.Qt.core.enableBigResources:true"})), 0); + QCOMPARE(runQbs(QbsRunParameters("run")), 0); + QVERIFY2(m_qbsStdout.contains("rcc (pass 1) bla.qrc"), m_qbsStdout.constData()); + QVERIFY2(m_qbsStdout.contains("rcc (pass 2) bla.qrc"), m_qbsStdout.constData()); + + // Check null build. + WAIT_FOR_NEW_TIMESTAMP(); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("Building"), m_qbsStdout.constData()); + QVERIFY2(!m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); + + // Turn off big resources. + WAIT_FOR_NEW_TIMESTAMP(); + QCOMPARE(runQbs(QbsRunParameters("resolve", {"modules.Qt.core.enableBigResources:false"})), 0); + QCOMPARE(runQbs(QbsRunParameters("run")), 0); + QVERIFY2(m_qbsStdout.contains("rcc bla.qrc"), m_qbsStdout.constData()); + + // Check null build. + WAIT_FOR_NEW_TIMESTAMP(); + QCOMPARE(runQbs(), 0); + QVERIFY2(m_qbsStdout.contains("Building"), m_qbsStdout.constData()); + QVERIFY2(!m_qbsStdout.contains("rcc"), m_qbsStdout.constData()); } void TestBlackboxQt::unmocable() diff --git a/tests/auto/blackbox/tst_blackboxqt.h b/tests/auto/blackbox/tst_blackboxqt.h index 0f7535224..f42c225d8 100644 --- a/tests/auto/blackbox/tst_blackboxqt.h +++ b/tests/auto/blackbox/tst_blackboxqt.h @@ -42,12 +42,14 @@ protected: void validateTestProfile() override; private slots: + void addQObjectMacroToGeneratedCppFile(); void autoQrc(); void cachedQml(); void combinedMoc(); void createProject(); void dbusAdaptors(); void dbusInterfaces(); + void includedMocCpp(); void lrelease(); void mixedBuildVariants(); void mocAndCppCombining(); @@ -55,6 +57,8 @@ private slots: void mocSameFileName(); void pkgconfig(); void pluginMetaData(); + void pluginSupport_data(); + void pluginSupport(); void qmlDebugging(); void qobjectInObjectiveCpp(); void qtKeywords(); |