From e69379b38de84c798f11bc27f56e582aa2e85bae Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Sun, 10 Dec 2017 12:46:51 +0900 Subject: [PATCH] did small cleanup and added 2 test cases from GitHub issues --- open_fortran_parser/main.py | 3 ++- test/examples/problematic_write.f90 | 7 +++++++ test/examples/simple_if.f90 | 8 ++++++++ test/test_parser_wrapper.py | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 test/examples/problematic_write.f90 create mode 100644 test/examples/simple_if.f90 diff --git a/open_fortran_parser/main.py b/open_fortran_parser/main.py index a17bdc2..10513a5 100644 --- a/open_fortran_parser/main.py +++ b/open_fortran_parser/main.py @@ -56,7 +56,8 @@ def main(args=None, namespace=None): return if args.cleanup_dependencies: - cleanup_old_dependencies(OUTDATED_DEPENDENCIES, DEPENDENCIES_PATH) + cleanup_old_dependencies(OUTDATED_DEPENDENCIES, DEV_DEPENDENCIES_PATH) + return if not args.input: parser.print_help(sys.stderr) diff --git a/test/examples/problematic_write.f90 b/test/examples/problematic_write.f90 new file mode 100644 index 0000000..0537dc5 --- /dev/null +++ b/test/examples/problematic_write.f90 @@ -0,0 +1,7 @@ + +PROGRAM problematic_if + +! IF (printlev_loc >=2) WRITE(numout,*),'tau_outflow, coeff_rel = ', tau_outflow, coeff_rel + IF (printlev_loc >=2) WRITE(numout,*) 'tau_outflow, coeff_rel = ', tau_outflow, coeff_rel + +END diff --git a/test/examples/simple_if.f90 b/test/examples/simple_if.f90 new file mode 100644 index 0000000..253c70e --- /dev/null +++ b/test/examples/simple_if.f90 @@ -0,0 +1,8 @@ + +PROGRAM simple_if + +IF (map_pft_format .AND. .NOT. impveg) THEN + CONTINUE +ENDIF + +END diff --git a/test/test_parser_wrapper.py b/test/test_parser_wrapper.py index c2e550f..f1e1bae 100644 --- a/test/test_parser_wrapper.py +++ b/test/test_parser_wrapper.py @@ -88,7 +88,7 @@ def test_generate_xml(self): with self.subTest(input_path=input_path, verbosity=verbosity): output_path = pathlib.Path(results_path, input_path.name + '.xml') process = execute_parser(input_path, output_path, verbosity) - self.assertEqual(process.returncode, 0) + self.assertEqual(process.returncode, 0, process) self.assertTrue(output_path.exists()) @unittest.skipUnless(os.environ.get('TEST_LONG'), 'skipping long test')