diff mbox series

[v3,7/8] secilc: run tests against development version of libsepol

Message ID 20220721150515.19843-7-cgzones@googlemail.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/8] libsepol: refactor ebitmap conversion in link.c | expand

Commit Message

Christian Göttsche July 21, 2022, 3:05 p.m. UTC
Since secilc is dynamically linked against libsepol do not run tests
against the system version of libsepol to support new features currently
in development.

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

Comments

James Carter Aug. 8, 2022, 3:20 p.m. UTC | #1
On Thu, Jul 21, 2022 at 11:11 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> Since secilc is dynamically linked against libsepol do not run tests
> against the system version of libsepol to support new features currently
> in development.
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
>  secilc/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/secilc/Makefile b/secilc/Makefile
> index 94be0481..543df43b 100644
> --- a/secilc/Makefile
> +++ b/secilc/Makefile
> @@ -34,8 +34,8 @@ $(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
> +       env LD_LIBRARY_PATH="$(DESTDIR)/lib:$(DESTDIR)/usr/lib" ./$(SECILC) test/policy.cil
> +       env LD_LIBRARY_PATH="$(DESTDIR)/lib:$(DESTDIR)/usr/lib" ./$(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
>         $(DIFF) test/opt-expected.cil opt-actual.cil
>

This assumes that LIBDIR and SHLIBDIR were not used.

The README.md file says to use the following for tests:

DESTDIR=~/obj ./scripts/env_use_destdir make test

and that works for secilc as well.

Jim


> --
> 2.36.1
>
diff mbox series

Patch

diff --git a/secilc/Makefile b/secilc/Makefile
index 94be0481..543df43b 100644
--- a/secilc/Makefile
+++ b/secilc/Makefile
@@ -34,8 +34,8 @@  $(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
+	env LD_LIBRARY_PATH="$(DESTDIR)/lib:$(DESTDIR)/usr/lib" ./$(SECILC) test/policy.cil
+	env LD_LIBRARY_PATH="$(DESTDIR)/lib:$(DESTDIR)/usr/lib" ./$(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
 	$(DIFF) test/opt-expected.cil opt-actual.cil