Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49998 - in trunk/libs/units: doc example test test_headers
From: steven_at_[hidden]
Date: 2008-11-28 16:16:49


Author: steven_watanabe
Date: 2008-11-28 16:16:48 EST (Fri, 28 Nov 2008)
New Revision: 49998
URL: http://svn.boost.org/trac/boost/changeset/49998

Log:
Clean up Jamfiles
Text files modified:
   trunk/libs/units/doc/Jamfile.v2 | 81 +++++++++++++++++-------------
   trunk/libs/units/example/Jamfile.v2 | 25 +++------
   trunk/libs/units/test/Jamfile.v2 | 103 +++++++++++++++++----------------------
   trunk/libs/units/test_headers/Jamfile.v2 | 39 +++++---------
   4 files changed, 114 insertions(+), 134 deletions(-)

Modified: trunk/libs/units/doc/Jamfile.v2
==============================================================================
--- trunk/libs/units/doc/Jamfile.v2 (original)
+++ trunk/libs/units/doc/Jamfile.v2 2008-11-28 16:16:48 EST (Fri, 28 Nov 2008)
@@ -17,31 +17,30 @@
 
 path-constant here : . ;
 
-rule run_doxygen ( target : files * : name : expand ? )
+rule run_doxygen ( target : files * : name )
 {
-
- expand ?= <doxygen:param>EXPAND_ONLY_PREDEF=YES ;
-
-doxygen $(target)
- :
- $(files)
- :
+ doxygen $(target)
+ :
+ $(files)
+ :
         <doxygen:param>EXTRACT_ALL=YES
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
 
-# Horribly ugly, but then macros usually are :(
- <doxygen:param>"PREDEFINED=\"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\
- \"BOOST_UNITS_AUTO_STATIC_CONSTANT(a,b)=static const auto a = b\" \\
- \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\
- \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
- \"BOOST_UNITS_HAS_TYPEOF=1\" \\
- \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\
- namespace boost { namespace units { namespace namespace_ { \\
- struct name_ ## _base_unit : boost::units::base_unit<name_ ## _base_unit, other_unit::dimension_type, id> { \\
- static const char* name(); \\
- static const char* symbol(); \\
- }; \\
- } } }\" \\
- \"BOOST_UNITS_DOXYGEN=1\""
+ # Horribly ugly, but then macros usually are :(
+ <doxygen:param>"PREDEFINED= \\
+ \"BOOST_UNITS_STATIC_CONSTANT(a,b)=static const b a\" \\
+ \"BOOST_UNITS_AUTO_STATIC_CONSTANT(a,b)=static const auto a = b\" \\
+ \"BOOST_UNITS_TYPEOF(a)=typeof(a)\" \\
+ \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
+ \"BOOST_UNITS_HAS_TYPEOF=1\" \\
+ \"BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string, symbol_, factor, other_unit, id)= \\
+ namespace boost { namespace units { namespace namespace_ { \\
+ struct name_ ## _base_unit : boost::units::base_unit<name_ ## _base_unit, other_unit::dimension_type, id> { \\
+ static const char* name(); \\
+ static const char* symbol(); \\
+ }; \\
+ } } }\" \\
+ \"BOOST_UNITS_DOXYGEN=1\""
         <doxygen:param>HIDE_UNDOC_MEMBERS=NO
         <doxygen:param>EXTRACT_PRIVATE=NO
         <doxygen:param>ENABLE_PREPROCESSING=YES
@@ -49,7 +48,7 @@
         $(expand)
         <doxygen:param>SEARCH_INCLUDES=NO
         <reftitle>$(name)
- ;
+ ;
 
 }
 
@@ -76,7 +75,8 @@
     "CGS System Reference"
   ;
 
