aboutsummaryrefslogtreecommitdiff
path: root/tests/b-info/testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-01-14 22:00:36 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-01-16 18:21:44 +0300
commit78be8e1604f183b28527159047bab69a5cbe9232 (patch)
tree40bc9c7990992257dd2bdaf7dea27d186bc9437d /tests/b-info/testscript
parentf7dc4934b04c062b1ce8aad09725a30707255e69 (diff)
Add b_info() that runs `b info` command and parses and returns build2 project info
Diffstat (limited to 'tests/b-info/testscript')
-rw-r--r--tests/b-info/testscript83
1 files changed, 83 insertions, 0 deletions
diff --git a/tests/b-info/testscript b/tests/b-info/testscript
new file mode 100644
index 0000000..9d1cfeb
--- /dev/null
+++ b/tests/b-info/testscript
@@ -0,0 +1,83 @@
+# file : tests/b-info/testscript
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Note that when cross-testing we unlikely be able to run build2 on the
+# target platform.
+#
++if ($test.target != $build.host)
+ exit
+end
+
+sp = ' '
+test.options += -b $recall($build.path)
+
+: basic
+:
+{
+ mkdir -p prj/build;
+
+ cat <<EOI >=prj/build/bootstrap.build;
+ project = prj
+
+ using version
+ using config
+ using dist
+ EOI
+
+ cat <<EOI >=prj/buildfile;
+ ./: subprj/
+ EOI
+
+ cat <<EOI >=prj/manifest;
+ : 1
+ name: prj
+ version: 1.2.3-a.0.z
+ summary: test project
+ license: MIT
+ EOI
+
+ mkdir -p prj/subprj/build;
+
+ cat <<EOI >=prj/subprj/build/bootstrap.build;
+ project =
+
+ using config
+ using dist
+ EOI
+
+ touch prj/subprj/buildfile;
+
+ $* prj >>/~"%EOO%";
+ project: prj
+ version: 1.2.3-a.0.z
+ summary: test project
+ url:$sp
+ %src_root: .+/prj/%
+ %out_root: .+/prj/%
+ amalgamation: ../../../../
+ subprojects: @subprj/
+ operations: update clean
+ meta-operations: perform configure disfigure dist info
+ EOO
+
+ $* prj/subprj >>/~"%EOO%"
+ project:$sp
+ version:$sp
+ summary:$sp
+ url:$sp
+ %src_root: .+/subprj/%
+ %out_root: .+/subprj/%
+ amalgamation: ../
+ subprojects:$sp
+ operations: update clean
+ meta-operations: perform configure disfigure dist info
+ EOO
+}
+
+: error
+:
+$* prj 2>>/~%EOE% != 0
+ %error: .+%
+ % info: .+%?
+ EOE