[Chapel Merge] A lot of the dyno resolution tests use the same co

Branch: refs/heads/main
Revision: 0c1f82b
Author: DanilaFe
Link: Factor common code from dyno resolution tests by DanilaFe · Pull Request #20201 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #20201 from DanilaFe/factor-dyno-tests

A lot of the dyno resolution tests use the same common functions, such as parseModule.
However, each test file includes its own copy of these functions, which leads to a lot of
duplication, and introduces the possibility of these functions going out of sync. If possible,
we'd like to avoid this.

This PR introduces a new library target / object file that contains common functions
intended to be shared among all dyno tests. This new library is linked with all tests, and
thus allows them to share common code. Here's a summary of the changes:

  1. The CMake function comp_unit_test is pushed into dyno/tests/CMakeLists.txt from
    dyno/CMakeLists.txt. It seemed cleaner to introduce the new "common test code"
    library in dyno/tests, and then refer to it in the same place from inside
    comp_unit_test. The existing tests target is also pushed to the subdirectory.
  2. The parseModule, parseTypeOfX and parseTypeOfXInit functions are moved
    into new common.{h, cpp} files. The parseTypeOfX function is different across some
    tests (which seems to me like a good reason to have a "canonical" place for these things);
    the two versions are renamed to parseTypeOfX (version returning Type*) and
    parseQualifiedTypeOfX (version returning QualifiedType).

Reviewed by @mppf, thank you!

Modified Files:
A compiler/dyno/test/common.cpp

A compiler/dyno/test/common.h
M compiler/dyno/CMakeLists.txt
M compiler/dyno/test/CMakeLists.txt
M compiler/dyno/test/resolution/testEnums.cpp
M compiler/dyno/test/resolution/testFieldAccess.cpp
M compiler/dyno/test/resolution/testLoopIndexVars.cpp
M compiler/dyno/test/resolution/testMultiDecl.cpp
M compiler/dyno/test/resolution/testParamFolding.cpp
M compiler/dyno/test/resolution/testProcThis.cpp
M compiler/dyno/test/resolution/testTuples.cpp
M compiler/dyno/test/resolution/testTypeAndInit.cpp
M compiler/dyno/test/resolution/testTypeConstruction.cpp
M compiler/dyno/test/resolution/testTypeQueries.cpp

Compare: https://github.com/chapel-lang/chapel/compare/63ff0a63a5b5...0c1f82be1910