Skip to content

Commit

Permalink
Disable preprocess in test_package
Browse files Browse the repository at this point in the history
    - Also remove msvc 19.1, since it seems to struggle
  • Loading branch information
joakimono committed Apr 9, 2024
1 parent 3d6a0f2 commit 8f87088
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-conan-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
version: [cci.20230615]
build_type: [Debug, Release]
profile: [msvc17]
compiler_version: [191, 192, 193]
compiler_version: [192, 193]
channel: ["${{ (github.head_ref || github.ref_name) == 'master' && 'stable' || 'testing' }}"]
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def _min_cppstd(self):
@property
def _compilers_minimum_version(self):
return {
"Visual Studio": "15.7",
"msvc": "14.1",
"msvc": "14.2",
"gcc": "7",
"clang": "6",
"apple-clang": "10",
Expand Down
29 changes: 21 additions & 8 deletions test_package/test_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ using namespace eprosima::xtypes;

int main()
{
try {
std::string idl_spec = "struct InnerType { uint32 im1; float im2; };";

idl::Context context = idl::parse(idl_spec);
idl::Context context;
context.print_log(true);
context.preprocess = false; // Preprocessor requires build environment with access to cl, not needed here
context.log_level(eprosima::xtypes::idl::log::LogLevel::xDEBUG);

context = idl::parse(idl_spec, context);

if(!context.success) { throw std::runtime_error("Unable to parse idl spec"); }

StructType inner = context.module().structure("InnerType");

StructType outer("OuterType");
Expand All @@ -24,12 +33,12 @@ int main()
submod_b.structure(inner);

/*
root
\_a
| \_ a _ OuterType
|
\_b _ InnerType
*/
root
\_a
| \_ a _ OuterType
|
\_b _ InnerType
*/

std::cout << std::boolalpha;
std::cout << "Does a::a::OuterType exists?: " << root.has_structure("a::a::OuterType") << std::endl;
Expand All @@ -46,6 +55,10 @@ int main()
DynamicData inner_data(root.structure(scope_inner_type));
inner_data["im1"] = 32u;
inner_data["im2"] = 3.14159265f;
} catch (const std::runtime_error& err) {
std::cerr << "Caught exception: " << err.what() << std::endl;
return EXIT_FAILURE;
}

return EXIT_SUCCESS;
return EXIT_SUCCESS;
}

0 comments on commit 8f87088

Please sign in to comment.