summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-08-26 13:47:20 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-08-26 13:47:20 +0200
commit7dd870f21601301aca67548e96866204cec3e852 (patch)
tree36ae72dfc06c7b1d97ab4f0b8fb9ebfb0339663b /tests/auto
parentc6e49568deaf973df276d5168714df0c9a2aad85 (diff)
parent817a292690ccdea7bae185319beb22ea653db946 (diff)
downloadqbs-7dd870f21601301aca67548e96866204cec3e852.tar.gz
Merge 1.14 into master
Change-Id: Ic9ee11d628ba278271517aae0af020aec28ecbf7
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/input.binbin0 -> 1024 bytes
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/input.txt1
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs38
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/output.binbin0 -> 2048 bytes
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/output.txt2
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp8
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
7 files changed, 50 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/output-redirection/input.bin b/tests/auto/blackbox/testdata/output-redirection/input.bin
new file mode 100644
index 000000000..2b231c7a8
--- /dev/null
+++ b/tests/auto/blackbox/testdata/output-redirection/input.bin
Binary files differ
diff --git a/tests/auto/blackbox/testdata/output-redirection/input.txt b/tests/auto/blackbox/testdata/output-redirection/input.txt
new file mode 100644
index 000000000..0ba7b6bf7
--- /dev/null
+++ b/tests/auto/blackbox/testdata/output-redirection/input.txt
@@ -0,0 +1 @@
+this is a plain text file
diff --git a/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs
new file mode 100644
index 000000000..3ee443438
--- /dev/null
+++ b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs
@@ -0,0 +1,38 @@
+import qbs.FileInfo
+
+Product {
+ name: "the-product"
+ type: "output"
+ Group {
+ files: "input.bin"
+ fileTags: "binary"
+ }
+ Group {
+ files: "input.txt"
+ fileTags: "text"
+ }
+
+ Rule {
+ inputs: ["text", "binary"]
+ Artifact {
+ filePath: "output." + FileInfo.completeSuffix(input.filePath)
+ fileTags: "output"
+ }
+ prepare: {
+ var binary;
+ var prefixArgs;
+ if (product.qbs.hostOS.contains("windows")) {
+ binary = product.qbs.windowsShellPath;
+ prefixArgs = ["/c", "type"];
+ } else {
+ binary = "cat";
+ prefixArgs = [];
+ }
+ var inputPath = FileInfo.toNativeSeparators(input.filePath);
+ var cmd = new Command(binary, prefixArgs.concat([inputPath, inputPath]));
+ cmd.stdoutFilePath = output.filePath;
+ cmd.highlight = "filegen";
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/output-redirection/output.bin b/tests/auto/blackbox/testdata/output-redirection/output.bin
new file mode 100644
index 000000000..efb4ec03b
--- /dev/null
+++ b/tests/auto/blackbox/testdata/output-redirection/output.bin
Binary files differ
diff --git a/tests/auto/blackbox/testdata/output-redirection/output.txt b/tests/auto/blackbox/testdata/output-redirection/output.txt
new file mode 100644
index 000000000..e309ab1af
--- /dev/null
+++ b/tests/auto/blackbox/testdata/output-redirection/output.txt
@@ -0,0 +1,2 @@
+this is a plain text file
+this is a plain text file
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 31a5a92ae..a2e8238c9 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -6306,6 +6306,14 @@ void TestBlackbox::outputArtifactAutoTagging()
QVERIFY(regularFileExists(relativeExecutableFilePath("output-artifact-auto-tagging")));
}
+void TestBlackbox::outputRedirection()
+{
+ QDir::setCurrent(testDataDir + "/output-redirection");
+ QCOMPARE(runQbs(), 0);
+ TEXT_FILE_COMPARE("output.txt", relativeProductBuildDir("the-product") + "/output.txt");
+ TEXT_FILE_COMPARE("output.bin", relativeProductBuildDir("the-product") + "/output.bin");
+}
+
void TestBlackbox::wildCardsAndRules()
{
QDir::setCurrent(testDataDir + "/wildcards-and-rules");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 4c1268912..ba511ed10 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -209,6 +209,7 @@ private slots:
void nsisDependencies();
void outOfDateMarking();
void outputArtifactAutoTagging();
+ void outputRedirection();
void overrideProjectProperties();
void pathProbe_data();
void pathProbe();