From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yHczAP2B62UrUwAAbAwnHQ (envelope-from ) for ; Fri, 08 Mar 2024 22:24:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IJYbOPyB62UhJwEAqHPOHw (envelope-from ) for ; Fri, 08 Mar 2024 22:24:12 +0100 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=WZxUt4rZ; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=CXqQRpb9; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1709933052; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=zRPagGnF7gQ3i+VXFd61u21frVOuPR4Szom965C+X38=; b=h7KLDCraKkqcmcvsUUo3Zzd33HAYpOhR/M3Zh5EJ7bqJgssDep1xIZzXbAc9kP8na9MwXA yeMVkJcL4KgqNsAORexaEvdApG3w9BZWav4EPEUMtVsLiK5l3mu5GXKRvuDSUaM3FyaCoE Dvlb0f1QrsrQsL4RrskZOsKdwBgS/RjrMtu5NN1lxqJ2zWpncZDPr5FbTSsXnzRGld6Diu pZjszkeuiJWk1fv1aTAn90IbKy8VdRIVe9xr55BYZmdWtxb0RODJbrzUJfOfHxpYt+qNYt ax78MF0be7DJW4Bhpg8ti1pM17DK9ImyZrsHo1RPW3IjP3qp5tOFxTpaXwgOSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lists.sr.ht header.s=20240113 header.b=WZxUt4rZ; dkim=pass header.d=johnnyrichard.com header.s=key1 header.b=CXqQRpb9; spf=pass (aspmx1.migadu.com: domain of lists@sr.ht designates 46.23.81.152 as permitted sender) smtp.mailfrom=lists@sr.ht; dmarc=pass (policy=quarantine) header.from=johnnyrichard.com ARC-Seal: i=1; s=key1; d=johnnyrichard.com; t=1709933052; a=rsa-sha256; cv=none; b=cWnpmv+V2z3mEExb8nJ+vEEAH4Lf4srqD733TNQOJXqPQtgfQCxY1YQy+cPSgCIfkRrh0W 1vb8bWUql7+DbWD2DJjpCz3Dq+AcL/h7vYsr9q9MVd/eesnoKQ65pep9gLKRavolDi49SA zPzVIzpCngwVdxCOO1q5SAP00WaWz6vRH2+IbgKlLGgPdJyLeCXeisj/tcXVagYOn5B/gk 2RhwrLnh7fVADJYIWjYJuqU2Fim+S8CJYcSVdvjkWxqB4cCzflzM1BYlXgABPXymWPhQvv 18p6jTBfVb7JAFYhzNDTXLAG9lLIDkV4F6TB0lIGnto5R0QJ2625P28pVpK52A== Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7BEBC57AB1 for ; Fri, 8 Mar 2024 22:24:09 +0100 (CET) DKIM-Signature: a=rsa-sha256; bh=s+HXvHGRWc2+EEKAXW8ThViEFZW6WMB9RRn/eEgdYrg=; c=simple/simple; d=lists.sr.ht; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1709933049; v=1; b=WZxUt4rZO7SIIyOfI1Kn82Dh7hD1sviBqMD+Rk1EB5dJDfEixv306cQZCkM5m5T/QkSb9Yfe lCFhyIaddb/CCyt0Q2K+ldgtfL1rBK2kyn5zYjlpqJEi2LqXmDxDFnuIIFWugO9MnhwJz3xMooi ZTcDiQRfqiLFT2lCx+xa/O2lbtGBzP8EgXQs2VTq0xy0dX49cm7FSCuUBN+0NcWG/mxF8ScrUSg vZaBwNckBQnLL6SL5UT5T6yRjxFeKamiN7/zBA3p5C0agnU5jBzZweapJbizw9OXLGNiKEsAj75 5qvIgb5+0B3lJfAX/rMG4zURccqxjENkfHeMGpGoCh4Og== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 515CD2025F for ; Fri, 8 Mar 2024 21:24:09 +0000 (UTC) Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) by mail-a.sr.ht (Postfix) with ESMTPS id 948D120256 for <~johnnyrichard/olang-devel@lists.sr.ht>; Fri, 8 Mar 2024 21:24:08 +0000 (UTC) Date: Fri, 8 Mar 2024 23:24:34 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1709933047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zRPagGnF7gQ3i+VXFd61u21frVOuPR4Szom965C+X38=; b=CXqQRpb9Sahf/7+OUk+RRDSL6WUaaaqPVcztRrhAv3Coja3QS6kl1qaXDI/3Fl+VjOj9xv IH9pG0qnbNT+2F6UtukC7G+wngebUhm9RWAbtK/P8okDqjJOliCPZE9uNrLqxtaHS3mkwB BeNrPKKcYHk9gKWHiu+c/1/qeD9sHlblV5BVlM6j66G9GznMzR7DuLvCennSW4r3vuTWrB GVzgyXhsJIcTT+LfGxDJUNhuGe4hZO8utxUxb9mrIgKyRBNlOTPBAdkjWXFGI4xEMO+NnG VUb6VeCacnPKQyPH8EvNXmYA5gXAG7GDyy90qeVc+C6JR0cfe1o5d7cKBRc5rw== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Johnny Richard To: Carlos Maniero Cc: ~johnnyrichard/olang-devel@lists.sr.ht Subject: Re: [PATCH olang 2/3] tests: decouple command execution from cli_runner Message-ID: References: <20240307232322.2085290-1-carlos@maniero.me> <20240307232322.2085290-3-carlos@maniero.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240307232322.2085290-3-carlos@maniero.me> List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Migadu-Spam-Score: -10.05 X-Spam-Score: -10.05 X-Migadu-Queue-Id: 7BEBC57AB1 X-Migadu-Scanner: mx13.migadu.com X-TUID: TZazpzDNDJdn 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?