Skip to content

Commit

Permalink
change the defaults of input directories to restore current behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
krohmerNV committed Aug 16, 2024
1 parent 6c96ca8 commit dfd38f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion python/MaterialXTest/tests_to_html.bat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python tests_to_html.py -i1 ../../build
@echo off
python tests_to_html.py -i1 ../../build %*
10 changes: 5 additions & 5 deletions python/MaterialXTest/tests_to_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def main(args=None):

parser = argparse.ArgumentParser()
parser.add_argument('-i1', '--inputdir1', dest='inputdir1', action='store', help='Input directory', default=".")
parser.add_argument('-i2', '--inputdir2', dest='inputdir2', action='store', help='Second input directory', default=".")
parser.add_argument('-i3', '--inputdir3', dest='inputdir3', action='store', help='Third input directory', default=".")
parser.add_argument('-i2', '--inputdir2', dest='inputdir2', action='store', help='Second input directory', default="")
parser.add_argument('-i3', '--inputdir3', dest='inputdir3', action='store', help='Third input directory', default="")
parser.add_argument('-o', '--outputfile', dest='outputfile', action='store', help='Output file name', default="tests.html")
parser.add_argument('-d', '--diff', dest='CREATE_DIFF', action='store_true', help='Perform image diff', default=False)
parser.add_argument('-t', '--timestamp', dest='ENABLE_TIMESTAMPS', action='store_true', help='Write image timestamps', default=False)
Expand Down Expand Up @@ -68,10 +68,10 @@ def main(args=None):
fh.write("</style>")
fh.write("<body>\n")
dir1 = os.getcwd() if args.inputdir1 == "." else args.inputdir1
dir2 = os.getcwd() if args.inputdir2 == "." else args.inputdir2
dir3 = os.getcwd() if args.inputdir3 == "." else args.inputdir3
dir2 = dir1 if args.inputdir2 == "" else args.inputdir2 # if '--inputdir2' is not set, use the same as '--inputdir1'
dir3 = dir1 if args.inputdir3 == "" else args.inputdir3 # if '--inputdir3' is not set, use the same as '--inputdir1'

useThirdLang = True if args.lang3 and (args.inputdir1 != args.inputdir3 or args.lang1 != args.lang3) else False
useThirdLang = args.lang3 # if there is a third language specified, enable 3-way comparison

if useThirdLang:
fh.write("<h3>" + args.lang1 + " (in: " + dir1 + ") vs " + args.lang2 + " (in: " + dir2 + ") vs " + args.lang3 + " (in: " + dir3 + ")</h3>\n")
Expand Down

0 comments on commit dfd38f1

Please sign in to comment.