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

Error on externally linked library #220

Open
davispolito opened this issue Dec 3, 2024 · 0 comments
Open

Error on externally linked library #220

davispolito opened this issue Dec 3, 2024 · 0 comments
Labels

Comments

@davispolito
Copy link

I am trying to use the cmake testing environment for an external we have been developing but I get a seg fault whenever I go to run the test. The external otherwise builds and operates perfectly fine in max.

I assume it has something to do with how I link the external library to the test build.

I use this line in my CMake for the external

target_link_libraries(${TEST_NAME} PRIVATE hidapi::hidapi)
This links the hidapi to the test file. I did this based off of what happens in min-object-unittest.cmake to create the test file itself. The test executable otherwise cannot find the hidapi.h files in my external.

Whenever I run a simple test that should only create my object the code segfaults at the line

SCENARIO(...
Here is my full test file

/// @file
/// @InGroup minexamples
/// @copyright Copyright 2018 The Min-DevKit Authors. All rights reserved.
/// @license Use of this source code is governed by the MIT License found in the License.md file.

#include "c74_min_unittest.h" // required unit test header

#include "min.manta.cpp" // need the source of our object so that we can access it

// Unit tests are written using the Catch framework as described at
// https://github.com/philsquared/Catch/blob/master/docs/tutorial.md

SCENARIO("object produces correct output") {
std::cout << "constructor called " << c74::min::endl;
ext_main(nullptr); // every unit test must call ext_main() once to configure the class

GIVEN("An instance of minmanta") {

	 test_wrapper<manta> an_instance;
	 manta&              my_object = an_instance;

	REQUIRE(1 == TRUE);
	
}

}
It does run the line right before ext_main but after that nothing gets run.

Here is a link to the repo for anyone interested https://github.com/spiricom/MantaMaxObject

@davispolito davispolito added the bug label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant