Conversation
…IN for compilation.
… it causes severe headaches.
…ork with directories with subdirs.
…ut parameter so binary compilations don't hang forever and working on building out the final summary output.
…ish binary exit codes.
…eld in the summary table that enumerates the number of cases that failed to build due to lack of C++ support.
| root_dir = str(Path(__file__).parent) | ||
|
|
||
|
|
||
| # Data type packages testname, testnumber, and exitcode (pass, fail, or exception) |
There was a problem hiding this comment.
The comment explains exit code could be one of three things (pass, fail, or exception), but the type of exit code is "int" and the definition of Result does not explain the mapping of these three cases.
Maybe a comment above exit_code?
Even better would be encoding the three cases into the type system somehow... an outcome field with an enum type or subclasses of Result that add additional metadata for each case?
|
|
||
| else: |
There was a problem hiding this comment.
Suggest the early exit pattern here.
Put "continue" at the end of the if, then remove the else and move the rest of the function back one level of indentation.
Once you get to the failed to compile state, there is nothing left to do in this iteration of the loop
| elif executed_binary.returncode == 0: | ||
| incorrect_exit_code += 1 |
There was a problem hiding this comment.
What happens is the return code is something other than 0, 3, or -11? Shouldn't we account for that possibility as well?
| if use_cpp: | ||
| failed_to_compile_cpp_build += 1 |
There was a problem hiding this comment.
Shouldn't you use this failed_to_compile_cpp counter if the compiler exits with a non-zero code?
| elif executed_binary.returncode == 0: | ||
| incorrect_exit_code += 1 | ||
|
|
||
| except Exception as e: |
There was a problem hiding this comment.
If you used the check=True option on subprocess.run(compile_cmd...) then you could share this error handling code.
check=True turns process.returncode == 0 into an exception.
…iet_testsuite_root_dir name.
…ching_file_contents.
…t Python to report errors explicitly when opening files.
…cture in testCwe function.
…to reflect usage of variable in script. Also updated comment to reflect better description.
… a program fails to compile we want to record the exit code and move onto the next iteration of the loop.
…ion enters a failed state.
…pendent on anything in the resolve repo at this point.
…his function used to look for matches agains the specified pattern AND search the function for a function name.
No description provided.