diff mbox series

[1/2] secilc: consider DESTDIR in tests

Message ID 20230602130646.24835-1-cgzones@googlemail.com (mailing list archive)
State Rejected
Delegated to: Petr Lautrbach
Headers show
Series [1/2] secilc: consider DESTDIR in tests | expand

Commit Message

Christian Göttsche June 2, 2023, 1:06 p.m. UTC
Use the script `env_use_destdir` to preload libsepol from the DESTDIR
location to support development changes like policy version bumps.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 secilc/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Petr Lautrbach June 2, 2023, 2:28 p.m. UTC | #1
Christian Göttsche <cgzones@googlemail.com> writes:

> Use the script `env_use_destdir` to preload libsepol from the DESTDIR
> location to support development changes like policy version bumps.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>

It would not work when run from secilc-...tar.gz sources. In such case I
would expect that the environment is already prepared from outside.


> ---
>  secilc/Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/secilc/Makefile b/secilc/Makefile
> index 94be0481..5a85df67 100644
> --- a/secilc/Makefile
> +++ b/secilc/Makefile
> @@ -34,9 +34,9 @@ $(SECILC): $(SECILC_OBJS)
>  	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
>  
>  test: $(SECILC)
> -	./$(SECILC) test/policy.cil
> -	./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
> -	$(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
> +	../scripts/env_use_destdir ./$(SECILC) test/policy.cil
> +	../scripts/env_use_destdir ./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
> +	../scripts/env_use_destdir $(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
>  	$(DIFF) test/opt-expected.cil opt-actual.cil
>  
>  $(SECIL2CONF): $(SECIL2CONF_OBJS)
> -- 
> 2.40.1
diff mbox series

Patch

diff --git a/secilc/Makefile b/secilc/Makefile
index 94be0481..5a85df67 100644
--- a/secilc/Makefile
+++ b/secilc/Makefile
@@ -34,9 +34,9 @@  $(SECILC): $(SECILC_OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
 
 test: $(SECILC)
-	./$(SECILC) test/policy.cil
-	./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
-	$(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
+	../scripts/env_use_destdir ./$(SECILC) test/policy.cil
+	../scripts/env_use_destdir ./$(SECILC) -c $(POL_VERS) -O -M 1 -f /dev/null -o opt-actual.bin test/opt-input.cil
+	../scripts/env_use_destdir $(CHECKPOLICY) -b -C -M -o opt-actual.cil opt-actual.bin >/dev/null
 	$(DIFF) test/opt-expected.cil opt-actual.cil
 
 $(SECIL2CONF): $(SECIL2CONF_OBJS)