@@ -2008,6 +2008,15 @@ def print_tests(tests, format="list", sort=True):
2008
2008
print "Unknown format '%s'" % format
2009
2009
sys .exit (1 )
2010
2010
2011
+ def norm_relative_path (path , start ):
2012
+ """This function will create a normalized, relative path. It mimics the
2013
+ python os.path.relpath function, but also normalizes a Windows-syle path
2014
+ that use backslashes to a Unix style path that uses forward slashes."""
2015
+ path = os .path .normpath (path )
2016
+ path = os .path .relpath (path , start )
2017
+ path = path .replace ("\\ " , "/" )
2018
+ return path
2019
+
2011
2020
def build_tests (tests , base_source_paths , build_path , target , toolchain_name ,
2012
2021
options = None , clean = False , notify = None , verbose = False , jobs = 1 ,
2013
2022
macros = None , silent = False , report = None , properties = None ,
@@ -2018,10 +2027,14 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
2018
2027
Returns a tuple of the build result (True or False) followed by the test
2019
2028
build data structure"""
2020
2029
2030
+ execution_directory = "."
2031
+
2032
+ base_path = norm_relative_path (build_path , execution_directory )
2033
+
2021
2034
test_build = {
2022
2035
"platform" : target .name ,
2023
2036
"toolchain" : toolchain_name ,
2024
- "base_path" : build_path ,
2037
+ "base_path" : base_path ,
2025
2038
"baud_rate" : 9600 ,
2026
2039
"binary_type" : "bootable" ,
2027
2040
"tests" : {}
@@ -2060,7 +2073,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
2060
2073
2061
2074
# Normalize the path
2062
2075
if bin_file :
2063
- bin_file = os . path . normpath (bin_file )
2076
+ bin_file = norm_relative_path (bin_file , execution_directory )
2064
2077
2065
2078
test_build ['tests' ][test_name ] = {
2066
2079
"binaries" : [
0 commit comments