Added conditional temmies support
This commit is contained in:
parent
673d0297aa
commit
8d42484863
12
ucompile
12
ucompile
@ -25,6 +25,7 @@ def run_input_cases(program, args):
|
||||
|
||||
input_files = sorted(glob(os.path.join(tests_dir, "*.in")), key=os.path.getmtime)
|
||||
|
||||
passed = True
|
||||
if len(input_files) < 1:
|
||||
if time_flag:
|
||||
start_time = time.perf_counter()
|
||||
@ -96,6 +97,7 @@ def run_input_cases(program, args):
|
||||
if program_output == expected_output:
|
||||
print("✅")
|
||||
else:
|
||||
passed = False
|
||||
print("❌")
|
||||
# green expected output and red program output
|
||||
print(f"{Fore.GREEN}Expected output:{Style.RESET_ALL}")
|
||||
@ -118,7 +120,7 @@ def run_input_cases(program, args):
|
||||
print(f"⏳: {elapsed_time:.4f} s")
|
||||
|
||||
print("-----------")
|
||||
return
|
||||
return failed
|
||||
|
||||
|
||||
def python_compile(file_name, args):
|
||||
@ -213,7 +215,13 @@ def main():
|
||||
|
||||
args.tests_dir = args.tests if args.tests else "."
|
||||
|
||||
SUPPORTED_LANGS[file_ext](file_name, args)
|
||||
if not SUPPORTED_LANGS[file_ext](file_name, args) # don't do submit dialogue if failed
|
||||
return
|
||||
|
||||
temmies_check = os.path.join(os.path.dirname(file_name), ".temmies")
|
||||
if os.path.exists(temmies_check):
|
||||
if input("Would you like to submit? (y/N): ") == "y":
|
||||
os.system("temmies submit")
|
||||
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user