| """Provides common functionality to the test scripts.""" |
| """Checks whether the source file exists and returns its path.""" |
| if not Path(source).is_file(): |
| def set_executable(executable): |
| """Checks whether a Flang executable has been set and returns its path.""" |
| flang_fc1 = Path(executable) |
| if not flang_fc1.is_file(): |
| """Sets a temporary directory or creates one if it doesn't exist.""" |
| os.makedirs(Path(tmp), exist_ok=True) |
| """Used in other functions.""" |
| print(f"{sys.argv[0]}: FAIL") |
| print(f"{sys.argv[0]}: File not found: {file}") |
| """Verifies that 2 arguments have been passed.""" |
| print(f"Usage: {args[0]} <fortran-source> <flang-command>") |
| def check_args_long(args): |
| """Verifies that 3 arguments have been passed.""" |
| print(f"Usage: {args[0]} <fortran-source> <temp-test-dir> <flang-command>") |