From 8f4da78ef8433fde0f277aa880d7798caae83460 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 23 Jul 2018 20:29:15 +0300 Subject: Fix broken new command tests --- tests/new.test | 122 ++++++++++++++++++++++++++++++--------------------------- 1 file 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 + } } } -- cgit v1.1