From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail-a.sr.ht; dkim=pass header.d=maniero.me header.i=@maniero.me Received: from iguana.tulip.relay.mailchannels.net (iguana.tulip.relay.mailchannels.net [23.83.218.253]) by mail-a.sr.ht (Postfix) with ESMTPS id 1C221200B4 for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 18 Feb 2024 00:55:03 +0000 (UTC) X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 673E310286D for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 18 Feb 2024 00:55:02 +0000 (UTC) Received: from nl-srv-smtpout4.hostinger.io (unknown [127.0.0.6]) (Authenticated sender: hostingeremail) by relay.mailchannels.net (Postfix) with ESMTPA id 988811019FE for <~johnnyrichard/olang-devel@lists.sr.ht>; Sun, 18 Feb 2024 00:55:01 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1708217701; a=rsa-sha256; cv=none; b=dYgZaVvVpPMC7cSKG5fRSKnaVG4dreuRZZj23R1zYKKDvP3jOUBzr1xtoWPmeCT1Q6kKsY uqrkuw+6pY4b5luzq58900kBDRkShKsDAIvj70pnv4NzPG2hg5A2r0jhQdUr4/4HtQe1rI MNNgQVecysGwkTmlIz2YN4+yiZVYnSlzZ10dg64tSqLAUwvC88ga0AKMsswVn69mMTh144 XHBJ+jNq2hgbMvjc1vKa+/6sWy6vJCdEYJ+cXSJI416JQwqVzVZ491drXmk8/kogj00u8W /IBUsTVmYjL9mBk+aWyay7RYsd9bkoDfNQR4Qu2gzpknnK/FWq0d6vCbnIX+UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1708217701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/UAitK55pPlhj+cgwmFI0c1Ul0wzt7sXTYjNxM00nEI=; b=qwbUp5pWAgYJlXuG1QprbGb2xTEBQc3syKUPE1k4x+GQR0hEHyv8pSAWqIeM3mRL2IdVYY uSgOJ1GRiwzMF4+xN7lyO/xd+p34rDnRVV4vH1nSM1C58ltByUQog6UwYYCfnr4IujUAos /goE1+RTfhKRtHE6UifdSyWvJTQje6lJorgZ4DaF5DDDIzvILn+wh0pko9aHh2PnhX8SbL xiJzMtjGX9N7unIzUjo3yA9V1wan9i7Tbj2P2Bm22I+GKEDGh346xDT5OHRlbe069aAQiU BoTVBxj8MeAkl2Tdi9yBRi9vMCAUlVmuG0HXxF7JWxk+XXsygD3tnUfnqwnkoA== ARC-Authentication-Results: i=1; rspamd-55b4bfd7cb-lzhr8; auth=pass smtp.auth=hostingeremail smtp.mailfrom=carlos@maniero.me X-Sender-Id: hostingeremail|x-authuser|carlos@maniero.me X-MC-Relay: Neutral X-MailChannels-SenderId: hostingeremail|x-authuser|carlos@maniero.me X-MailChannels-Auth-Id: hostingeremail X-Ruddy-Thoughtful: 7c33303921c012b4_1708217702121_3917504474 X-MC-Loop-Signature: 1708217702120:2490852541 X-MC-Ingress-Time: 1708217702120 Received: from nl-srv-smtpout4.hostinger.io (nl-srv-smtpout4.hostinger.io [145.14.159.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.115.180.213 (trex/6.9.2); Sun, 18 Feb 2024 00:55:02 +0000 From: Carlos Maniero DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maniero.me; s=hostingermail1; t=1708217700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/UAitK55pPlhj+cgwmFI0c1Ul0wzt7sXTYjNxM00nEI=; b=wFRGup737asJtOqQ6DfLl8cLgVNi+4RV/YaBRpaYsw52pIikZhxmKzjpBlMxMBMV5lgQS9 cTgFfLCXShXJMg8zs4jDUs2weJHL/qZckbMaoUqqmW1txHxAHUMKTMY4y7/b0s6l9ohdk1 CalXw6j1UdDu4G0MALGrcbGn5n2CVt2l9Lz8socjr+31qOG3+oK/9cTy2JOrbOg5I06wNs Xr5VqJskDBKUcoPcWSBpyon9HnLairswCotSeQvbtqz5CHRLJAWEeFL4G/HjZQiaQiwzRk jgbhddHeY+2ljLu7V6VQ1dQ/j2bxfSFHLb3VyPrjhLJVqCftt0agE/WGynStOg== To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Carlos Maniero Subject: [PATCH olang 1/2] tests: move munit to a shared directory Date: Sat, 17 Feb 2024 21:50:22 -0300 Message-Id: <20240218005023.3723888-1-carlos@maniero.me> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240218002713.3705605-1-carlos@maniero.me> References: <20240218002713.3705605-1-carlos@maniero.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-Envelope: MS4xfFC2hy6M2eGTugcHiel3NQpDPGkE58NrCDgjDNbSV5ATfE8UYjT1FLvh7CV7cqJ2zYpfv0P/VV7o0pYvFNh3NM7X1AyjUe6gkWfCI1nlsKvzJVo00bno Xe0wQ7Xt3hi/09jU4w3WtOlUBPyEd4UjAfMPZG8ECwIEt9bY+98dKjBit23uwKM/GM1eZUH8G80X91nIX91y11ZsUyzmKH4rOSJLFKBy2Mqbjypx9Z626hce aEgntD8icFV47rWK/ImVJg== X-CM-Analysis: v=2.4 cv=DIOJ4TNb c=1 sm=1 tr=0 ts=65d15564 a=5+VMC1FZ3J4mVPAKpPmAqg==:117 a=5+VMC1FZ3J4mVPAKpPmAqg==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=BXDaF_L80NYA:10 a=nPkKDRbQ341Pnl3YNnIA:9 X-AuthUser: carlos@maniero.me X-TUID: JDDjmRiCdGne Since unit tests also uses munit, there is no reason to keep it inside the integration directory. Instead I created a shared directory to keep stuff that are shared in between unit and integration tests. Signed-off-by: Carlos Maniero --- tests/integration/Makefile | 16 ++++++++++------ tests/{integration => shared}/munit.c | 0 tests/{integration => shared}/munit.h | 0 3 files changed, 10 insertions(+), 6 deletions(-) rename tests/{integration => shared}/munit.c (100%) rename tests/{integration => shared}/munit.h (100%) diff --git a/tests/integration/Makefile b/tests/integration/Makefile index a42f787..eeebfdd 100644 --- a/tests/integration/Makefile +++ b/tests/integration/Makefile @@ -1,12 +1,13 @@ SRCS := $(wildcard *_test.c) -TO_LINT := $(filter-out munit.c munit.h,$(wildcard *.c *.h)) OBJS := $(patsubst %_test.c, %_test.o, $(SRCS)) -CFLAGS := -I../../src +CFLAGS := -I../../src -I../shared TESTS := $(patsubst %_test.c, %_test, $(SRCS)) EXEC_TESTS := $(patsubst %_test, ./%_test, $(TESTS)) +MUNIT_SRC := ../shared/munit.c +MUNIT := ./munit.o .PHONY: all -all: munit.o cli_runner.o $(TESTS) +all: $(MUNIT) cli_runner.o $(TESTS) @for file in $(EXEC_TESTS); do \ ./"$$file"; \ done @@ -16,12 +17,15 @@ clean: $(RM) *.o *_test .PHONY: linter -linter: $(TO_LINT) +linter: $(SRCS) clang-format --dry-run --Werror $? .PHONY: linter-fix -linter-fix: $(TO_LINT) +linter-fix: $(SRCS) clang-format -i $? -cli_test: munit.o cli_runner.o cli_test.o +cli_test: $(MUNIT) cli_runner.o cli_test.o $(CC) $? $(CFLAGS) -o $@ + +$(MUNIT): + $(CC) -c $(MUNIT_SRC) $(CFLAGS) -o $(MUNIT) diff --git a/tests/integration/munit.c b/tests/shared/munit.c similarity index 100% rename from tests/integration/munit.c rename to tests/shared/munit.c diff --git a/tests/integration/munit.h b/tests/shared/munit.h similarity index 100% rename from tests/integration/munit.h rename to tests/shared/munit.h -- 2.34.1