Test Boost Build user configuration handling. Both relative and absolute path handling is tested.
()
| 22 | ############################################################################### |
| 23 | |
| 24 | def test_user_configuration(): |
| 25 | """ |
| 26 | Test Boost Build user configuration handling. Both relative and absolute |
| 27 | path handling is tested. |
| 28 | |
| 29 | """ |
| 30 | |
| 31 | implicitConfigLoadMessage = \ |
| 32 | "notice: Loading user-config configuration file: *" |
| 33 | explicitConfigLoadMessage = \ |
| 34 | "notice: Loading explicitly specified user configuration file:" |
| 35 | disabledConfigLoadMessage = \ |
| 36 | "notice: User configuration file loading explicitly disabled." |
| 37 | testMessage = "_!_!_!_!_!_!_!_!_ %s _!_!_!_!_!_!_!_!_" |
| 38 | toolsetName = "__myDummyToolset__" |
| 39 | subdirName = "ASubDirectory" |
| 40 | configFileNames = ["ups_lala_1.jam", "ups_lala_2.jam", |
| 41 | os.path.join(subdirName, "ups_lala_3.jam")] |
| 42 | |
| 43 | t = BoostBuild.Tester(["toolset=%s" % toolsetName, |
| 44 | "--debug-configuration"], pass_toolset=False, use_test_config=False) |
| 45 | |
| 46 | for configFileName in configFileNames: |
| 47 | message = "ECHO \"%s\" ;" % testMessage % configFileName |
| 48 | # We need to double any backslashes in the message or Jam will |
| 49 | # interpret them as escape characters. |
| 50 | t.write(configFileName, message.replace("\\", "\\\\")) |
| 51 | |
| 52 | # Prepare a dummy toolset so we do not get errors in case the default one |
| 53 | # is not found. |
| 54 | t.write(toolsetName + ".jam", """\ |
| 55 | import feature ; |
| 56 | feature.extend toolset : %s ; |
| 57 | rule init ( ) { } |
| 58 | """ % toolsetName) |
| 59 | |
| 60 | # Python version of the same dummy toolset. |
| 61 | t.write(toolsetName + ".py", """\ |
| 62 | from b2.build import feature |
| 63 | feature.extend('toolset', ['%s']) |
| 64 | def init(): pass |
| 65 | """ % toolsetName) |
| 66 | |
| 67 | t.write("jamroot.jam", """\ |
| 68 | local test-index = [ MATCH ---test-id---=(.*) : [ modules.peek : ARGV ] ] ; |
| 69 | ECHO test-index: $(test-index:E=(unknown)) ; |
| 70 | """) |
| 71 | |
| 72 | class LocalTester: |
| 73 | def __init__(self, tester): |
| 74 | self.__tester = tester |
| 75 | self.__test_ids = [] |
| 76 | |
| 77 | def __assertionFailure(self, message): |
| 78 | BoostBuild.annotation("failure", "Internal test assertion failure " |
| 79 | "- %s" % message) |
| 80 | self.__tester.fail_test(1) |
| 81 |
no test coverage detected