mirror of
https://github.com/boostorg/build.git
synced 2026-02-12 12:02:24 +00:00
Updated test to use generic print rules instead of dump rule. And therefore removed dump rule.
[SVN r13667]
This commit is contained in:
@@ -161,45 +161,6 @@ rule module-name ( jamfile-location )
|
||||
return Jamfile<$(jamfile-location)> ;
|
||||
}
|
||||
|
||||
#
|
||||
# Output a human readable description of the project structure.
|
||||
#
|
||||
rule dump ( )
|
||||
{
|
||||
# Sort projects so that output is independent of order. It is
|
||||
# needed to allow tests to works despite possible change in
|
||||
# project inclusion order.
|
||||
local projects = [ sequence.insertion-sort $(.projects) ] ;
|
||||
|
||||
ECHO "Projects structure dump" ;
|
||||
ECHO "" ;
|
||||
for local i in $(projects) {
|
||||
ECHO " Location: $(i)" ;
|
||||
local module-name = [ module-name $(i) ] ;
|
||||
local id = [ $(module-name).id ] ;
|
||||
id ?= "(none)" ;
|
||||
ECHO " Project id: $(id)" ;
|
||||
ECHO "" ;
|
||||
|
||||
local project-root = [ $(module-name).project-root ] ;
|
||||
local parent = [ $(module-name).parent ] ;
|
||||
parent ?= none ;
|
||||
local requirements = [ $(module-name).requirements ] ;
|
||||
local default-build = [ $(module-name).default-build ] ;
|
||||
local source-location = [ $(module-name).source-location ] ;
|
||||
local subincludes = [ $(module-name).subincludes ] ;
|
||||
subincludes = [ sequence.insertion-sort $(subincludes) ] ;
|
||||
ECHO " Project root: $(project-root)" ;
|
||||
ECHO " Parent project: $(parent)" ;
|
||||
ECHO " Requirements:" $(requirements) ;
|
||||
ECHO " Default build:" $(default-build) ;
|
||||
ECHO " Source location:" $(source-location) ;
|
||||
ECHO " Subincludes:" $(subincludes) ;
|
||||
|
||||
ECHO "" ;
|
||||
}
|
||||
}
|
||||
|
||||
# Default patterns to search for the Jamfiles to use for build
|
||||
# declarations.
|
||||
#
|
||||
@@ -429,10 +390,12 @@ module project-rules {
|
||||
import sequence ;
|
||||
import print ;
|
||||
|
||||
print.section "'"$(__id__)"'" ;
|
||||
local id = [ id ] ; id ?= (none) ;
|
||||
local parent = [ parent ] ; parent ?= (none) ;
|
||||
print.section "'"$(id)"'" ;
|
||||
print.list-start ;
|
||||
print.list-item "Project root:" [ project-root ] ;
|
||||
print.list-item "Parent project:" [ parent ] ;
|
||||
print.list-item "Parent project:" $(parent) ;
|
||||
print.list-item "Requirements:" [ requirements ] ;
|
||||
print.list-item "Default build:" [ default-build ] ;
|
||||
print.list-item "Source location:" [ source-location ] ;
|
||||
|
||||
@@ -21,7 +21,7 @@ IMPORT $(__name__) : exe : : exe ;
|
||||
|
||||
project.load project-test1 ;
|
||||
|
||||
project.dump ;
|
||||
project-root.print ;
|
||||
|
||||
assert.result project-test1/dir2 : project.lookup @/cool-library : "." ;
|
||||
assert.result project-test1/dir2 : project.lookup project-test1@/cool-library : "." ;
|
||||
|
||||
@@ -9,38 +9,47 @@ t = Tester()
|
||||
|
||||
os.chdir(t.original_workdir)
|
||||
|
||||
expected_output="""Projects structure dump
|
||||
|
||||
Location: project-test1
|
||||
Project id: /boost-build-test-project-1
|
||||
|
||||
Project root: project-test1
|
||||
Parent project: none
|
||||
Requirements: <threading>multi <include>/home/ghost/local/include
|
||||
Default build: debug
|
||||
Source location: project-test1
|
||||
Subincludes: dir dir2
|
||||
|
||||
Location: project-test1/dir
|
||||
Project id: /boost-build-test-project-1/dir
|
||||
|
||||
Project root: project-test1
|
||||
Parent project: project-test1
|
||||
Requirements: <threading>multi <include>/home/ghost/local/include
|
||||
Default build: release
|
||||
Source location: project-test1/dir/src
|
||||
Subincludes:
|
||||
|
||||
Location: project-test1/dir2
|
||||
Project id: /cool-library
|
||||
|
||||
Project root: project-test1/dir2
|
||||
Parent project: none
|
||||
Requirements: <include>/home/ghost/build/boost-cvs
|
||||
Default build: debug
|
||||
Source location: project-test1/dir2
|
||||
Subincludes:
|
||||
|
||||
expected_output="""Project Roots:
|
||||
|
||||
'project-test1/dir2':
|
||||
|
||||
Module for project-root is 'project-root<project-test1/dir2>'
|
||||
|
||||
Projects:
|
||||
|
||||
'/cool-library':
|
||||
|
||||
* Project root: project-test1/dir2
|
||||
* Parent project: (none)
|
||||
* Requirements: <include>/home/ghost/build/boost-cvs
|
||||
* Default build: debug
|
||||
* Source location: project-test1/dir2
|
||||
* Subincludes:
|
||||
|
||||
'project-test1':
|
||||
|
||||
Module for project-root is 'project-root<project-test1>'
|
||||
|
||||
Projects:
|
||||
|
||||
'/boost-build-test-project-1/dir':
|
||||
|
||||
* Project root: project-test1
|
||||
* Parent project: project-test1
|
||||
* Requirements: <threading>multi <include>/home/ghost/local/include
|
||||
* Default build: release
|
||||
* Source location: project-test1/dir/src
|
||||
* Subincludes:
|
||||
|
||||
'/boost-build-test-project-1':
|
||||
|
||||
* Project root: project-test1
|
||||
* Parent project: (none)
|
||||
* Requirements: <threading>multi <include>/home/ghost/local/include
|
||||
* Default build: debug
|
||||
* Source location: project-test1
|
||||
* Subincludes: dir dir2
|
||||
|
||||
"""
|
||||
|
||||
t.run_build_system("--build-system=project-test1", stdout=expected_output)
|
||||
|
||||
Reference in New Issue
Block a user