rizinorg / rz-pipe

Access rizin via pipe from any programming language!
33 stars 11 forks source link

Add proper testing #8

Closed XVilka closed 3 years ago

XVilka commented 3 years ago
4thel00z commented 3 years ago

Hi @XVilka can give me some details what is needed here? I would like to contribute that

XVilka commented 3 years ago

@4thel00z for example, implement a set of tests for rz-pipe.py with pytest framework.

4thel00z commented 3 years ago

ok, I can do that

4thel00z commented 3 years ago

I will refactor it too, it is really not easy to follow along

4thel00z commented 3 years ago

@XVilka what can you tell me about RZ_PIPE_IN, RZ_PIPE_OUT / RZ_PIPE_PATH? What is the path where rizin usually creates these

wargio commented 3 years ago

they are environment variables. i think the varnames are RZPIPE_*. there is no default path. actually they need to be defined

wargio commented 3 years ago

rzpipe_path is the path to a unix file pipe

4thel00z commented 3 years ago

@wargio @XVilka @officialcjunior How does one join the rizinorg btw, I will try to contribute semi-regularly as I am interested in the project

@wargio I see that these are env vars from the rzpipe code, but I need to know to what these need to point to, so I can mock them in the test I will just try to read through some rizin code to understand what's happening

thestr4ng3r commented 3 years ago

On unix systems, _IN and _OUT are simply file descriptors that the parent process (rizin) creates and child (rz-pipe) can read/write from/to: https://github.com/rizinorg/rizin/blob/a4b2a942c9a398a1d6f0c62b2c60cdcecfc0bd49/librz/lang/p/pipe.c#L159-L160

On Windows it's a bit different, there it uses a named pipe and the _PATH var: https://github.com/rizinorg/rizin/blob/a4b2a942c9a398a1d6f0c62b2c60cdcecfc0bd49/librz/lang/p/pipe.c#L238-L242

ITAYC0HEN commented 3 years ago

@4thel00z

How does one join the rizinorg btw, I will try to contribute semi-regularly as I am interested in the project

We will be more than happy to have you in Rizin :) You can jump into our Mattermost server and check out the different channels, including Rizin dev: https://im.rizin.re/ Other platforms available here: https://rizin.re/community/

See you in there! :)