Skip to content

Commit

Permalink
Use buildStdContext helper in array/domain tests
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Rift <[email protected]>
  • Loading branch information
riftEmber committed Oct 4, 2024
1 parent f47c972 commit abc93f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
7 changes: 2 additions & 5 deletions frontend/test/resolution/testArrays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ static QualifiedType findVarType(const Module* m,

static void testArray(std::string domainType,
std::string eltType) {
Context::Configuration config;
config.chplHome = getenv("CHPL_HOME");
Context ctx(config);
Context* context = &ctx;
setupModuleSearchPaths(context, false, false, {}, {});
auto ctx = buildStdContext();
auto context = ctx.get();
ErrorGuard guard(context);

// a different element type from the one we were given
Expand Down
14 changes: 4 additions & 10 deletions frontend/test/resolution/testDomains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ static void testRectangular(std::string domainType,
int rank,
std::string idxType,
std::string strides) {
Context::Configuration config;
config.chplHome = getenv("CHPL_HOME");
Context ctx(config);
Context* context = &ctx;
setupModuleSearchPaths(context, false, false, {}, {});
auto ctx = buildStdContext();
auto context = ctx.get();
ErrorGuard guard(context);

std::string program =
Expand Down Expand Up @@ -379,11 +376,8 @@ static void testBadDomain(std::string domainType) {

// With standard modules
{
Context::Configuration config;
config.chplHome = getenv("CHPL_HOME");
Context ctx(config);
Context* context = &ctx;
setupModuleSearchPaths(context, false, false, {}, {});
auto ctx = buildStdContext();
auto context = ctx.get();
ErrorGuard guard(context);

testBadDomainHelper(domainType, context, guard);
Expand Down

0 comments on commit abc93f7

Please sign in to comment.