Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Conversation

@surik
Copy link
Contributor

@surik surik commented Feb 12, 2016

Previously if ebin was not created beams for compiled did files were not stored

@lrascao
Copy link
Contributor

lrascao commented Feb 12, 2016

@surik, change looks sane, i've just now noticed we've got no test coverage on the dia compiler.
Would you be available to write a small test to improve rebar coverage? If not, then real world .dia files would also be helpful.

@surik surik force-pushed the dia_ensure_ebin branch 3 times, most recently from 79228e9 to 99d1c5a Compare February 13, 2016 10:16
@surik
Copy link
Contributor Author

surik commented Feb 13, 2016

I added a small test for dia compiler and this test shows that compiler doesn't work on OTP 14 because uses undefined function diameter_dict_util:parse/2

@lrascao
Copy link
Contributor

lrascao commented Feb 13, 2016

I see, maybe that explains why there were no tests.
We can check for versions older than R15 and ignore the test for those. rebar_reltool.erl already does this (see check_vsn/0).
Also should we not be checking for correct output from the dia compiler? A simple comparison with a static string of the expected output would suffice.
For both checking the OTP version and the expected output maybe Eunit tests are a bit limited, integration tests (in the inttest/ folder) perhaps are more suitable for this case, you can find a similar test in inttest/proto_gpb, it takes a .proto file and compiles it to .erl while checking for correct output.
I understand that this has a bit more scope than you intended with the original PR, please let me know if you need a hand with this, i'll be glad to collaborate with you and take this chance to improve rebar's support of diameter compiling.

@surik
Copy link
Contributor Author

surik commented Feb 13, 2016

I added ignoring test for dia compiler on OTP < 15.

Tests on R16B02 are broken and looks this is not related to my changes.

@lrascao
Copy link
Contributor

lrascao commented Feb 13, 2016

Tests on R16B02 are broken and looks this is not related to my changes.

They were not, there's one specific test (ct1_rt) that needs a larger timeout

Also should we not be checking for correct output from the dia compiler? A simple comparison with a static string of the expected output would suffice.
For both checking the OTP version and the expected output maybe Eunit tests are a bit limited, integration tests (in the inttest/ folder) perhaps are more suitable for this case, you can find a similar test in inttest/proto_gpb, it takes a .proto file and compiles it to .erl while checking for correct output.

What are your thoughts on this subject?

@surik
Copy link
Contributor Author

surik commented Feb 13, 2016

What are your thoughts on this subject?

I fixed a small issue and provided a test which shows that it is works well. EUnit is enough in this case. What would be a different with inttest?

Maybe we can write a better test for dia compiler in inttest but in my opinion it is out of scope of this PR.

@lrascao
Copy link
Contributor

lrascao commented Feb 13, 2016

I fixed a small issue and provided a test which shows that it is works well. EUnit is enough in this case. What would be a different with inttest?

The test shows that something was compiled, a complete test would show that the output format is as expected. Eunit is apropriate for unit testing, inttest allows for more complex checks (integrity, making sure that the file is not compiled more than once unnecessarily, etc).

Maybe we can write a better test for dia compiler in inttest but in my opinion it is out of scope of this PR.

I understand, that's why i offered my help in making this a more complete PR that contains tests. If this is not possible i'd prefer this PR with just the fix and i'll propose a separate PR with more thorough testing.
What are your thoughts on this @Tuncer?

@ghost
Copy link

ghost commented Feb 13, 2016 via email

@lrascao
Copy link
Contributor

lrascao commented Feb 13, 2016

+1 then, maybe squash 99d1c5a and 60861a4 first?

@surik
Copy link
Contributor Author

surik commented Feb 13, 2016

Squashed

@lrascao
Copy link
Contributor

lrascao commented Feb 13, 2016

Thanks, if you wish please add your name to the THANKS file if not already there

also add myself to THANKS
Test will be runed only on OTP >= 15
lrascao added a commit that referenced this pull request Feb 13, 2016
Ensure ebin created for dia compiler
@lrascao lrascao merged commit a64cd50 into rebar:master Feb 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants