From cbca50ad179ccdeef587e63bc084547130b70aae Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 29 Oct 2001 18:23:16 +0000 Subject: [PATCH] TODO.txt Added missing jobs; marked others done. allyourbase.jam Fixed split and split-path for Unix boost-base.jam Fixed the Run action for Windows gcc-tools.jam intel-win32-tools.jam kcc-tools.jam metrowerks-tools.jam msvc-tools.jam Removed UNDEFS from link line, moved NEEDLIBS to end unit-tests.jam Added tests splitpath tests for rooted Unix paths jam_src/make1.c NOCARE targets with build actions now don't cause the parent to fail when they fail. build_system.htm Documented NOCARE enhancements [SVN r11463] --- TODO.txt | 41 ++++++++++++++++++++++++---------------- allyourbase.jam | 23 +++++++++++++++++----- boost-base.jam | 3 ++- build_system.htm | 9 +++++++++ gcc-tools.jam | 2 +- intel-win32-tools.jam | 2 +- kcc-tools.jam | 2 +- metrowerks-tools.jam | 2 +- msvc-tools.jam | 2 +- new-split.jam | 2 +- unit-tests.jam | 3 +++ v1/TODO.txt | 41 ++++++++++++++++++++++++---------------- v1/allyourbase.jam | 23 +++++++++++++++++----- v1/boost-base.jam | 3 ++- v1/build_system.htm | 9 +++++++++ v1/gcc-tools.jam | 2 +- v1/intel-win32-tools.jam | 2 +- v1/kcc-tools.jam | 2 +- v1/metrowerks-tools.jam | 2 +- v1/msvc-tools.jam | 2 +- v1/new-split.jam | 2 +- v1/unit-tests.jam | 3 +++ 22 files changed, 126 insertions(+), 56 deletions(-) diff --git a/TODO.txt b/TODO.txt index 931096462..475e709fb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -7,6 +7,17 @@ to its suitability for any purpose. Boost Build system TODO ===== ===== ====== ==== +DONE * Fix split-path bug which unroots paths on Unix + +DONE * move NEEDLIBS to end of link line + +* Fix bug with not found Python scripts + +* $(REDIRECT) for toolset invocations: + Unix: > filename 2>&1 -- puts stdout && stderr in same file + +* add "|| exit $?" for unix to get it to exit for multi-line test commands. + * Make it possible to qualify dependencies just like requirements. * consider eliminating the need for <*> @@ -15,12 +26,12 @@ Boost Build system TODO * Add support for invoking debuggers from within the build system. -* Fix the subinclude problem with project-wide variable settings (e.g. +DONE * Fix the subinclude problem with project-wide variable settings (e.g. BOOST_ROOT) that Beman pointed out to me. * Move test target rules from status/Jamfile into boost-base.jam -* Add requested test targets. I think we need at least the following +SORTA DONE * Add requested test targets. I think we need at least the following capability: 1. The ability to run any built executable 2. Two categories of test targets (call them "test" and "full-test") which @@ -33,9 +44,9 @@ needs to be updated by running the executable with stdout redirected to the * Add examples directory back into CVS -* Support for KCC +DONE * Support for KCC -* Specific support for GCC-3 +DONE * Specific support for GCC-3 * Eliminate the need for intermediate dispatching rules (e.g. C++-action) in each toolset. @@ -69,7 +80,7 @@ Implement feature for separately searching #include <...> paths? search algorithm. Clean up documentation - describe gristing + DONE describe gristing revise free/path feature definition Add a hook function to allow output directory customization that some people @@ -77,12 +88,10 @@ want (instead of subdirectories, string together short names with '-'). Platform support: Unix paths on Mac/VMS - Integrate Win95/98/ME support + DONE Integrate Win95/98/ME support - Since the above require modification to Jam compiled source, getting the - code into the Perforce public depot would be good at this point. -Compile allyourbase/boost-base.jam into Jam itself. +DONE (something better) Compile allyourbase/boost-base.jam into Jam itself. It might be best to review differences between allyourbase.jam and Jambase, and arrange the new Jambase to be a superset of the perforce Jambase so that a boost-compiled Jam can be used on standard Jambase projects without @@ -99,9 +108,9 @@ Testing MacOS Additional toolset descriptions - Kai (needs refurbishment) - Intel - Comeau + DONE Kai (needs refurbishment) + DONE, but needs rework Intel + DONE(windows) Comeau ... Better support for single-valued free features. GCC needs a default @@ -129,12 +138,12 @@ Implement some test tools: === FTJam core requests === -In debugging output, indirect rule invocations should reflect the rule name +DONE In debugging output, indirect rule invocations should reflect the rule name being invoked. -Fix modulus on nesting in debug output, so my emacs stepping tools don't get +DONE Fix modulus on nesting in debug output, so my emacs stepping tools don't get confused. -Expand MAXLINE for NT, possibly as described by Chris Antos. +DONE-ish Expand MAXLINE for NT, possibly as described by Chris Antos. -Implement a way to invert the result of a rule, so that failure becomes success. +DONE Implement a way to invert the result of a rule, so that failure becomes success. diff --git a/allyourbase.jam b/allyourbase.jam index 4437dae61..8b6a685a0 100644 --- a/allyourbase.jam +++ b/allyourbase.jam @@ -1387,13 +1387,20 @@ if $(JAM_VERSION[1]) >= 03 { SEARCH on new-split.jam = $(BOOST_BUILD_PATH) ; include new-split.jam ; # this is temporary. +rule split-path +{ + return [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $1 ] # rooting slash(es), if any + [ split $(<) "[/$(SLASH)]" ] # the rest. + ; +} + } else { rule split # string pattern { local source = $(<[1]) ; local divider = $(<[2]) ; - local pattern = "(.*)("$(divider)")(.*)" ; + local pattern = "^(.*)("$(divider)")(.*)" ; # SUBST rule is weird. When there's no match it returns the original string. local match = [ SUBST $(source) $(pattern) $1$2$3xxx ] ; @@ -1409,12 +1416,18 @@ rule split # string pattern } } -} - -# simpler reimplementation of split-path for boost rule split-path { - return [ split $(<) "[/$(SLASH)]" ] ; + local unmatched = [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $2 ] ; + local root ; + if ! $(unmatched) + { + root = [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $1 ] ; + } + return $(root) [ split $(<) "[/$(SLASH)]" ] + ; +} + } # dwa 6/4/01 - added for boost diff --git a/boost-base.jam b/boost-base.jam index c51d1198d..05a9dba75 100644 --- a/boost-base.jam +++ b/boost-base.jam @@ -164,7 +164,8 @@ RUN_PATH ?= $(PATH) ; # A simple action to run an executable target actions Run { - $(SHELL_EXPORT)PATH=$(RUN_PATH) + $(SHELL_SET)PATH=$(RUN_PATH) + $(SHELL_EXPORT)PATH $(<) } diff --git a/build_system.htm b/build_system.htm index ecdb21d04..850934efc 100644 --- a/build_system.htm +++ b/build_system.htm @@ -143,6 +143,7 @@
  • Negative Indexing
  • Target Binding Detection
  • Return Code Inversion +
  • Ignoring Return Codes
  • The SUBST Rule
  • The JAM_VERSION global variable
  • @@ -1608,6 +1609,14 @@ rule bind-rule ( target : path ) if it fails, building of dependent targets continues as though it succeeded. If it succeeds, dependent targets are skipped. +

    Ignoring Return Codes

    + +

    Perforce Jam suppplied a NOCARE rule which is typically used + for header files to indicate that if they are not found, the dependent + targets should be built anyway. Boost Jam extends NOCARE to apply + to targets with build actions: if their build actions exit with a nonzero + return code, dependent targets will still be built. +

    The SUBST Rule

    The behavior of the SUBST rule for regular-expression matching diff --git a/gcc-tools.jam b/gcc-tools.jam index 7733a96e9..d0f9d49f2 100644 --- a/gcc-tools.jam +++ b/gcc-tools.jam @@ -72,7 +72,7 @@ rule Link-action # for gcc, we repeat all libraries so that dependencies are always resolved actions gcc-Link-action bind NEEDLIBS { - $(GCC_BIN_DIRECTORY)g++ $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) + $(GCC_BIN_DIRECTORY)g++ $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" -l$(FINDLIBS) "$(NEEDLIBS)" "$(NEEDLIBS)" } # older actions diff --git a/intel-win32-tools.jam b/intel-win32-tools.jam index b457b0e50..f22416093 100644 --- a/intel-win32-tools.jam +++ b/intel-win32-tools.jam @@ -59,7 +59,7 @@ rule Link-action actions intel-win32-Link-action bind NEEDLIBS { - $(INTEL_TOOL_PATH)xilink /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" $(UNDEFS) /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(INTEL_TOOL_PATH)xilink /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" $(UNDEFS) /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) "$(NEEDLIBS)" "$(>)" } #### Cc ##### diff --git a/kcc-tools.jam b/kcc-tools.jam index b968921f0..26eebd778 100644 --- a/kcc-tools.jam +++ b/kcc-tools.jam @@ -19,7 +19,7 @@ rule Link-action actions kcc-Link-action bind NEEDLIBS { - $(kcc.bin-directory)KCC $(LINKFLAGS) -o "$(<)" $(UNDEFS) -L$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(kcc.bin-directory)KCC $(LINKFLAGS) -o "$(<)" -L$(STDLIBPATH) "$(>)" NEEDLIBS } #### Cc ##### diff --git a/metrowerks-tools.jam b/metrowerks-tools.jam index a142e8ca9..dc4c9fbcf 100644 --- a/metrowerks-tools.jam +++ b/metrowerks-tools.jam @@ -80,7 +80,7 @@ actions metrowerks-Link-action bind NEEDLIBS { $(METROWERKS_SETUP) $(METROWERKS_LINK_SETUP)$(STDLIBS) - mwld -export dllexport -nowraplines $(LINKFLAGS) -L$(LIBPATH) -L$(STDLIBPATH) $(IMPLIB_COMMAND)"$(<[2])" -o "$(<[1])" $(UNDEFS) $(NEEDLIBS) "$(>)" -l$(FINDLIBS) + mwld -export dllexport -nowraplines $(LINKFLAGS) -L$(LIBPATH) -L$(STDLIBPATH) $(IMPLIB_COMMAND)"$(<[2])" -o "$(<[1])" "$(NEEDLIBS)" "$(>)" -l$(FINDLIBS) } #### Cc ##### diff --git a/msvc-tools.jam b/msvc-tools.jam index 0712dea20..0bf17d3fd 100644 --- a/msvc-tools.jam +++ b/msvc-tools.jam @@ -57,7 +57,7 @@ rule Link-action actions msvc-Link-action bind NEEDLIBS { - $(MSVC_TOOL_PATH)link /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(MSVC_TOOL_PATH)link /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) "$(NEEDLIBS)" "$(>)" } #### Cc ##### diff --git a/new-split.jam b/new-split.jam index 4033cafca..2f07202dd 100644 --- a/new-split.jam +++ b/new-split.jam @@ -8,7 +8,7 @@ rule split ( string separator ) while $(s) { - local match = [ SUBST $(s) (.*)$(separator)(.*) $1 $2 ] ; + local match = [ SUBST $(s) ^(.*)$(separator)(.*) $1 $2 ] ; local tail = $(match[2]) ; tail ?= $(s) ; diff --git a/unit-tests.jam b/unit-tests.jam index 3d86b0e8a..1747eaf6a 100644 --- a/unit-tests.jam +++ b/unit-tests.jam @@ -7,6 +7,7 @@ # assert_equal a : b # # exits with an assertion failure if a != b +ECHO running unit tests... ; rule assert_equal { if $(<) != $(>) @@ -75,6 +76,7 @@ assert_equal [ is-subset a b c : c a b d ] : true ; assert_equal [ is-subset a b z : c a b d ] : ; # split-path +assert_equal [ split-path /a/b/c ] : / a b c ; assert_equal [ split-path b/c.d/.f/g./h.i ] : b c.d .f g. h.i ; assert_equal [ split-path b/c/e ] : b c e ; assert_equal [ split-path // ] : ; @@ -267,3 +269,4 @@ assert_equal [ strip-initial a b c : a b d e f g ] : a b d e f g ; assert_equal [ strip-initial a b c : b d e f g ] : b d e f g ; assert_equal [ strip-initial a b c : ] : ; +ECHO unit tests complete. ; \ No newline at end of file diff --git a/v1/TODO.txt b/v1/TODO.txt index 931096462..475e709fb 100644 --- a/v1/TODO.txt +++ b/v1/TODO.txt @@ -7,6 +7,17 @@ to its suitability for any purpose. Boost Build system TODO ===== ===== ====== ==== +DONE * Fix split-path bug which unroots paths on Unix + +DONE * move NEEDLIBS to end of link line + +* Fix bug with not found Python scripts + +* $(REDIRECT) for toolset invocations: + Unix: > filename 2>&1 -- puts stdout && stderr in same file + +* add "|| exit $?" for unix to get it to exit for multi-line test commands. + * Make it possible to qualify dependencies just like requirements. * consider eliminating the need for <*> @@ -15,12 +26,12 @@ Boost Build system TODO * Add support for invoking debuggers from within the build system. -* Fix the subinclude problem with project-wide variable settings (e.g. +DONE * Fix the subinclude problem with project-wide variable settings (e.g. BOOST_ROOT) that Beman pointed out to me. * Move test target rules from status/Jamfile into boost-base.jam -* Add requested test targets. I think we need at least the following +SORTA DONE * Add requested test targets. I think we need at least the following capability: 1. The ability to run any built executable 2. Two categories of test targets (call them "test" and "full-test") which @@ -33,9 +44,9 @@ needs to be updated by running the executable with stdout redirected to the * Add examples directory back into CVS -* Support for KCC +DONE * Support for KCC -* Specific support for GCC-3 +DONE * Specific support for GCC-3 * Eliminate the need for intermediate dispatching rules (e.g. C++-action) in each toolset. @@ -69,7 +80,7 @@ Implement feature for separately searching #include <...> paths? search algorithm. Clean up documentation - describe gristing + DONE describe gristing revise free/path feature definition Add a hook function to allow output directory customization that some people @@ -77,12 +88,10 @@ want (instead of subdirectories, string together short names with '-'). Platform support: Unix paths on Mac/VMS - Integrate Win95/98/ME support + DONE Integrate Win95/98/ME support - Since the above require modification to Jam compiled source, getting the - code into the Perforce public depot would be good at this point. -Compile allyourbase/boost-base.jam into Jam itself. +DONE (something better) Compile allyourbase/boost-base.jam into Jam itself. It might be best to review differences between allyourbase.jam and Jambase, and arrange the new Jambase to be a superset of the perforce Jambase so that a boost-compiled Jam can be used on standard Jambase projects without @@ -99,9 +108,9 @@ Testing MacOS Additional toolset descriptions - Kai (needs refurbishment) - Intel - Comeau + DONE Kai (needs refurbishment) + DONE, but needs rework Intel + DONE(windows) Comeau ... Better support for single-valued free features. GCC needs a default @@ -129,12 +138,12 @@ Implement some test tools: === FTJam core requests === -In debugging output, indirect rule invocations should reflect the rule name +DONE In debugging output, indirect rule invocations should reflect the rule name being invoked. -Fix modulus on nesting in debug output, so my emacs stepping tools don't get +DONE Fix modulus on nesting in debug output, so my emacs stepping tools don't get confused. -Expand MAXLINE for NT, possibly as described by Chris Antos. +DONE-ish Expand MAXLINE for NT, possibly as described by Chris Antos. -Implement a way to invert the result of a rule, so that failure becomes success. +DONE Implement a way to invert the result of a rule, so that failure becomes success. diff --git a/v1/allyourbase.jam b/v1/allyourbase.jam index 4437dae61..8b6a685a0 100644 --- a/v1/allyourbase.jam +++ b/v1/allyourbase.jam @@ -1387,13 +1387,20 @@ if $(JAM_VERSION[1]) >= 03 { SEARCH on new-split.jam = $(BOOST_BUILD_PATH) ; include new-split.jam ; # this is temporary. +rule split-path +{ + return [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $1 ] # rooting slash(es), if any + [ split $(<) "[/$(SLASH)]" ] # the rest. + ; +} + } else { rule split # string pattern { local source = $(<[1]) ; local divider = $(<[2]) ; - local pattern = "(.*)("$(divider)")(.*)" ; + local pattern = "^(.*)("$(divider)")(.*)" ; # SUBST rule is weird. When there's no match it returns the original string. local match = [ SUBST $(source) $(pattern) $1$2$3xxx ] ; @@ -1409,12 +1416,18 @@ rule split # string pattern } } -} - -# simpler reimplementation of split-path for boost rule split-path { - return [ split $(<) "[/$(SLASH)]" ] ; + local unmatched = [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $2 ] ; + local root ; + if ! $(unmatched) + { + root = [ SUBST $(<[1]) "^([/$(SLASH)]+).*" $1 ] ; + } + return $(root) [ split $(<) "[/$(SLASH)]" ] + ; +} + } # dwa 6/4/01 - added for boost diff --git a/v1/boost-base.jam b/v1/boost-base.jam index c51d1198d..05a9dba75 100644 --- a/v1/boost-base.jam +++ b/v1/boost-base.jam @@ -164,7 +164,8 @@ RUN_PATH ?= $(PATH) ; # A simple action to run an executable target actions Run { - $(SHELL_EXPORT)PATH=$(RUN_PATH) + $(SHELL_SET)PATH=$(RUN_PATH) + $(SHELL_EXPORT)PATH $(<) } diff --git a/v1/build_system.htm b/v1/build_system.htm index ecdb21d04..850934efc 100644 --- a/v1/build_system.htm +++ b/v1/build_system.htm @@ -143,6 +143,7 @@

  • Negative Indexing
  • Target Binding Detection
  • Return Code Inversion +
  • Ignoring Return Codes
  • The SUBST Rule
  • The JAM_VERSION global variable
  • @@ -1608,6 +1609,14 @@ rule bind-rule ( target : path ) if it fails, building of dependent targets continues as though it succeeded. If it succeeds, dependent targets are skipped. +

    Ignoring Return Codes

    + +

    Perforce Jam suppplied a NOCARE rule which is typically used + for header files to indicate that if they are not found, the dependent + targets should be built anyway. Boost Jam extends NOCARE to apply + to targets with build actions: if their build actions exit with a nonzero + return code, dependent targets will still be built. +

    The SUBST Rule

    The behavior of the SUBST rule for regular-expression matching diff --git a/v1/gcc-tools.jam b/v1/gcc-tools.jam index 7733a96e9..d0f9d49f2 100644 --- a/v1/gcc-tools.jam +++ b/v1/gcc-tools.jam @@ -72,7 +72,7 @@ rule Link-action # for gcc, we repeat all libraries so that dependencies are always resolved actions gcc-Link-action bind NEEDLIBS { - $(GCC_BIN_DIRECTORY)g++ $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" -l$(FINDLIBS) + $(GCC_BIN_DIRECTORY)g++ $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])" -L$(LIBPATH) -L$(STDLIBPATH) "$(>)" -l$(FINDLIBS) "$(NEEDLIBS)" "$(NEEDLIBS)" } # older actions diff --git a/v1/intel-win32-tools.jam b/v1/intel-win32-tools.jam index b457b0e50..f22416093 100644 --- a/v1/intel-win32-tools.jam +++ b/v1/intel-win32-tools.jam @@ -59,7 +59,7 @@ rule Link-action actions intel-win32-Link-action bind NEEDLIBS { - $(INTEL_TOOL_PATH)xilink /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" $(UNDEFS) /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(INTEL_TOOL_PATH)xilink /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" $(UNDEFS) /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) "$(NEEDLIBS)" "$(>)" } #### Cc ##### diff --git a/v1/kcc-tools.jam b/v1/kcc-tools.jam index b968921f0..26eebd778 100644 --- a/v1/kcc-tools.jam +++ b/v1/kcc-tools.jam @@ -19,7 +19,7 @@ rule Link-action actions kcc-Link-action bind NEEDLIBS { - $(kcc.bin-directory)KCC $(LINKFLAGS) -o "$(<)" $(UNDEFS) -L$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(kcc.bin-directory)KCC $(LINKFLAGS) -o "$(<)" -L$(STDLIBPATH) "$(>)" NEEDLIBS } #### Cc ##### diff --git a/v1/metrowerks-tools.jam b/v1/metrowerks-tools.jam index a142e8ca9..dc4c9fbcf 100644 --- a/v1/metrowerks-tools.jam +++ b/v1/metrowerks-tools.jam @@ -80,7 +80,7 @@ actions metrowerks-Link-action bind NEEDLIBS { $(METROWERKS_SETUP) $(METROWERKS_LINK_SETUP)$(STDLIBS) - mwld -export dllexport -nowraplines $(LINKFLAGS) -L$(LIBPATH) -L$(STDLIBPATH) $(IMPLIB_COMMAND)"$(<[2])" -o "$(<[1])" $(UNDEFS) $(NEEDLIBS) "$(>)" -l$(FINDLIBS) + mwld -export dllexport -nowraplines $(LINKFLAGS) -L$(LIBPATH) -L$(STDLIBPATH) $(IMPLIB_COMMAND)"$(<[2])" -o "$(<[1])" "$(NEEDLIBS)" "$(>)" -l$(FINDLIBS) } #### Cc ##### diff --git a/v1/msvc-tools.jam b/v1/msvc-tools.jam index 0712dea20..0bf17d3fd 100644 --- a/v1/msvc-tools.jam +++ b/v1/msvc-tools.jam @@ -57,7 +57,7 @@ rule Link-action actions msvc-Link-action bind NEEDLIBS { - $(MSVC_TOOL_PATH)link /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) $(NEEDLIBS) "$(>)" + $(MSVC_TOOL_PATH)link /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)" /out:"$(<[1])" /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH) "$(NEEDLIBS)" "$(>)" } #### Cc ##### diff --git a/v1/new-split.jam b/v1/new-split.jam index 4033cafca..2f07202dd 100644 --- a/v1/new-split.jam +++ b/v1/new-split.jam @@ -8,7 +8,7 @@ rule split ( string separator ) while $(s) { - local match = [ SUBST $(s) (.*)$(separator)(.*) $1 $2 ] ; + local match = [ SUBST $(s) ^(.*)$(separator)(.*) $1 $2 ] ; local tail = $(match[2]) ; tail ?= $(s) ; diff --git a/v1/unit-tests.jam b/v1/unit-tests.jam index 3d86b0e8a..1747eaf6a 100644 --- a/v1/unit-tests.jam +++ b/v1/unit-tests.jam @@ -7,6 +7,7 @@ # assert_equal a : b # # exits with an assertion failure if a != b +ECHO running unit tests... ; rule assert_equal { if $(<) != $(>) @@ -75,6 +76,7 @@ assert_equal [ is-subset a b c : c a b d ] : true ; assert_equal [ is-subset a b z : c a b d ] : ; # split-path +assert_equal [ split-path /a/b/c ] : / a b c ; assert_equal [ split-path b/c.d/.f/g./h.i ] : b c.d .f g. h.i ; assert_equal [ split-path b/c/e ] : b c e ; assert_equal [ split-path // ] : ; @@ -267,3 +269,4 @@ assert_equal [ strip-initial a b c : a b d e f g ] : a b d e f g ; assert_equal [ strip-initial a b c : b d e f g ] : b d e f g ; assert_equal [ strip-initial a b c : ] : ; +ECHO unit tests complete. ; \ No newline at end of file