forked from google/xls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue preventing googletest from using AbslStringify for params
In order for this to work googletest needs to be configured with absl. This also included removing an old workaround for grpc that is no longer needed. PiperOrigin-RevId: 571397085
- Loading branch information
1 parent
123d30c
commit 8058d52
Showing
32 changed files
with
210 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2023 The XLS Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "xls/common/benchmark_support.h" | ||
#include "benchmark/benchmark.h" | ||
|
||
namespace xls { | ||
void RunSpecifiedBenchmarks() { benchmark::RunSpecifiedBenchmarks(); } | ||
} // namespace xls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2023 The XLS Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef XLS_COMMON_BENCHMARK_SUPPORT_H_ | ||
#define XLS_COMMON_BENCHMARK_SUPPORT_H_ | ||
|
||
namespace xls { | ||
// Helper to perform setup and execute benchmarks. Not a public API. | ||
// This should be called after parsing all flags and setting up googletest. | ||
void RunSpecifiedBenchmarks(); | ||
} // namespace xls | ||
|
||
#endif // XLS_COMMON_BENCHMARK_SUPPORT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2023 The XLS Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "xls/common/gunit_init_xls.h" | ||
|
||
#include "gtest/gtest.h" | ||
#include "xls/common/init_xls.h" | ||
|
||
namespace xls { | ||
|
||
std::vector<std::string_view> InitXlsForTest(std::string_view usage, int argc, | ||
char* argv[]) { | ||
// InitGoogleTest calls ParseAbslFlags with gtest configured to use absl (like | ||
// we do). | ||
testing::InitGoogleTest(&argc, argv); | ||
|
||
internal::InitXlsPostAbslFlagParse(); | ||
|
||
return std::vector<std::string_view>(argv + 1, argv + argc); | ||
} | ||
} // namespace xls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright 2023 The XLS Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef XLS_COMMON_GUNIT_INIT_XLS_H_ | ||
#define XLS_COMMON_GUNIT_INIT_XLS_H_ | ||
|
||
#include <string_view> | ||
#include <vector> | ||
|
||
namespace xls { | ||
|
||
// Initializes global state in the test, including things like command line | ||
// flags, symbolizer etc. This function might exit the program, for example if | ||
// the command line flags are invalid or if a '--help' command line argument was | ||
// provided. | ||
// | ||
// Is typically called early on in main(). | ||
// | ||
// It must be called after InitGoogleTest | ||
// | ||
// `usage` provides a short usage message usable by | ||
// absl::SetProgramUsageMessage(). | ||
// | ||
// `argc` and `argv` are the command line flags to parse. This function does not | ||
// modify `argc`. | ||
// | ||
// Returns a vector of the positional arguments that are not part of any | ||
// command-line flag (or arguments to a flag), not including the program | ||
// invocation name. (This includes positional arguments after the | ||
// flag-terminating delimiter '--'.) | ||
std::vector<std::string_view> InitXlsForTest(std::string_view usage, int argc, | ||
char* argv[]); | ||
|
||
} // namespace xls | ||
|
||
#endif // XLS_COMMON_GUNIT_INIT_XLS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.