Skip to content

Commit 6766f8b

Browse files
committed
Modified command line arguments
1 parent e25f7f7 commit 6766f8b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test_all_solutions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,14 @@ def test_all_solutions(directory_name, compiler_name, expected_solutions):
2929

3030
print("\nThe following files were found: ")
3131

32-
for file in files:
33-
print(file)
32+
print(*files, sep = "\n")
3433

3534
print("\n")
3635

3736
try:
3837
dir_util.copy_tree(directory_name + "/data/", "./data/") # Copy the data folder that some solutions need
3938
except dir_util.DistutilsFileError:
40-
print(color_string(colors.WARNING, "The data folder was unable to be copied from " + directory_name + " to ./data!\nSome solutions may not be able to compile!\n"))
39+
print(color_string(colors.WARNING, "The data folder was unable to be copied from " + directory_name + "/solutions to ./data!\nSome solutions may not be able to compile!\n"))
4140

4241
passed_tests = 0
4342

@@ -104,16 +103,15 @@ def test_all_solutions(directory_name, compiler_name, expected_solutions):
104103
for line in expected_solutions_file:
105104
key_value_pair = line.split(" ")
106105
if len(key_value_pair) == 2 and key_value_pair[1].strip().isdigit(): # Extract all expected solutions; ignore bad entries
107-
print("Got here")
108106
expected_solutions[key_value_pair[0]] = int(key_value_pair[1])
109107
except IOError:
110108
print("Unable to open file './expected_solutions.txt'! Please check that the file is located in the current working directory!")
111109

112110
if len(sys.argv) != 3:
113111
print("Error: Missing operands!")
114-
print("Usage: " + sys.argv[0] + " path/to/problems compiler-name")
112+
print("Usage: " + sys.argv[0] + " repository-root compiler-name")
115113
sys.exit(1)
116114
elif not os.path.exists(sys.argv[1]):
117115
print("Error: Path " + sys.argv[1] + " does not exist!")
118116
else:
119-
sys.exit(test_all_solutions(sys.argv[1], sys.argv[2], expected_solutions))
117+
sys.exit(test_all_solutions(sys.argv[1] + "/solutions", sys.argv[2], expected_solutions))

0 commit comments

Comments
 (0)