aboutsummaryrefslogtreecommitdiff
path: root/tests/new.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-23 20:29:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-23 20:29:15 +0300
commit8f4da78ef8433fde0f277aa880d7798caae83460 (patch)
treeade40d0c559ee19e9baaa26776572c3e15626a1d /tests/new.test
parentf614173d688fd6e57871e1bab5a159e06a2ac07a (diff)
Fix broken new command tests
Diffstat (limited to 'tests/new.test')
-rw-r--r--tests/new.test122
1 files changed, 65 insertions, 57 deletions
diff --git a/tests/new.test b/tests/new.test
index 703540a..3a62df3 100644
--- a/tests/new.test
+++ b/tests/new.test
@@ -4,86 +4,94 @@
.include common.test
-# Disable nesting checks and amalgamation support in the created projects.
+# Disable nesting checks in the created projects.
#
-test.arguments += --no-checks --no-amalgamation
+test.arguments += --no-checks
cxx = "config.cxx=$config.cxx"
status += -d prj
-: exe
-{
- $* -t exe -l c++ prj 2>>/"EOE" &prj/***;
- created new executable project prj in $~/prj/
- EOE
-
- $build prj/ $cxx 2>>/EOE
- c++ prj/prj/cxx{prj}
- ld prj/prj/exe{prj}
- EOE
-}
-
-: lib
-{
- $* -t lib -l c++ libprj 2>>/"EOE" &libprj/***;
- created new library project libprj in $~/libprj/
- EOE
-
- $build libprj/ $cxx 2>>/~%EOE%
- %.{4}
- %ld libprj/.+%{3}
- EOE
-}
-
-: pkg
+: no-cfg
:
{
- : add
- :
- : Test creating a library as a separate package in the project.
- :
+ # Disable amalgamation support in the created projects.
+ #
+ test.arguments += --no-amalgamation
+
+ : exe
{
- $* -t empty prj 2>>/"EOE" &prj/***;
- created new empty project prj in $~/prj/
+ $* --no-amalgamation -t exe -l c++ prj 2>>/"EOE" &prj/***;
+ created new executable project prj in $~/prj/
EOE
- $* --package -t lib libprj -d prj 2>>/"EOE";
- created new library package libprj in $~/prj/libprj/
+ $build prj/ $cxx 2>>/EOE
+ c++ prj/prj/cxx{prj}
+ ld prj/prj/exe{prj}
EOE
+ }
- $build prj/libprj/ $cxx 2>>/~%EOE%
+ : lib
+ {
+ $* --no-amalgamation -t lib -l c++ libprj 2>>/"EOE" &libprj/***;
+ created new library project libprj in $~/libprj/
+ EOE
+
+ $build libprj/ $cxx 2>>/~%EOE%
%.{4}
- %ld prj/libprj/.+%{3}
+ %ld libprj/.+%{3}
EOE
}
- : name
- :
- : Test that the package/project name is validated.
+ : pkg
:
{
- : package
+ : add
:
- $* x 2>'error: invalid package name: length is less than two characters' != 0
-
- : project
+ : Test creating a library as a separate package in the project.
:
- : Here we also test that the project name is also validated as a package.
+ {
+ $* -t empty prj 2>>/"EOE" &prj/***;
+ created new empty project prj in $~/prj/
+ EOE
+
+ $* --package -t lib libprj -d prj 2>>/"EOE";
+ created new library package libprj in $~/prj/libprj/
+ EOE
+
+ $build prj/libprj/ $cxx 2>>/~%EOE%
+ %.{4}
+ %ld prj/libprj/.+%{3}
+ EOE
+ }
+
+ : name
:
- $* -t empty x 2>'error: invalid project name: length is less than two characters' != 0
-
- : project-derived
+ : Test that the package/project name is validated.
:
- $* -t empty xx &xx/*** 2>>/"EOE";
- created new empty project xx in $~/xx/
- EOE
- mv xx x;
- $* --package pkg -d x 2>>/"EOE"
- warning: project name 'x' is invalid: length is less than two characters
- info: leaving the 'project' manifest value empty
- created new executable package pkg in $~/x/pkg/
- EOE
+ {
+ : package
+ :
+ $* x 2>'error: invalid package name: length is less than two characters' != 0
+
+ : project
+ :
+ : Here we also test that the project name is also validated as a package.
+ :
+ $* -t empty x 2>'error: invalid project name: length is less than two characters' != 0
+
+ : project-derived
+ :
+ $* -t empty xx &xx/*** 2>>/"EOE";
+ created new empty project xx in $~/xx/
+ EOE
+ mv xx x;
+ $* --package pkg -d x 2>>/"EOE"
+ warning: project name 'x' is invalid: length is less than two characters
+ info: leaving the 'project' manifest value empty
+ created new executable package pkg in $~/x/pkg/
+ EOE
+ }
}
}