Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Adrian Mariano 2021-10-28 16:51:59 -04:00
commit e7d07da426
2 changed files with 9 additions and 6 deletions

View file

@ -321,7 +321,7 @@ function submatrix_set(M,A,m=0,n=0) =
// Description:
// Constructs a matrix by horizontally "stacking" together compatible matrices or vectors. Vectors are treated as columsn in the stack.
// This command is the inverse of `column`. Note: strings given in vectors are broken apart into lists of characters. Strings given
// in matrices are preserved as strings. If you need to combine vectors of strings use {{list_to_matrix}} as shown below to convert the
// in matrices are preserved as strings. If you need to combine vectors of strings use {{list_to_matrix()}} as shown below to convert the
// vector into a column matrix. Also note that vertical stacking can be done directly with concat.
// Arguments:
// M1 = If given with other arguments, the first matrix (or vector) to stack. If given alone, a list of matrices/vectors to stack.

View file

@ -14,24 +14,27 @@ for filename in os.listdir("."):
if funcname.startswith("_"):
continue
if funcname in funcs:
print("WARNING!!! Function {} re-defined at {}:{}".format(funcname, filename, linenum));
print("WARNING!!! Function {} re-defined at {}:{}".format(funcname, filename, linenum+1));
print(" Previously defined at {}:{}".format(*funcs[funcname]));
else:
funcs[funcname] = (filename, linenum)
funcs[funcname] = (filename, linenum+1)
covered = []
covered = {}
uncovered = funcs.copy()
for filename in os.listdir("tests"):
if filename.startswith("test_") and filename.endswith(".scad"):
filepath = os.path.join("tests",filename)
with open(filepath, "r") as f:
for line in f.readlines():
for linenum,line in enumerate(f.readlines()):
if line.startswith("module "):
testmodule = line[7:].strip().split("(")[0].strip()
if testmodule.startswith("test_"):
funcname = testmodule.split("_",1)[1]
if funcname in uncovered:
covered.append(funcname)
if filename != "test_" + uncovered[funcname][0]:
print("WARNING!!! Function {} defined at {}:{}".format(funcname, *uncovered[funcname]));
print(" but tested at {}:{}".format(filename, linenum+1));
covered[funcname] = (filename,linenum+1)
del uncovered[funcname]
uncovered_by_file = {}