diff options
author | Adrian Thurston <thurston@colm.net> | 2019-09-10 16:10:56 -0600 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-09-10 16:10:56 -0600 |
commit | 0eadae82699035bb9eda0cf979b33116aa8c84cc (patch) | |
tree | abd7511968c2a058585cfc1aa01860a8b2662540 | |
parent | 6e379ead8f003650a162790b9f3a78fa5d7b22a6 (diff) | |
download | colm-0eadae82699035bb9eda0cf979b33116aa8c84cc.tar.gz |
configuring the test suite from /configure.ac
Want to be able to configure the test suite so it either tests from the source
directory, or to test an installed path to verify the installation process.
Using the --with-subject argument for this.
-rw-r--r-- | configure.ac | 108 | ||||
-rw-r--r-- | test/aapl.d/Makefile.am | 2 | ||||
-rw-r--r-- | test/colm.mk.in | 7 | ||||
-rw-r--r-- | test/colm.sh.in | 7 | ||||
-rw-r--r-- | test/ragel.d/Makefile.am | 8 | ||||
-rw-r--r-- | test/ragel.d/gentests.sh | 31 | ||||
-rw-r--r-- | test/ragel.mk.in | 6 | ||||
-rw-r--r-- | test/ragel.sh.in | 6 |
8 files changed, 131 insertions, 44 deletions
diff --git a/configure.ac b/configure.ac index 238f0a1f..5590f114 100644 --- a/configure.ac +++ b/configure.ac @@ -110,14 +110,9 @@ dnl AM_CONDITIONAL([BUILD_MANUAL], [test "x$build_manual" = "xyes"]) AC_CANONICAL_HOST() AM_CONDITIONAL([LINKER_NO_UNDEFINED], [test "x$host_os" = "xlinux-gnu"]) -AC_ARG_WITH(crack, - [AC_HELP_STRING([--with-crack], [location of crack install])], - [CRACK_BIN="$withval/bin/crack"], - [AC_ERROR(["require --with-crack"])] -) - -AC_SUBST(CRACK_BIN) - +# +# For building within the tree. +# COLM='$(top_srcdir)/colm/colm' COLM_LD='$(top_srcdir)/colm/libcolm.la' COLM_LIBDEP=$COLM_LD @@ -128,9 +123,104 @@ AC_SUBST(COLM_LD) AC_SUBST(COLM_LIBDEP) AC_SUBST(COLM_BINDEP) -CPPFLAGS="${CPPFLAGS} -I$(top_srcdir)/src" +AC_ARG_WITH(crack, + [AC_HELP_STRING([--with-crack], [location of crack install])], + [CRACK_BIN="$withval/bin/crack"], + [AC_ERROR(["require --with-crack"])] +) + +AC_SUBST(CRACK_BIN) + +dnl +dnl Which installed target to test. Without this option supplied testing is +dnl done against what's in the source tree. +dnl +AC_ARG_WITH(subject, + [AC_HELP_STRING([--with-subject], [location of install tree test (defaults source tree)])], + [ + AAPL_CPPFLAGS="-I${withval}/include/aapl" + + COLM_BIN="${withval}/bin/colm" + COLM_CPPFLAGS="-I${withval}/include" + COLM_LDFLAGS="${LDFLAGS} -L${withval}/lib -Wl,-rpath,${withval}/lib" + + RAGEL_BIN="$withval/bin/ragel" + RAGEL_CPPFLAGS="-I$withval/include" + RAGEL_LDFLAGS="-L$withval/lib -Wl,-rpath,${withval}/lib" + RAGEL_LM="${withval}/share" + + RAGEL_C_BIN="$withval/bin/ragel-c" + RAGEL_D_BIN="$withval/bin/ragel-d" + RAGEL_JAVA_BIN="$withval/bin/ragel-java" + RAGEL_RUBY_BIN="$withval/bin/ragel-ruby" + RAGEL_CSHARP_BIN="$withval/bin/ragel-csharp" + RAGEL_GO_BIN="$withval/bin/ragel-go" + RAGEL_OCAML_BIN="$withval/bin/ragel-ocaml" + RAGEL_ASM_BIN="$withval/bin/ragel-asm" + RAGEL_RUST_BIN="$withval/bin/ragel-rust" + RAGEL_CRACK_BIN="$withval/bin/ragel-crack" + RAGEL_JULIA_BIN="$withval/bin/ragel-julia" + ], + [ + AAPL_CPPFLAGS='-I$(abs_top_builddir)/aapl' + + COLM_BIN='$(abs_top_builddir)/colm/colm' + COLM_CPPFLAGS='-I$(abs_top_builddir)/colm/include' + COLM_LDFLAGS='${LDFLAGS} -L$(abs_top_builddir)/colm/.libs -Wl,-rpath,${abs_top_builddir}/colm/.libs' + + RAGEL_BIN='$(abs_top_builddir)/ragel/ragel' + RAGEL_CPPFLAGS='-I$(abs_top_builddir)/ragel/include -I$(abs_top_builddir)/aapl' + RAGEL_LDFLAGS='-L$(abs_top_builddir)/ragel/.libs -Wl,-rpath,$(abs_top_builddir)/ragel/.libs' + RAGEL_LM='$(abs_top_builddir)/ragel' + + RAGEL_C_BIN='$(abs_top_builddir)/ragel/host-c/ragel-c' + RAGEL_D_BIN='$(abs_top_builddir)/ragel/host-d/ragel-d' + RAGEL_JAVA_BIN='$(abs_top_builddir)/ragel/host-java/ragel-java' + RAGEL_RUBY_BIN='$(abs_top_builddir)/ragel/host-ruby/ragel-ruby' + RAGEL_CSHARP_BIN='$(abs_top_builddir)/ragel/host-csharp/ragel-csharp' + RAGEL_GO_BIN='$(abs_top_builddir)/ragel/host-go/ragel-go' + RAGEL_OCAML_BIN='$(abs_top_builddir)/ragel/host-ocaml/ragel-ocaml' + RAGEL_ASM_BIN='$(abs_top_builddir)/ragel/host-asm/ragel-asm' + RAGEL_RUST_BIN='$(abs_top_builddir)/ragel/host-rust/ragel-rust' + RAGEL_CRACK_BIN='$(abs_top_builddir)/ragel/host-crack/ragel-crack' + RAGEL_JULIA_BIN='$(abs_top_builddir)/ragel/host-julia/ragel-julia' + ] +) + +AC_SUBST(AAPL_CPPFLAGS) + +AC_SUBST(COLM_BIN) +AC_SUBST(COLM_CPPFLAGS) +AC_SUBST(COLM_LDFLAGS) +AC_SUBST(RAGEL_BIN) +AC_SUBST(RAGEL_CPPFLAGS) +AC_SUBST(RAGEL_LDFLAGS) +AC_SUBST(RAGEL_LM) + SED_SUBST=["\ + -e 's|@COLM@|${COLM}|g' \ + -e 's|@COLM_LD@|${COLM_LD}|g' \ + -e 's|@COLM_LIBDEP@|${COLM_LIBDEP}|g' \ + -e 's|@COLM_BINDEP@|${COLM_BINDEP}|g' \ + -e 's|@COLM_BIN@|${COLM_BIN}|g' \ + -e 's|@COLM_CPPFLAGS@|${COLM_CPPFLAGS}|g' \ + -e 's|@COLM_LDFLAGS@|${COLM_LDFLAGS}|g' \ + -e 's|@RAGEL_BIN@|${RAGEL_BIN}|g' \ + -e 's|@RAGEL_CPPFLAGS@|${RAGEL_CPPFLAGS}|g' \ + -e 's|@RAGEL_LDFLAGS@|${RAGEL_LDFLAGS}|g' \ + -e 's|@RAGEL_LM@|${RAGEL_LM}|g' \ + -e 's|@RAGEL_C_BIN@|${RAGEL_C_BIN}|g' \ + -e 's|@RAGEL_D_BIN@|${RAGEL_D_BIN}|g' \ + -e 's|@RAGEL_JAVA_BIN@|${RAGEL_JAVA_BIN}|g' \ + -e 's|@RAGEL_RUBY_BIN@|${RAGEL_RUBY_BIN}|g' \ + -e 's|@RAGEL_CSHARP_BIN@|${RAGEL_CSHARP_BIN}|g' \ + -e 's|@RAGEL_GO_BIN@|${RAGEL_GO_BIN}|g' \ + -e 's|@RAGEL_OCAML_BIN@|${RAGEL_OCAML_BIN}|g' \ + -e 's|@RAGEL_ASM_BIN@|${RAGEL_ASM_BIN}|g' \ + -e 's|@RAGEL_RUST_BIN@|${RAGEL_RUST_BIN}|g' \ + -e 's|@RAGEL_CRACK_BIN@|${RAGEL_CRACK_BIN}|g' \ + -e 's|@RAGEL_JULIA_BIN@|${RAGEL_JULIA_BIN}|g' \ -e 's|@CRACK_BIN@|${CRACK_BIN}|g' \ -e 's|@CXX@|${CXX}|g' \ -e 's|@CC@|${CC}|g' \ diff --git a/test/aapl.d/Makefile.am b/test/aapl.d/Makefile.am index 206f93b4..c408a36a 100644 --- a/test/aapl.d/Makefile.am +++ b/test/aapl.d/Makefile.am @@ -2,7 +2,7 @@ # Copyright 2001, 2002 Adrian Thurston <thurston@cs.queensu.ca> # -CPPFLAGS = -I ../../aapl +CPPFLAGS = @AAPL_CPPFLAGS@ noinst_PROGRAMS = \ stress_avltree stress_avliter stress_avlmel \ diff --git a/test/colm.mk.in b/test/colm.mk.in index cc096b06..d5c1aa75 100644 --- a/test/colm.mk.in +++ b/test/colm.mk.in @@ -1,4 +1,3 @@ -SUBJECT_BIN = ../../colm/colm -SUBJECT_CPPFLAGS = -I../../colm/include -SUBJECT_LDFLAGS = -L../../colm/.libs -Wl,-rpath,../../colm/.libs -Wl,-rpath,../../../colm/.libs -SUBJECT_LD_LIBRARY_PATH = +SUBJECT_BIN = @COLM_BIN@ +SUBJECT_CPPFLAGS = @COLM_CPPFLAGS@ +SUBJECT_LDFLAGS = @COLM_LDFLAGS@ diff --git a/test/colm.sh.in b/test/colm.sh.in index 6c13465b..07d91f75 100644 --- a/test/colm.sh.in +++ b/test/colm.sh.in @@ -1,4 +1,3 @@ -SUBJECT_BIN="../../colm/colm"; -SUBJECT_CPPFLAGS="-I../../colm/include"; -SUBJECT_LDFLAGS="-L../../colm/.libs -Wl,-rpath,../../colm/.libs -Wl,-rpath,../../../colm/.libs"; -SUBJECT_LD_LIBRARY_PATH=""; +SUBJECT_BIN="@COLM_BIN@" +SUBJECT_CPPFLAGS="@COLM_CPPFLAGS@" +SUBJECT_LDFLAGS="@COLM_LDFLAGS@" diff --git a/test/ragel.d/Makefile.am b/test/ragel.d/Makefile.am index 09ae605e..1f5a678f 100644 --- a/test/ragel.d/Makefile.am +++ b/test/ragel.d/Makefile.am @@ -21,8 +21,8 @@ COLM = ../../colm/colm RAGEL_LM = ../../ragel -COLM_CPPFLAGS = -I../../colm/include -COLM_LDFLAGS = -L../../colm +COLM_xCPPFLAGS = -I../../colm/include +COLM_xLDFLAGS = -L../../colm TESTS = gentests @@ -57,10 +57,10 @@ TRANS_DEPS = \ trans-ocaml.lm trans-ruby.lm \ trans-rust.lm -trans_CPPFLAGS = $(COLM_CPPFLAGS) +trans_CPPFLAGS = $(COLM_xCPPFLAGS) trans_SOURCES = trans.c main.c trans_LDADD = -lcolm -trans_LDFLAGS = $(COLM_LDFLAGS) +trans_LDFLAGS = $(COLM_xLDFLAGS) trans.c: trans.lm $(TRANS_DEPS) $(COLM) -c -b trans_object -I$(RAGEL_LM) -I../../ragel/host-go -o $@ $< diff --git a/test/ragel.d/gentests.sh b/test/ragel.d/gentests.sh index 09c8ec49..1bc55d84 100644 --- a/test/ragel.d/gentests.sh +++ b/test/ragel.d/gentests.sh @@ -14,22 +14,21 @@ TRANS=./trans # Make available to to test directories below us that are not part of this # repository and cannot source one dir up. -export RAGEL_BIN="../../ragel/ragel" -export RAGEL_CPPFLAGS="-I../../ragel/include" -export RAGEL_LDFLAGS="-L../../ragel/.libs" -export LD_LIBRARY_PATH="" - -export RAGEL_C_BIN="../../ragel/host-c/ragel-c" -export RAGEL_D_BIN="../../ragel/host-d/ragel-d" -export RAGEL_JAVA_BIN="../../ragel/host-java/ragel-java" -export RAGEL_RUBY_BIN="../../ragel/host-ruby/ragel-ruby" -export RAGEL_CSHARP_BIN="../../ragel/host-csharp/ragel-csharp" -export RAGEL_GO_BIN="../../ragel/host-go/ragel-go" -export RAGEL_OCAML_BIN="../../ragel/host-ocaml/ragel-ocaml" -export RAGEL_ASM_BIN="../../ragel/host-asm/ragel-asm" -export RAGEL_RUST_BIN="../../ragel/host-rust/ragel-rust" -export RAGEL_CRACK_BIN="../../ragel/host-crack/ragel-crack" -export RAGEL_JULIA_BIN="../../ragel/host-julia/ragel-julia" +export RAGEL_BIN="@RAGEL_BIN@" +export RAGEL_CPPFLAGS="@RAGEL_CPPFLAGS@" +export RAGEL_LDFLAGS="@RAGEL_LDFLAGS@" + +export RAGEL_C_BIN="@RAGEL_C_BIN@" +export RAGEL_D_BIN="@RAGEL_D_BIN@" +export RAGEL_JAVA_BIN="@RAGEL_JAVA_BIN@" +export RAGEL_RUBY_BIN="@RAGEL_RUBY_BIN@" +export RAGEL_CSHARP_BIN="@RAGEL_CSHARP_BIN@" +export RAGEL_GO_BIN="@RAGEL_GO_BIN@" +export RAGEL_OCAML_BIN="@RAGEL_OCAML_BIN@" +export RAGEL_ASM_BIN="@RAGEL_ASM_BIN@" +export RAGEL_RUST_BIN="@RAGEL_RUST_BIN@" +export RAGEL_CRACK_BIN="@RAGEL_CRACK_BIN@" +export RAGEL_JULIA_BIN="@RAGEL_JULIA_BIN@" function sig_exit() { diff --git a/test/ragel.mk.in b/test/ragel.mk.in index 351e160c..7f4bfd99 100644 --- a/test/ragel.mk.in +++ b/test/ragel.mk.in @@ -1,3 +1,3 @@ -RAGEL_BIN = ../../ragel/ragel -RAGEL_CPPFLAGS = -I../../ragel/include -RAGEL_LDFLAGS = -L../../ragel/.libs -Wl,-rpath,../../ragel/.libs -Wl,-rpath,../../../ragel/.libs +RAGEL_BIN = @RAGEL_BIN@ +RAGEL_CPPFLAGS = @RAGEL_CPPFLAGS@ +RAGEL_LDFLAGS = @RAGEL_LDFLAGS@ diff --git a/test/ragel.sh.in b/test/ragel.sh.in index af697641..021055b6 100644 --- a/test/ragel.sh.in +++ b/test/ragel.sh.in @@ -1,3 +1,3 @@ -RAGEL_BIN="../../ragel/ragel"; -RAGEL_CPPFLAGS="-I../../ragel/include"; -RAGEL_LDFLAGS="-I../../ragel/.libs -Wl,-rpath,../../ragel/.libs -Wl,-rpath,../../../ragel/.libs"; +RAGEL_BIN="@RAGEL_BIN@"; +RAGEL_CPPFLAGS="@RAGEL_CPPFLAGS@" +RAGEL_LDFLAGS="@RAGEL_LDFLAGS@" |