-rule make_base_units_doc ( directory : name ) {
+rule make_base_units_doc ( directory : name )
+{
     run_doxygen $(directory)_base_units_reference
       :
         [ path.glob-tree $(here)/../../../boost/units/base_units/$(directory) : *.hpp : detail conversions.hpp ]
@@ -127,39 +127,48 @@
     "Abstract System Reference"
   ;
 
-rule less ( a b ) {
- if [ path.basename $(a) ] < [ path.basename $(b) ] {
+rule less ( a b )
+{
+ if [ path.basename $(a) ] < [ path.basename $(b) ]
+ {
         return true ;
     }
 }
 
-rule generate-qbk ( target : sources * : properties * ) {
+rule generate-qbk ( target : sources * : properties * )
+{
     print.output $(target) ;
     local as-path = [ sequence.transform path.make : $(sources:G=) ] ;
     local known = ;
     local duplicated = ;
- for local file in $(as-path) {
+ for local file in $(as-path)
+ {
         local base = [ path.basename $(file) ] ;
- if $(base) in $(known) {
- if ! $(base) in $(duplicated) {
+ if $(base) in $(known)
+ {
+ if ! $(base) in $(duplicated)
+ {
                 duplicated += $(base) ;
             }
- } else {
+ } else
+ {
             known += $(base) ;
         }
     }
- for local file in [ sequence.insertion-sort $(as-path) : less ] {
+ for local file in [ sequence.insertion-sort $(as-path) : less ]
+ {
         local output_filename = [ path.relative-to [ path.make $(here)/../../.. ] $(file) ] ;
         local base_filename = [ path.basename $(file) ] ;
         local base_unit = [ regex.replace $(base_filename) "\\.hpp" "" ] ;
- if $(base_filename) in $(duplicated) {
+ if $(base_filename) in $(duplicated)
+ {
             # tack the directory name onto the end
             local dir-name = [ path.basename [ path.parent $(file) ] ] ;
             base_unit = "$(base_unit) ($(dir-name))" ;
         }
-# this looks better, but it won't work until my boostbook patch for
-# annotation.xsl gets applied.
-# print.text "[headerref $(output_filename) $(base_unit)]\\n" : overwrite ;
+ # this looks better, but it won't work until my boostbook patch for
+ # annotation.xsl gets applied.
+ # print.text "[headerref $(output_filename) $(base_unit)]\\n" : overwrite ;
         print.text "[headerref $(output_filename)]\\n" : overwrite ;
     }
 }

Modified: trunk/libs/units/example/Jamfile.v2
==============================================================================
--- trunk/libs/units/example/Jamfile.v2 (original)
+++ trunk/libs/units/example/Jamfile.v2 2008-11-28 16:16:48 EST (Fri, 28 Nov 2008)
@@ -1,32 +1,25 @@
 # Jamfile.v2
 #
-# Copyright (c) 2007
+# Copyright (c) 2007-2008
 # Steven Watanabe
 #
 # Distributed under the Boost Software License, Version 1.0. (See
-# accomanying file LICENSE_1_0.txt or copy at
+# accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt
 
 import testing ;
 import path ;
 
-project units_examples :
+project boost/units/example :
   : requirements <include>$(BOOST_ROOT) <include>../../.. <warnings>all
 ;
 
-rule make_tests ( files * ) {
- local results = ;
- for local file in $(files) {
- results += [ run $(file) : : : ] ;
- }
-}
+files = [ path.glob . : *.cpp : performance.* runtime_unit.* ] ;
 
+for local file in $(files)
 {
- test-suite units
- :
- [ make_tests [ path.glob . : *.cpp : performance.* runtime_unit.* ] ]
- [ compile performance.cpp ]
- [ run runtime_unit.cpp : <runtime_unit_input.txt : : ]
- ;
-
+ run $(file) ;
 }
+
+compile performance.cpp ;
+run runtime_unit.cpp : <runtime_unit_input.txt ;

Modified: trunk/libs/units/test/Jamfile.v2
==============================================================================
--- trunk/libs/units/test/Jamfile.v2 (original)
+++ trunk/libs/units/test/Jamfile.v2 2008-11-28 16:16:48 EST (Fri, 28 Nov 2008)
@@ -4,70 +4,57 @@
 # Steven Watanabe
 #
 # Distributed under the Boost Software License, Version 1.0. (See
-# accomanying file LICENSE_1_0.txt or copy at
+# accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt
 
-project units_test :
+project boost/units/test :
     requirements <include>$(BOOST_ROOT) <include>../../.. <toolset>msvc:<asynch-exceptions>on
 ;
 
-check-conversion-dependencies = [ path.glob-tree ../../../boost/units/systems/base_units : *.hpp ] ;
-checklibs =
- $(BOOST_ROOT)/libs/regex/build//boost_regex
- $(BOOST_ROOT)/libs/filesystem/build//boost_filesystem
- $(BOOST_ROOT)/libs/system/build//boost_system
-;
-
 import testing ;
 
 alias test_framework : $(BOOST_ROOT)/libs/test/build//boost_unit_test_framework ;
-#alias test_minimal : $(BOOST_ROOT)/libs/test/build//minimal ;
-
-{
- test-suite units
- :
- [ compile test_predicates.cpp : : ]
- [ compile test_negative_denominator.cpp : : ]
- [ compile test_dimensionless_ice1.cpp : : ]
- [ compile test_dimensionless_ice2.cpp : : ]
- [ compile test_mixed_value_types.cpp : : ]
- [ compile test_complicated_system.cpp : : ]
- [ compile test_reduce_unit.cpp ]
- [ run test_dimensionless_quantity.cpp : : : : ]
- [ run test_implicit_conversion.cpp : : : : ]
- [ run test_quantity.cpp : : : : ]
- [ run test_unit.cpp : : : : ]
- [ run test_conversion.cpp : : : : ]
- [ run test_base_dimension.cpp : : : : ]
- [ run test_absolute.cpp : : : : ]
- [ run test_default_conversion.cpp : : : : ]
- [ run test_cmath.cpp : : : : ]
- [ run test_limits.cpp : : : : ]
- [ run test_custom_unit.cpp : : : : ]
- [ run test_scaled_conversion.cpp : : : : ]
- [ run test_lambda.cpp : : : : ]
- [ run test_scaled_unit.cpp test_framework : : : : ]
-# [ run check_conversion_defs.cpp $(checklibs) : : : <dependency>$(check-conversion-dependencies) : ]
- [ compile-fail fail_implicit_conversion.cpp : : ]
- [ compile-fail fail_quantity_construct.cpp : : ]
- [ compile-fail fail_quantity_assign.cpp : : ]
- [ compile-fail fail_quantity_add.cpp : : ]
- [ compile-fail fail_quantity_subtract.cpp : : ]
- [ compile-fail fail_quantity_add_assign.cpp : : ]
- [ compile-fail fail_quantity_sub_assign.cpp : : ]
- [ compile-fail fail_quantity_scalar_add.cpp : : ]
- [ compile-fail fail_quantity_scalar_sub.cpp : : ]
- [ compile-fail fail_quantity_unit_add.cpp : : ]
- [ compile-fail fail_quantity_unit_subtract.cpp : : ]
- [ compile-fail fail_scalar_quantity_add.cpp : : ]
- [ compile-fail fail_scalar_quantity_sub.cpp : : ]
- [ compile-fail fail_unit_quantity_add.cpp : : ]
- [ compile-fail fail_unit_quantity_subtract.cpp : : ]
- [ compile-fail fail_adl_detail.cpp : : ]
- [ compile-fail fail_heterogeneous_unit.cpp : : ]
- [ compile-fail fail_base_dimension.cpp : : ]
- [ compile-fail fail_add_temperature.cpp : : ]
- [ compile-fail fail_quantity_non_unit.cpp : : ]
- ;
 
-}
+compile test_predicates.cpp ;
+compile test_negative_denominator.cpp ;
+compile test_dimensionless_ice1.cpp ;
+compile test_dimensionless_ice2.cpp ;
+compile test_mixed_value_types.cpp ;
+compile test_complicated_system.cpp ;
+compile test_reduce_unit.cpp ;
+
+run test_dimensionless_quantity.cpp ;
+run test_implicit_conversion.cpp ;
+run test_quantity.cpp ;
+run test_unit.cpp ;
+run test_conversion.cpp ;
+run test_base_dimension.cpp ;
+run test_absolute.cpp ;
+run test_default_conversion.cpp ;
+run test_cmath.cpp ;
+run test_limits.cpp ;
+run test_custom_unit.cpp ;
+run test_scaled_conversion.cpp ;
+run test_lambda.cpp ;
+run test_scaled_unit.cpp test_framework ;
+
+compile-fail fail_implicit_conversion.cpp ;
+compile-fail fail_quantity_construct.cpp ;
+compile-fail fail_quantity_assign.cpp ;
+compile-fail fail_quantity_add.cpp ;
+compile-fail fail_quantity_subtract.cpp ;
+compile-fail fail_quantity_add_assign.cpp ;
+compile-fail fail_quantity_sub_assign.cpp ;
+compile-fail fail_quantity_scalar_add.cpp ;
+compile-fail fail_quantity_scalar_sub.cpp ;
+compile-fail fail_quantity_unit_add.cpp ;
+compile-fail fail_quantity_unit_subtract.cpp ;
+compile-fail fail_scalar_quantity_add.cpp ;
+compile-fail fail_scalar_quantity_sub.cpp ;
+compile-fail fail_unit_quantity_add.cpp ;
+compile-fail fail_unit_quantity_subtract.cpp ;
+compile-fail fail_adl_detail.cpp ;
+compile-fail fail_heterogeneous_unit.cpp ;
+compile-fail fail_base_dimension.cpp ;
+compile-fail fail_add_temperature.cpp ;
+compile-fail fail_quantity_non_unit.cpp ;

Modified: trunk/libs/units/test_headers/Jamfile.v2
==============================================================================
--- trunk/libs/units/test_headers/Jamfile.v2 (original)
+++ trunk/libs/units/test_headers/Jamfile.v2 2008-11-28 16:16:48 EST (Fri, 28 Nov 2008)
@@ -4,7 +4,7 @@
 # Steven Watanabe
 #
 # Distributed under the Boost Software License, Version 1.0. (See
-# accomanying file LICENSE_1_0.txt or copy at
+# accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt
 
 import testing ;
@@ -12,32 +12,28 @@
 import regex ;
 import print ;
 
-project test_headers :
+project boost/units/test_headers :
     requirements <include>$(BOOST_ROOT) <include>../../..
 ;
 
 headers = [ path.glob-tree ../../../boost/units : *.hpp : detail ] ;
 
-rule setup ( ) {
- for local file in $(headers) {
-
- result += [ compile test.cpp :
- <define>BOOST_UNITS_HEADER_NAME=$(file)
- <dependency>$(file)
- :
- [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ] ;
-
- }
- return $(result) ;
+for local file in $(headers)
+{
+ compile test.cpp
+ : # requirements
+ <define>BOOST_UNITS_HEADER_NAME=$(file)
+ <dependency>$(file)
+ : # test name
+ [ regex.replace [ path.relative-to ../../.. $(file) ] "/" "_" ] ;
 }
 
-tests = [ setup ] ;
-
-rule generate-include-all ( target : sources * : properties * ) {
-
+rule generate-include-all ( target : sources * : properties * )
+{
     print.output $(target) ;
 
- for local file in $(sources) {
+ for local file in $(sources)
+ {
         print.text "#include <$(file:G=)>
 " : overwrite ;
     }
@@ -47,10 +43,5 @@
 make include_all1.cpp : $(headers) : @generate-include-all ;
 make include_all2.cpp : $(headers) : @generate-include-all ;
 
-import testing ;
-
-test-suite units_headers :
- $(tests)
 # this ought to catch non-inlined functions and other duplicate definitions
- [ link include_all1.cpp include_all2.cpp main.cpp : <include>. : include_all_headers ]
- ;
+link include_all1.cpp include_all2.cpp main.cpp : <include>. : include_all_headers ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk