with open(f, "w") as file:
pass
# NOTE: Why do we need to log this?
- # logger.info("Created empty {self.name}.{name}.expected")
+ # logger.info(f"Created empty {self.name}.{name}.expected")
return ""
else:
with open(f, "r") as file:
m = ''
if res.stderr:
m += f"{res.stderr}"
- logger.error("[FAILED] {m}")
+ logger.error(f"[FAILED] {m}")
if stop_on_error: exit(1)
else: continue
o = True
if not o: print('')
- print(f"Build {passing_tests_count}/{total_tests_count} tests")
elif subcmd == "run":
check_crucial_envvar(RUN_CMD, "RUN_CMD")
cprint('green', 'default', f'----- [RUN] -----')
# vlog(verbose_output, f"[CMD] {cmd}")
res = subprocess.run(cmd, capture_output = True, text = True)
except Exception as e:
- logger.error("Failed to run ./{test_name}: {e}")
+ logger.error(f"Failed to run ./{test_name}: {e}")
if stop_on_error: exit(1)
else: continue
passing_tests_count += 1
cprint('green', 'default', '[PASS]')
- cprint("green", "default", f"PASSED {passing_tests_count}/{total_tests_count}")
+ cprint(f"green", "default", f"PASSED {passing_tests_count}/{total_tests_count}")
elif subcmd == "record":
check_crucial_envvar(RUN_CMD, "RUN_CMD")
print(f'----- [RECORD] -----')
for test_name in tests:
- cprint("green", "default", f"+ Recording expected behaviour for '{test_name}'...")
+ cprint(f"green", "default", f"+ Recording expected behaviour for '{test_name}'...")
test = tests[test_name]
cmd = shlex.split(get_cmd_substituted(RUN_CMD, tests, test_name))
check_crucial_envvar(BUILD_CMD, "BUILD_CMD")
cprint("green", "default", f'----- [RECORD_BUILD] -----')
for test_name in tests:
- cprint("green", "default", f"+ Recording expected build behaviour for '{test_name}'...")
+ cprint(f"green", "default", f"+ Recording expected build behaviour for '{test_name}'...")
test = tests[test_name]
if len(test.build_stdin) > 0:
- logger.info("Test already has build_input '{test.build_stdin}'...")
+ logger.info(f"Test already has build_input '{test.build_stdin}'...")
ans = input("Do you want to change the build_input? [y/N]")
if ans.lower() == 'y':
test.build_stdin = input("What is the input passed? ")
cprint('yellow', 'default', '[SKIP]')
else:
- logger.error("Invalid subcommand '{subcmd}'")
+ logger.error(f"Invalid subcommand '{subcmd}'")
exit(1)
if __name__ == "__main__":