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

Fix module name when generating wrapper #135

Merged
merged 4 commits into from
Sep 8, 2023
Merged

Fix module name when generating wrapper #135

merged 4 commits into from
Sep 8, 2023

Conversation

ArtemkaKun
Copy link
Contributor

Before this PR, the module name was generated wrongly when generating a module for a single file, when the path to this file was relative

@spytheman
Copy link
Member

Can you add a small test for that fix?

@ArtemkaKun
Copy link
Contributor Author

Unfortunately, I have no time for now. I will do that asap

@ArtemkaKun
Copy link
Contributor Author

@spytheman I'm not sure how to add a test for this. The problem existed when executing c2v wrapper command on a C file with a relative path. This PR makes sure the path of the file is always absolute. Since paths to test files in our test runner script are absolute, not sure if it is worth it to try to extend test runner code to test this particular case

@JalonSolov
Copy link
Contributor

The test would be to translate a C file with just enough in it to show that this fix works, and use relative paths when translating.

@ArtemkaKun
Copy link
Contributor Author

The test would be to translate a C file with just enough in it to show that this fix works, and use relative paths when translating.

The problem is that test runner script walks through every test file by abs path. I would need to somehow ignore one single file and convert its path to a relative. Not sure if adding this complication to test runner script will pay off

@JalonSolov
Copy link
Contributor

Just generate the C file as part of your test. Don't make it a permanent file that's checked in.

@ArtemkaKun
Copy link
Contributor Author

I implemented a trick to run tests for both absolute and relative paths, so this should cover this case as well

@medvednikov medvednikov merged commit c0bcfbc into vlang:master Sep 8, 2023
3 checks passed
@ArtemkaKun ArtemkaKun deleted the fix-module-name branch September 9, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants