Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20523] Improve IDL parser tests #5559

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class PreprocessorContext

return std::make_pair(std::move(tmp_file), std::string(filename_buffer.data()));
}

#else
std::pair<std::ofstream, std::string> get_temporary_file() const
{
Expand Down Expand Up @@ -156,6 +157,7 @@ class PreprocessorContext
// Return the file stream and the file name
return std::make_pair(std::move(tmp_file), std::string(filename_template.begin(), filename_template.end() - 1));
}

#endif // _MSC_VER

void replace_all_string(
Expand Down Expand Up @@ -184,8 +186,12 @@ class PreprocessorContext
std::string exec(
const std::string& cmd) const
{
std::unique_ptr<FILE, decltype(& pclose)> pipe(
popen(cmd.c_str(), EPROSIMA_PLATFORM_PIPE_OPEN_FLAGS), pclose);
auto deleter = [](FILE* f)
{
pclose(f);
};
std::unique_ptr<FILE, decltype(deleter)> pipe(
popen(cmd.c_str(), EPROSIMA_PLATFORM_PIPE_OPEN_FLAGS), deleter);
if (!pipe)
{
throw std::runtime_error("popen() failed!");
Expand Down
7 changes: 1 addition & 6 deletions test/feature/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@
# limitations under the License.

add_subdirectory(dynamic_types)

if(EXISTS "${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL")
add_subdirectory(idl_parser)
else()
message(WARNING "Folder thirdparty/dds-types-test/IDL does not exist. Submodule thirdparty/dds-types-test might not have been initialized.")
endif()
add_subdirectory(idl_parser)
4 changes: 4 additions & 0 deletions test/feature/idl_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if(NOT EXISTS "${PROJECT_SOURCE_DIR}/thirdparty/dds-types-test/IDL")
message(FATAL_ERROR "Folder thirdparty/dds-types-test/IDL does not exist. Submodule thirdparty/dds-types-test might not have been initialized.")
endif()

if(WIN32)
add_definitions(
-D_WIN32_WINNT=0x0601
Expand Down
Loading
Loading