public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
From: Johnny Richard <johnny@johnnyrichard.com>
To: Carlos Maniero <carlos@maniero.me>
Cc: ~johnnyrichard/olang-devel@lists.sr.ht
Subject: Re: [PATCH olang 2/3] tests: decouple command execution from cli_runner
Date: Fri, 8 Mar 2024 23:24:34 +0100	[thread overview]
Message-ID: <b7i6s66jurmmwkgjysl2snexthmo274svce5trg2xxa4n5un4p@njvjyendiags> (raw)
In-Reply-To: <20240307232322.2085290-3-carlos@maniero.me>

On Thu, Mar 07, 2024 at 08:23:21PM -0300, Carlos Maniero wrote:
> -        execv(OLANG_COMPILER_PATH, args);
> -        perror("execl error.");
> -        exit(127);
> -    } else {
> -        close(fd_link[1]);
> -        if (read(fd_link[0], result.compiler_output, sizeof(result.compiler_output)) == -1) {

We are not reading the full ouptut here.  We can implement a logic to
read the whole string or leave a TODO comment here.

> diff --git a/tests/integration/cli_runner.h b/tests/integration/cli_runner.h
> index 7ce4e7b..785cd34 100644
> --- a/tests/integration/cli_runner.h
> +++ b/tests/integration/cli_runner.h
> @@ -16,13 +16,17 @@
>   */
>  #ifndef CLI_RUNNER_H
>  #define CLI_RUNNER_H
> +#include "proc_exec.h"
> +
>  typedef struct cli_result_t
>  {
> -    int exit_code;
> -    char program_path[255];
> -    char compiler_output[1024];

Perhaps leave a TODO comment here about making it not sized? 
> +void
> +proc_exec(proc_exec_command_t* command)
> +{
> +    int fd_link[2];

nitpick: fd_link might miss leading to wrong understating.  What do you
think about changing it to fd_pipe to be clearer?

  reply	other threads:[~2024-03-08 21:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 23:23 [PATCH olang 0/3] tests: cli: cover compilation pipeline Carlos Maniero
2024-03-07 23:23 ` [PATCH olang 1/3] tests: fix: rename dump tokens test name Carlos Maniero
2024-03-07 23:23 ` [PATCH olang 2/3] tests: decouple command execution from cli_runner Carlos Maniero
2024-03-08 22:24   ` Johnny Richard [this message]
2024-03-08 22:41     ` Carlos Maniero
2024-03-07 23:23 ` [PATCH olang 3/3] tests: add tests for the minimal possible olang program Carlos Maniero
2024-03-07 23:24   ` [olang/patches/.build.yml] build success builds.sr.ht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7i6s66jurmmwkgjysl2snexthmo274svce5trg2xxa4n5un4p@njvjyendiags \
    --to=johnny@johnnyrichard.com \
    --cc=carlos@maniero.me \
    --cc=~johnnyrichard/olang-devel@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox