Skip to content

Commit

Permalink
Fix a gtest failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed May 2, 2024
1 parent 0478d93 commit 96b5a5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backends/p4tools/modules/testgen/test/gtest_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "lib/exceptions.h"

#include "backends/p4tools/modules/testgen/register.h"
#include "backends/p4tools/modules/testgen/toolname.h"

namespace Test {

Expand All @@ -26,10 +27,12 @@ std::optional<const P4ToolsTestCase> P4ToolsTestCase::create(
deviceName, archName);

// Set up the compilation context and set the source language.
AutoCompileContext autoCompileContext(P4Tools::CompilerTarget::makeContext("testgen"));
AutoCompileContext autoCompileContext(
P4Tools::CompilerTarget::makeContext(P4Tools::P4Testgen::TOOL_NAME));
P4CContext::get().options().langVersion = langVersion;

auto compilerResults = P4Tools::CompilerTarget::runCompiler(source);
auto compilerResults =
P4Tools::CompilerTarget::runCompiler(P4Tools::P4Testgen::TOOL_NAME, source);
if (!compilerResults.has_value()) {
return std::nullopt;
}
Expand Down

0 comments on commit 96b5a5b

Please sign in to comment.