From 940fef353e6551f721651db79cb135219191ad9e Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Mon, 16 Dec 2013 17:27:40 +0100 Subject: the beginning of a testsuite --- Makefile | 23 ++++++++++++++++ testsuite/inputs/clean | 7 +++++ testsuite/inputs/default_build | 6 +++++ testsuite/inputs/distclean | 7 +++++ testsuite/locations/separate | 3 +++ testsuite/locations/space | 3 +++ testsuite/run_tests | 58 ++++++++++++++++++++++++++++++++++++++++ testsuite/sources/empty/Makefile | 1 + 8 files changed, 108 insertions(+) create mode 100644 Makefile create mode 100644 testsuite/inputs/clean create mode 100644 testsuite/inputs/default_build create mode 100644 testsuite/inputs/distclean create mode 100644 testsuite/locations/separate create mode 100644 testsuite/locations/space create mode 100755 testsuite/run_tests create mode 100644 testsuite/sources/empty/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4a59d3b --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +# Makefile for running Comfignat's testsuite +# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this makefile +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +include comfignat.mk + +check: + "${srcdir}/testsuite/run_tests" "${srcdir}" "${builddir}" + +clean:: + rm -Rf "${builddir}/testruns" + +base: + echo "You don't build Comfignat. This makefile is for the testsuite." diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean new file mode 100644 index 0000000..ab322cc --- /dev/null +++ b/testsuite/inputs/clean @@ -0,0 +1,7 @@ +cd "${srcdir}" +if [ "${relative_builddir}" != . ] ; then + make configure builddir="${relative_builddir}" + cd "${relative_builddir}" +fi +make +make clean diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build new file mode 100644 index 0000000..7ff31f7 --- /dev/null +++ b/testsuite/inputs/default_build @@ -0,0 +1,6 @@ +cd "${srcdir}" +if [ "${relative_builddir}" != . ] ; then + make configure builddir="${relative_builddir}" + cd "${relative_builddir}" +fi +make diff --git a/testsuite/inputs/distclean b/testsuite/inputs/distclean new file mode 100644 index 0000000..6e1119b --- /dev/null +++ b/testsuite/inputs/distclean @@ -0,0 +1,7 @@ +cd "${srcdir}" +if [ "${relative_builddir}" != . ] ; then + make configure builddir="${relative_builddir}" + cd "${relative_builddir}" +fi +make +make distclean diff --git a/testsuite/locations/separate b/testsuite/locations/separate new file mode 100644 index 0000000..a2fc7f1 --- /dev/null +++ b/testsuite/locations/separate @@ -0,0 +1,3 @@ +srcdir=parent/source +builddir=build +relative_builddir=../../build diff --git a/testsuite/locations/space b/testsuite/locations/space new file mode 100644 index 0000000..577c5e3 --- /dev/null +++ b/testsuite/locations/space @@ -0,0 +1,3 @@ +srcdir="name with whitespace" +builddir=${srcdir} +relative_builddir=. diff --git a/testsuite/run_tests b/testsuite/run_tests new file mode 100755 index 0000000..dfdfe75 --- /dev/null +++ b/testsuite/run_tests @@ -0,0 +1,58 @@ +#!/bin/sh + +# Comfignat's testsuite +# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this program +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +# It is hoped that this program will work in any Posix-compliant shell. + +set -e + +outer_srcdir="$1" +outer_builddir="$2" + +passed=0 +failed=0 + +Comfignat_overriding_absolute_builddir= +Comfignat_overriding_absolute_objdir= +Comfignat_overriding_absolute_stagedir= + +rm -Rf "${outer_builddir}"/testruns + +for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do + for location_file in "${outer_srcdir}"/testsuite/locations/* ; do + for input_script in "${outer_srcdir}"/testsuite/inputs/* ; do + test_name=$(basename "${source_directory}")+$(basename "${location_file}")+$(basename "${input_script}") + testrundir="${outer_builddir}"/testruns/"${test_name}" + mkdir -p "${testrundir}" + cd "${testrundir}" + . "${location_file}" + mkdir -p "${srcdir}" "${builddir}" + cp -RHp "${source_directory}"/* "${srcdir}" + cp -p "${outer_srcdir}"/comfignat.* "${srcdir}" + export srcdir builddir relative_builddir + if sh -e "${input_script}" >output 2>&1 ; then + verdict=PASSED + passed=$((passed + 1)) + else + verdict=FAILED + failed=$((failed + 1)) + fi + echo "${test_name}: ${verdict}" + done + done +done + +echo +echo "passed: ${passed}, failed: ${failed}" +exit ${failed} diff --git a/testsuite/sources/empty/Makefile b/testsuite/sources/empty/Makefile new file mode 100644 index 0000000..7bfdf9f --- /dev/null +++ b/testsuite/sources/empty/Makefile @@ -0,0 +1 @@ +include comfignat.mk -- cgit v1.2.3 From 098259b44d7895e3bb9537edbbd633fd3e0205d5 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Tue, 17 Dec 2013 14:29:11 +0100 Subject: function library for the testcases --- testsuite/inputs/clean | 7 ++----- testsuite/inputs/default_build | 7 ++----- testsuite/inputs/distclean | 7 ++----- testsuite/library | 25 +++++++++++++++++++++++++ testsuite/run_tests | 9 +++++++-- 5 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 testsuite/library diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean index ab322cc..6defe0e 100644 --- a/testsuite/inputs/clean +++ b/testsuite/inputs/clean @@ -1,7 +1,4 @@ -cd "${srcdir}" -if [ "${relative_builddir}" != . ] ; then - make configure builddir="${relative_builddir}" - cd "${relative_builddir}" -fi +. "${library}" +common_setup make make clean diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build index 7ff31f7..1706516 100644 --- a/testsuite/inputs/default_build +++ b/testsuite/inputs/default_build @@ -1,6 +1,3 @@ -cd "${srcdir}" -if [ "${relative_builddir}" != . ] ; then - make configure builddir="${relative_builddir}" - cd "${relative_builddir}" -fi +. "${library}" +common_setup make diff --git a/testsuite/inputs/distclean b/testsuite/inputs/distclean index 6e1119b..76524c3 100644 --- a/testsuite/inputs/distclean +++ b/testsuite/inputs/distclean @@ -1,7 +1,4 @@ -cd "${srcdir}" -if [ "${relative_builddir}" != . ] ; then - make configure builddir="${relative_builddir}" - cd "${relative_builddir}" -fi +. "${library}" +common_setup make make distclean diff --git a/testsuite/library b/testsuite/library new file mode 100644 index 0000000..1302625 --- /dev/null +++ b/testsuite/library @@ -0,0 +1,25 @@ +# function library for Comfignat's testcases +# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +common_setup () { + # When the locations file specifies a separate build directory, initialize + # the build directory and go there. When the source directory is also the + # build directory, just go to that directory. + cd "${srcdir}" + if [ "${relative_builddir}" != . ] ; then + make configure builddir="${relative_builddir}" + cd "${relative_builddir}" + fi +} + + diff --git a/testsuite/run_tests b/testsuite/run_tests index dfdfe75..c559814 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -6,7 +6,7 @@ # This material is provided as is, with absolutely no warranty expressed # or implied. Any use is at your own risk. # -# Permission is hereby granted to use or copy this program +# Permission is hereby granted to use or copy this testsuite # for any purpose, provided the above notices are retained on all copies. # Permission to modify the code and to distribute modified code is granted, # provided the above notices are retained, and a notice that the code was @@ -27,6 +27,12 @@ Comfignat_overriding_absolute_builddir= Comfignat_overriding_absolute_objdir= Comfignat_overriding_absolute_stagedir= +# variables that the testcases need: +export library srcdir builddir relative_builddir + +# function library for the testcases: +library="${outer_srcdir}"/testsuite/library + rm -Rf "${outer_builddir}"/testruns for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do @@ -40,7 +46,6 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do mkdir -p "${srcdir}" "${builddir}" cp -RHp "${source_directory}"/* "${srcdir}" cp -p "${outer_srcdir}"/comfignat.* "${srcdir}" - export srcdir builddir relative_builddir if sh -e "${input_script}" >output 2>&1 ; then verdict=PASSED passed=$((passed + 1)) -- cgit v1.2.3 From 501f9888bff97d68adff2bfde0da7869c04d7e79 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Thu, 19 Dec 2013 01:02:34 +0100 Subject: some code to check files after tests --- testsuite/inputs/clean | 1 + testsuite/inputs/default_build | 1 + testsuite/library | 9 +++++++ testsuite/run_tests | 56 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean index 6defe0e..8f443d5 100644 --- a/testsuite/inputs/clean +++ b/testsuite/inputs/clean @@ -1,4 +1,5 @@ . "${library}" common_setup +expect_configuration make make clean diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build index 1706516..cd85823 100644 --- a/testsuite/inputs/default_build +++ b/testsuite/inputs/default_build @@ -1,3 +1,4 @@ . "${library}" common_setup +expect_configuration make diff --git a/testsuite/library b/testsuite/library index 1302625..2d16973 100644 --- a/testsuite/library +++ b/testsuite/library @@ -17,9 +17,18 @@ common_setup () { # build directory, just go to that directory. cd "${srcdir}" if [ "${relative_builddir}" != . ] ; then + echo "${builddir}"/Makefile >>"${file_list}" make configure builddir="${relative_builddir}" cd "${relative_builddir}" fi } +expect_configuration () { + # If "always" is passed, the testcase is always expected to leave a + # configuration file. If this is called without "always", a configuration + # file is expected only in a separate build directory. + if [ "$1" = always -o "${relative_builddir}" != . ] ; then + echo "${builddir}"/comfignat_configuration.mk >>"${file_list}" + fi +} diff --git a/testsuite/run_tests b/testsuite/run_tests index c559814..57364b3 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -17,40 +17,88 @@ set -e +# Get the command line parameters. outer_srcdir="$1" outer_builddir="$2" +# Initialize counters. passed=0 failed=0 +# The testcases should use their own build directories, not the one of the Make +# process that invoked the testsuite. Comfignat_overriding_absolute_builddir= Comfignat_overriding_absolute_objdir= Comfignat_overriding_absolute_stagedir= # variables that the testcases need: -export library srcdir builddir relative_builddir +export library # absolute pathname of function library +export file_list # absolute pathname of list of expected files +export srcdir # testcase's source directory relative to testrundir +export builddir # testcase's build directory relative to testrundir +export relative_builddir # testcase's build directory relative to srcdir # function library for the testcases: library="${outer_srcdir}"/testsuite/library +# Clean out any old test results. rm -Rf "${outer_builddir}"/testruns for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do for location_file in "${outer_srcdir}"/testsuite/locations/* ; do for input_script in "${outer_srcdir}"/testsuite/inputs/* ; do + + # Compose the name of the combined test case. test_name=$(basename "${source_directory}")+$(basename "${location_file}")+$(basename "${input_script}") testrundir="${outer_builddir}"/testruns/"${test_name}" + file_list="${testrundir}"/files.expected mkdir -p "${testrundir}" cd "${testrundir}" + + # Get the source and build directory names. . "${location_file}" - mkdir -p "${srcdir}" "${builddir}" + mkdir -p "${srcdir}" + if [ "${relative_builddir}" != . ] ; then + echo "${builddir}" >>files.expected + fi + + # Populate the source directory. cp -RHp "${source_directory}"/* "${srcdir}" cp -p "${outer_srcdir}"/comfignat.* "${srcdir}" + find "${srcdir}" >>files.expected + + # Run the test. if sh -e "${input_script}" >output 2>&1 ; then - verdict=PASSED - passed=$((passed + 1)) + + # Check that the expected files and no others are present. + LC_COLLATE=C sort -o files.expected files.expected + if find "${srcdir}" "${builddir}" | LC_COLLATE=C sort | diff files.expected - >files.diff ; then + + # Check that the source files haven't been mangled. + cd "${source_directory}" + find . -type f ! -exec cmp -s "{}" "${testrundir}/${srcdir}/{}" \; -print >> "${testrundir}"/changed_sources + cd "${outer_srcdir}" + for file in comfignat.* ; do + if ! cmp -s ${file} "${testrundir}/${srcdir}/${file}" ; then + echo ${file} >> "${testrundir}"/changed_sources + fi + done + if [ -s "${testrundir}"/changed_sources ] ; then + verdict=FAILED + else + verdict=PASSED + fi + else + verdict=FAILED + fi else + # The test returned an error code. verdict=FAILED + fi + + if [ ${verdict} = PASSED ] ; then + passed=$((passed + 1)) + else failed=$((failed + 1)) fi echo "${test_name}: ${verdict}" -- cgit v1.2.3 From cfde013bbd87fb30ced9c2c9fc4f0d1122c9c569 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Thu, 19 Dec 2013 09:29:52 +0100 Subject: Made run_test load the function library for the testcases. --- testsuite/inputs/clean | 1 - testsuite/inputs/default_build | 1 - testsuite/inputs/distclean | 1 - testsuite/run_tests | 12 +++++------- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean index 8f443d5..a0d18f9 100644 --- a/testsuite/inputs/clean +++ b/testsuite/inputs/clean @@ -1,4 +1,3 @@ -. "${library}" common_setup expect_configuration make diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build index cd85823..af01356 100644 --- a/testsuite/inputs/default_build +++ b/testsuite/inputs/default_build @@ -1,4 +1,3 @@ -. "${library}" common_setup expect_configuration make diff --git a/testsuite/inputs/distclean b/testsuite/inputs/distclean index 76524c3..6e5e472 100644 --- a/testsuite/inputs/distclean +++ b/testsuite/inputs/distclean @@ -1,4 +1,3 @@ -. "${library}" common_setup make make distclean diff --git a/testsuite/run_tests b/testsuite/run_tests index 57364b3..38d6562 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -32,15 +32,11 @@ Comfignat_overriding_absolute_objdir= Comfignat_overriding_absolute_stagedir= # variables that the testcases need: -export library # absolute pathname of function library export file_list # absolute pathname of list of expected files export srcdir # testcase's source directory relative to testrundir export builddir # testcase's build directory relative to testrundir export relative_builddir # testcase's build directory relative to srcdir -# function library for the testcases: -library="${outer_srcdir}"/testsuite/library - # Clean out any old test results. rm -Rf "${outer_builddir}"/testruns @@ -48,7 +44,7 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do for location_file in "${outer_srcdir}"/testsuite/locations/* ; do for input_script in "${outer_srcdir}"/testsuite/inputs/* ; do - # Compose the name of the combined test case. + # Compose the name of the combined testcase. test_name=$(basename "${source_directory}")+$(basename "${location_file}")+$(basename "${input_script}") testrundir="${outer_builddir}"/testruns/"${test_name}" file_list="${testrundir}"/files.expected @@ -67,8 +63,10 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do cp -p "${outer_srcdir}"/comfignat.* "${srcdir}" find "${srcdir}" >>files.expected - # Run the test. - if sh -e "${input_script}" >output 2>&1 ; then + # Run the testcase in a child process. + # The child process first loads the function library and then runs the + # input script. + if sh -e -c ". ${outer_srcdir}/testsuite/library; . ${input_script}" >output 2>&1 ; then # Check that the expected files and no others are present. LC_COLLATE=C sort -o files.expected files.expected -- cgit v1.2.3 From f06e5dc1665c288071ade1d403f7e7eb4275ae64 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Thu, 19 Dec 2013 09:29:59 +0100 Subject: better failure reporting --- testsuite/run_tests | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/testsuite/run_tests b/testsuite/run_tests index 38d6562..35fcc23 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -37,6 +37,27 @@ export srcdir # testcase's source directory relative to testrundir export builddir # testcase's build directory relative to testrundir export relative_builddir # testcase's build directory relative to srcdir + +pass () { + # Report the current testcase as passed. + echo "${test_name}: PASSED" + passed=$((passed + 1)) +} + + +fail () { + # Report the current testcase as failed. + # Parameters: + # 1: a message about what went wrong + # 2: the name of a file with details about the error + echo "${test_name}: FAILED" + echo "$1" + cat "$2" + echo + failed=$((failed + 1)) +} + + # Clean out any old test results. rm -Rf "${outer_builddir}"/testruns @@ -82,24 +103,17 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do fi done if [ -s "${testrundir}"/changed_sources ] ; then - verdict=FAILED + fail "Changed soure files:" "${testrundir}"/changed_sources else - verdict=PASSED + pass fi else - verdict=FAILED + fail "Difference from the list of expected files:" files.diff fi else - # The test returned an error code. - verdict=FAILED + fail "Error code: $?" output fi - if [ ${verdict} = PASSED ] ; then - passed=$((passed + 1)) - else - failed=$((failed + 1)) - fi - echo "${test_name}: ${verdict}" done done done -- cgit v1.2.3 From dfc4c5cdce886fa7261258a1b40d463ce5c39de1 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Thu, 26 Dec 2013 20:29:08 +0100 Subject: Don't echo the echo command. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4a59d3b..2306c69 100644 --- a/Makefile +++ b/Makefile @@ -20,4 +20,4 @@ clean:: rm -Rf "${builddir}/testruns" base: - echo "You don't build Comfignat. This makefile is for the testsuite." + @echo "You don't build Comfignat. This makefile is for the testsuite." -- cgit v1.2.3 From 5d900ea8ccb660d4d3bb9aaa08464fb9aae081f9 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Fri, 31 Jan 2014 08:32:17 +0100 Subject: Check that the right generated files exist. --- testsuite/inputs/clean | 2 +- testsuite/inputs/default_build | 3 +- testsuite/library | 60 ++++++++++++++++++----- testsuite/run_tests | 12 +++-- testsuite/sources/empty/generated_files | 0 testsuite/sources/library_1/Makefile | 20 ++++++++ testsuite/sources/library_1/build_testcase.gpr.gp | 34 +++++++++++++ testsuite/sources/library_1/generated_files | 7 +++ testsuite/sources/library_1/testcase.adb | 24 +++++++++ testsuite/sources/library_1/testcase.ads | 18 +++++++ testsuite/sources/library_1/testcase.gpr.gp | 27 ++++++++++ 11 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 testsuite/sources/empty/generated_files create mode 100644 testsuite/sources/library_1/Makefile create mode 100644 testsuite/sources/library_1/build_testcase.gpr.gp create mode 100644 testsuite/sources/library_1/generated_files create mode 100644 testsuite/sources/library_1/testcase.adb create mode 100644 testsuite/sources/library_1/testcase.ads create mode 100644 testsuite/sources/library_1/testcase.gpr.gp diff --git a/testsuite/inputs/clean b/testsuite/inputs/clean index a0d18f9..2b37fec 100644 --- a/testsuite/inputs/clean +++ b/testsuite/inputs/clean @@ -1,4 +1,4 @@ -common_setup expect_configuration +common_setup make make clean diff --git a/testsuite/inputs/default_build b/testsuite/inputs/default_build index af01356..635b842 100644 --- a/testsuite/inputs/default_build +++ b/testsuite/inputs/default_build @@ -1,3 +1,4 @@ -common_setup expect_configuration +expect_generated_files +common_setup make diff --git a/testsuite/library b/testsuite/library index 2d16973..c665c71 100644 --- a/testsuite/library +++ b/testsuite/library @@ -1,5 +1,5 @@ # function library for Comfignat's testcases -# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se +# Copyright 2013 - 2014 B. Persson, Bjorn@Rombobeorn.se # # This material is provided as is, with absolutely no warranty expressed # or implied. Any use is at your own risk. @@ -11,6 +11,54 @@ # modified is included with the above copyright notice. +# These directory variables mustn't be conveyed from Comfignat, because then +# the testsuite would rely on the same thing that it's supposed to test. +prefix=/usr/local +exec_prefix=${prefix} +datarootdir=${prefix}/share +bindir=${exec_prefix}/bin +libexecdir=${exec_prefix}/libexec +includedir=${prefix}/include +libdir=${exec_prefix}/lib +alidir=${libdir} +gprdir=${datarootdir}/gpr +stagedir=stage +stage_bindir=${stagedir}${bindir} +stage_libexecdir=${stagedir}${libexecdir} +stage_includedir=${stagedir}${includedir} +stage_libdir=${stagedir}${libdir} +stage_alidir=${stagedir}${alidir} +stage_gprdir=${stagedir}${gprdir} + + +expect_configuration () { + # If "always" is passed, the testcase is always expected to leave a + # configuration file. If this is called without "always", a configuration + # file is expected only in a separate build directory. + if [ "$1" = always -o "${relative_builddir}" != . ] ; then + echo "${builddir}"/comfignat_configuration.mk >>"${file_list}" + fi +} + + +expect_generated_files () { + # The testcase is expected to generate files which are listed in the file + # generated_files. The list is whitespace-separated and may contain shell + # variable references. + for file in $(cat "${srcdir}"/generated_files) ; do + # Expand variables in the string to get the pathname. + eval file="${file}" + # Write the pathname and its parent directories to the file list. + # Chop off pathname components until only "." remains, but also avoid + # looping forever if the final residue turns out to be "/" or "//". + while [ "${file}" != . -a "${file}" != / -a "${file}" != // ] ; do + echo "${builddir}/${file}" >>"${file_list}" + file=$(dirname "${file}") + done + done +} + + common_setup () { # When the locations file specifies a separate build directory, initialize # the build directory and go there. When the source directory is also the @@ -22,13 +70,3 @@ common_setup () { cd "${relative_builddir}" fi } - - -expect_configuration () { - # If "always" is passed, the testcase is always expected to leave a - # configuration file. If this is called without "always", a configuration - # file is expected only in a separate build directory. - if [ "$1" = always -o "${relative_builddir}" != . ] ; then - echo "${builddir}"/comfignat_configuration.mk >>"${file_list}" - fi -} diff --git a/testsuite/run_tests b/testsuite/run_tests index 35fcc23..f440f8d 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -1,7 +1,7 @@ #!/bin/sh # Comfignat's testsuite -# Copyright 2013 B. Persson, Bjorn@Rombobeorn.se +# Copyright 2013 - 2014 B. Persson, Bjorn@Rombobeorn.se # # This material is provided as is, with absolutely no warranty expressed # or implied. Any use is at your own risk. @@ -90,8 +90,14 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do if sh -e -c ". ${outer_srcdir}/testsuite/library; . ${input_script}" >output 2>&1 ; then # Check that the expected files and no others are present. - LC_COLLATE=C sort -o files.expected files.expected - if find "${srcdir}" "${builddir}" | LC_COLLATE=C sort | diff files.expected - >files.diff ; then + # Sort the list of expected files and remove duplicates. + LC_COLLATE=C sort -u -o files.expected files.expected + # List all files in the build directory except for the directory + # where intermediate files are suposed to be. List the files in the + # source directory separately if the directories are separate. Sort + # the combined list the same way as the list of expected files is + # sorted. Then compare the lists. + if ( find "${builddir}" | grep -v ^"${builddir}"/obj ; test "${relative_builddir}" != . && find "${srcdir}" ) | LC_COLLATE=C sort | diff files.expected - >files.diff ; then # Check that the source files haven't been mangled. cd "${source_directory}" diff --git a/testsuite/sources/empty/generated_files b/testsuite/sources/empty/generated_files new file mode 100644 index 0000000..e69de29 diff --git a/testsuite/sources/library_1/Makefile b/testsuite/sources/library_1/Makefile new file mode 100644 index 0000000..f0c587b --- /dev/null +++ b/testsuite/sources/library_1/Makefile @@ -0,0 +1,20 @@ +# part of Comfignat's testsuite +# Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +include comfignat.mk + +options = frobnicate +frobnicate = false + +build_GPRs = build_testcase.gpr +usage_GPRs = testcase.gpr diff --git a/testsuite/sources/library_1/build_testcase.gpr.gp b/testsuite/sources/library_1/build_testcase.gpr.gp new file mode 100644 index 0000000..abfa866 --- /dev/null +++ b/testsuite/sources/library_1/build_testcase.gpr.gp @@ -0,0 +1,34 @@ +-- Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with "comfignat.gpr"; + +library project Build_Testcase is + + #if Frobnicate then + Frob_Flag := "-frob"; + #else + Frob_Flag := ""; + #end if; + + for Library_Name use "testcase"; + for Library_Kind use "dynamic"; + for Library_Version use "libtestcase" & Frob_Flag & ".so.1"; + for Library_Interface use ("Testcase"); + for Source_Dirs use ($Srcdir); + for Object_Dir use Comfignat.Objdir; + for Library_Src_Dir use Comfignat.Stage_Includedir & "/testcase"; + for Library_Dir use Comfignat.Stage_Libdir; + for Library_ALI_Dir use Comfignat.Stage_Alidir & "/testcase"; + +end Build_Testcase; diff --git a/testsuite/sources/library_1/generated_files b/testsuite/sources/library_1/generated_files new file mode 100644 index 0000000..2acba75 --- /dev/null +++ b/testsuite/sources/library_1/generated_files @@ -0,0 +1,7 @@ +build_testcase.gpr +comfignat.gpr +${stage_includedir}/testcase/testcase.ads +${stage_libdir}/libtestcase.so.1 +${stage_libdir}/libtestcase.so +${stage_alidir}/testcase/testcase.ali +${stage_gprdir}/testcase.gpr diff --git a/testsuite/sources/library_1/testcase.adb b/testsuite/sources/library_1/testcase.adb new file mode 100644 index 0000000..df96cc3 --- /dev/null +++ b/testsuite/sources/library_1/testcase.adb @@ -0,0 +1,24 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with Ada.Calendar; use Ada.Calendar; +with Ada.Text_IO; use Ada.Text_IO; + +package body Testcase is + + function Year return String is + begin + return Year(Clock)'Img; + end Year; + +end Testcase; diff --git a/testsuite/sources/library_1/testcase.ads b/testsuite/sources/library_1/testcase.ads new file mode 100644 index 0000000..d2646b8 --- /dev/null +++ b/testsuite/sources/library_1/testcase.ads @@ -0,0 +1,18 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +package Testcase is + + function Year return String; + +end Testcase; diff --git a/testsuite/sources/library_1/testcase.gpr.gp b/testsuite/sources/library_1/testcase.gpr.gp new file mode 100644 index 0000000..de4645c --- /dev/null +++ b/testsuite/sources/library_1/testcase.gpr.gp @@ -0,0 +1,27 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +#if Directories_GPR'Defined then +with $Directories_GPR; +#end if; + +library project Testcase is + + for Library_Name use "testcase"; + for Library_Kind use "dynamic"; + for Source_Dirs use ($Includedir & "/testcase"); + for Library_Dir use $Libdir; + for Library_ALI_Dir use $Alidir & "/testcase"; + for Externally_Built use "true"; + +end Testcase; -- cgit v1.2.3 From aedfc53e9a783b8cc1091f5a6d6bb15317616646 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Sat, 1 Feb 2014 09:58:52 +0100 Subject: more testcases --- testsuite/inputs/build_with_Gnatmake | 4 +++ testsuite/inputs/configure_and_build | 8 +++++ testsuite/inputs/configure_and_clean | 13 ++++++++ testsuite/inputs/directories_project | 5 +++ testsuite/inputs/relocatable | 4 +++ testsuite/library | 40 +++++++++++------------ testsuite/run_tests | 11 ++++--- testsuite/sources/library_1/build_testcase.gpr.gp | 2 +- testsuite/sources/library_1/generated_files | 2 +- testsuite/sources/program_1/Makefile | 16 +++++++++ testsuite/sources/program_1/build_testcase.gpr | 20 ++++++++++++ testsuite/sources/program_1/generated_files | 2 ++ testsuite/sources/program_1/testcase.adb | 20 ++++++++++++ testsuite/test_directories.gpr | 9 +++++ 14 files changed, 130 insertions(+), 26 deletions(-) create mode 100644 testsuite/inputs/build_with_Gnatmake create mode 100644 testsuite/inputs/configure_and_build create mode 100644 testsuite/inputs/configure_and_clean create mode 100644 testsuite/inputs/directories_project create mode 100644 testsuite/inputs/relocatable create mode 100644 testsuite/sources/program_1/Makefile create mode 100644 testsuite/sources/program_1/build_testcase.gpr create mode 100644 testsuite/sources/program_1/generated_files create mode 100644 testsuite/sources/program_1/testcase.adb create mode 100644 testsuite/test_directories.gpr diff --git a/testsuite/inputs/build_with_Gnatmake b/testsuite/inputs/build_with_Gnatmake new file mode 100644 index 0000000..124f632 --- /dev/null +++ b/testsuite/inputs/build_with_Gnatmake @@ -0,0 +1,4 @@ +expect_configuration +expect_generated_files +common_setup +GNAT_BUILDER=gnatmake make diff --git a/testsuite/inputs/configure_and_build b/testsuite/inputs/configure_and_build new file mode 100644 index 0000000..3b4a060 --- /dev/null +++ b/testsuite/inputs/configure_and_build @@ -0,0 +1,8 @@ +prefix=/usr +libdir=/usr/lib64 +frobnicate=true +expect_configuration always +expect_generated_files +common_setup +make configure prefix="${prefix}" libdir="${libdir}" frobnicate=true +make diff --git a/testsuite/inputs/configure_and_clean b/testsuite/inputs/configure_and_clean new file mode 100644 index 0000000..ba9b640 --- /dev/null +++ b/testsuite/inputs/configure_and_clean @@ -0,0 +1,13 @@ +expect_configuration always +common_setup +make configure bindir='${prefix}/special' +make clean +expected='bindir = ${prefix}/special' +conf=$(make show_configuration --no-print-directory) +if [ "${conf}" != "${expected}" ] ; then + echo "Expected configuration:" >&2 + echo "${expected}" >&2 + echo "Configuration found:" >&2 + echo "${conf}" >&2 + exit 1 +fi diff --git a/testsuite/inputs/directories_project b/testsuite/inputs/directories_project new file mode 100644 index 0000000..128e893 --- /dev/null +++ b/testsuite/inputs/directories_project @@ -0,0 +1,5 @@ +prefix=/opt/comfignat_test +expect_configuration +expect_generated_files +common_setup +make dirgpr="${dirgpr}" gprdir="${gprdir}" diff --git a/testsuite/inputs/relocatable b/testsuite/inputs/relocatable new file mode 100644 index 0000000..a060390 --- /dev/null +++ b/testsuite/inputs/relocatable @@ -0,0 +1,4 @@ +expect_configuration +expect_generated_files +common_setup +make relocatable_package=true diff --git a/testsuite/library b/testsuite/library index c665c71..4482215 100644 --- a/testsuite/library +++ b/testsuite/library @@ -11,26 +11,6 @@ # modified is included with the above copyright notice. -# These directory variables mustn't be conveyed from Comfignat, because then -# the testsuite would rely on the same thing that it's supposed to test. -prefix=/usr/local -exec_prefix=${prefix} -datarootdir=${prefix}/share -bindir=${exec_prefix}/bin -libexecdir=${exec_prefix}/libexec -includedir=${prefix}/include -libdir=${exec_prefix}/lib -alidir=${libdir} -gprdir=${datarootdir}/gpr -stagedir=stage -stage_bindir=${stagedir}${bindir} -stage_libexecdir=${stagedir}${libexecdir} -stage_includedir=${stagedir}${includedir} -stage_libdir=${stagedir}${libdir} -stage_alidir=${stagedir}${alidir} -stage_gprdir=${stagedir}${gprdir} - - expect_configuration () { # If "always" is passed, the testcase is always expected to leave a # configuration file. If this is called without "always", a configuration @@ -45,6 +25,26 @@ expect_generated_files () { # The testcase is expected to generate files which are listed in the file # generated_files. The list is whitespace-separated and may contain shell # variable references. + + # These directory variables mustn't be conveyed from Comfignat, because then + # the testsuite would rely on the same thing that it's supposed to test. + prefix=${prefix:-/usr/local} + exec_prefix=${exec_prefix:-${prefix}} + datarootdir=${datarootdir:-${prefix}/share} + bindir=${bindir:-${exec_prefix}/bin} + libexecdir=${libexecdir:-${exec_prefix}/libexec} + includedir=${includedir:-${prefix}/include} + libdir=${libdir:-${exec_prefix}/lib} + alidir=${alidir:-${libdir}} + gprdir=${gprdir:-${datarootdir}/gpr} + stagedir=stage + stage_bindir=${stagedir}${bindir} + stage_libexecdir=${stagedir}${libexecdir} + stage_includedir=${stagedir}${includedir} + stage_libdir=${stagedir}${libdir} + stage_alidir=${stagedir}${alidir} + stage_gprdir=${stagedir}${gprdir} + for file in $(cat "${srcdir}"/generated_files) ; do # Expand variables in the string to get the pathname. eval file="${file}" diff --git a/testsuite/run_tests b/testsuite/run_tests index f440f8d..06e9c4c 100755 --- a/testsuite/run_tests +++ b/testsuite/run_tests @@ -21,6 +21,8 @@ set -e outer_srcdir="$1" outer_builddir="$2" +testsuitedir="${outer_srcdir}"/testsuite + # Initialize counters. passed=0 failed=0 @@ -36,6 +38,7 @@ export file_list # absolute pathname of list of expected files export srcdir # testcase's source directory relative to testrundir export builddir # testcase's build directory relative to testrundir export relative_builddir # testcase's build directory relative to srcdir +export dirgpr="${testsuitedir}"/test_directories.gpr pass () { @@ -61,9 +64,9 @@ fail () { # Clean out any old test results. rm -Rf "${outer_builddir}"/testruns -for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do - for location_file in "${outer_srcdir}"/testsuite/locations/* ; do - for input_script in "${outer_srcdir}"/testsuite/inputs/* ; do +for source_directory in "${testsuitedir}"/sources/* ; do + for location_file in "${testsuitedir}"/locations/* ; do + for input_script in "${testsuitedir}"/inputs/* ; do # Compose the name of the combined testcase. test_name=$(basename "${source_directory}")+$(basename "${location_file}")+$(basename "${input_script}") @@ -87,7 +90,7 @@ for source_directory in "${outer_srcdir}"/testsuite/sources/* ; do # Run the testcase in a child process. # The child process first loads the function library and then runs the # input script. - if sh -e -c ". ${outer_srcdir}/testsuite/library; . ${input_script}" >output 2>&1 ; then + if sh -e -c ". ${testsuitedir}/library; . ${input_script}" >output 2>&1 ; then # Check that the expected files and no others are present. # Sort the list of expected files and remove duplicates. diff --git a/testsuite/sources/library_1/build_testcase.gpr.gp b/testsuite/sources/library_1/build_testcase.gpr.gp index abfa866..5861788 100644 --- a/testsuite/sources/library_1/build_testcase.gpr.gp +++ b/testsuite/sources/library_1/build_testcase.gpr.gp @@ -1,4 +1,4 @@ --- Comfignat's testsuite +-- part of Comfignat's testsuite -- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se -- -- This material is provided as is, with absolutely no warranty expressed diff --git a/testsuite/sources/library_1/generated_files b/testsuite/sources/library_1/generated_files index 2acba75..525613f 100644 --- a/testsuite/sources/library_1/generated_files +++ b/testsuite/sources/library_1/generated_files @@ -1,7 +1,7 @@ build_testcase.gpr comfignat.gpr ${stage_includedir}/testcase/testcase.ads -${stage_libdir}/libtestcase.so.1 +${stage_libdir}/libtestcase${frobnicate:+-frob}.so.1 ${stage_libdir}/libtestcase.so ${stage_alidir}/testcase/testcase.ali ${stage_gprdir}/testcase.gpr diff --git a/testsuite/sources/program_1/Makefile b/testsuite/sources/program_1/Makefile new file mode 100644 index 0000000..c5f8e5c --- /dev/null +++ b/testsuite/sources/program_1/Makefile @@ -0,0 +1,16 @@ +# part of Comfignat's testsuite +# Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +include comfignat.mk + +build_GPRs = build_testcase.gpr diff --git a/testsuite/sources/program_1/build_testcase.gpr b/testsuite/sources/program_1/build_testcase.gpr new file mode 100644 index 0000000..912115b --- /dev/null +++ b/testsuite/sources/program_1/build_testcase.gpr @@ -0,0 +1,20 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with "comfignat.gpr"; + +standard project Build_Testcase is + for Main use ("testcase"); + for Object_Dir use Comfignat.Objdir; + for Exec_Dir use Comfignat.Stage_Bindir; +end Build_Testcase; diff --git a/testsuite/sources/program_1/generated_files b/testsuite/sources/program_1/generated_files new file mode 100644 index 0000000..cfccc4c --- /dev/null +++ b/testsuite/sources/program_1/generated_files @@ -0,0 +1,2 @@ +comfignat.gpr +${stage_bindir}/testcase diff --git a/testsuite/sources/program_1/testcase.adb b/testsuite/sources/program_1/testcase.adb new file mode 100644 index 0000000..4121845 --- /dev/null +++ b/testsuite/sources/program_1/testcase.adb @@ -0,0 +1,20 @@ +-- part of Comfignat's testsuite +-- Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +-- +-- This material is provided as is, with absolutely no warranty expressed +-- or implied. Any use is at your own risk. +-- +-- Permission is hereby granted to use or copy this testsuite +-- for any purpose, provided the above notices are retained on all copies. +-- Permission to modify the code and to distribute modified code is granted, +-- provided the above notices are retained, and a notice that the code was +-- modified is included with the above copyright notice. + + +with Ada.Calendar; use Ada.Calendar; +with Ada.Text_IO; use Ada.Text_IO; + +procedure Testcase is +begin + Put_Line(Year(Clock)'Img); +end Testcase; diff --git a/testsuite/test_directories.gpr b/testsuite/test_directories.gpr new file mode 100644 index 0000000..e402a25 --- /dev/null +++ b/testsuite/test_directories.gpr @@ -0,0 +1,9 @@ +abstract project Test_Directories is + Hardware_Platform := "multivac"; + Bindir := "/opt/comfignat_test/bin"; + Libexecdir := "/opt/comfignat_test/libexec"; + Includedir := "/opt/comfignat_test/include"; + Libdir := "/opt/comfignat_test/lib"; + Alidir := Libdir; + Archincludedir := Libdir & "/include"; +end Test_Directories; -- cgit v1.2.3 From 4fc4e09e9b869646d06715d34a307ea7dbf1575e Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Sat, 1 Feb 2014 10:11:15 +0100 Subject: Removed the tab character. Apparently tabs are forbidden in strings in GNAT project files. --- testsuite/locations/space | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/locations/space b/testsuite/locations/space index 577c5e3..8323fa2 100644 --- a/testsuite/locations/space +++ b/testsuite/locations/space @@ -1,3 +1,3 @@ -srcdir="name with whitespace" -builddir=${srcdir} +srcdir="name with spaces" +builddir="${srcdir}" relative_builddir=. -- cgit v1.2.3 From 196afc75a68b7e6557b56d7cc22c37a80c09ccf7 Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Sat, 1 Feb 2014 11:34:30 +0100 Subject: Test variable conveyance to a sub-Make. --- testsuite/inputs/directories_project | 2 +- testsuite/sources/library_1/Makefile | 5 +++++ testsuite/sources/library_1/generated_files | 1 + testsuite/sources/library_1/subdir/Makefile | 15 +++++++++++++++ testsuite/sources/library_1/subdir/helper/Makefile | 19 +++++++++++++++++++ testsuite/sources/library_1/subdir/helper/script | 3 +++ 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 testsuite/sources/library_1/subdir/Makefile create mode 100644 testsuite/sources/library_1/subdir/helper/Makefile create mode 100755 testsuite/sources/library_1/subdir/helper/script diff --git a/testsuite/inputs/directories_project b/testsuite/inputs/directories_project index 128e893..e477a8d 100644 --- a/testsuite/inputs/directories_project +++ b/testsuite/inputs/directories_project @@ -2,4 +2,4 @@ prefix=/opt/comfignat_test expect_configuration expect_generated_files common_setup -make dirgpr="${dirgpr}" gprdir="${gprdir}" +make dirgpr="${dirgpr}" gprdir="${gprdir}" libexecdir="${libexecdir}" diff --git a/testsuite/sources/library_1/Makefile b/testsuite/sources/library_1/Makefile index f0c587b..4047099 100644 --- a/testsuite/sources/library_1/Makefile +++ b/testsuite/sources/library_1/Makefile @@ -18,3 +18,8 @@ frobnicate = false build_GPRs = build_testcase.gpr usage_GPRs = testcase.gpr + +submake: + @${MAKE} --directory=${srcdir}/subdir + +build: submake diff --git a/testsuite/sources/library_1/generated_files b/testsuite/sources/library_1/generated_files index 525613f..4ff4941 100644 --- a/testsuite/sources/library_1/generated_files +++ b/testsuite/sources/library_1/generated_files @@ -5,3 +5,4 @@ ${stage_libdir}/libtestcase${frobnicate:+-frob}.so.1 ${stage_libdir}/libtestcase.so ${stage_alidir}/testcase/testcase.ali ${stage_gprdir}/testcase.gpr +${stage_libexecdir}/testcase/script diff --git a/testsuite/sources/library_1/subdir/Makefile b/testsuite/sources/library_1/subdir/Makefile new file mode 100644 index 0000000..9434d2d --- /dev/null +++ b/testsuite/sources/library_1/subdir/Makefile @@ -0,0 +1,15 @@ +# part of Comfignat's testsuite +# Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +submake: + @${MAKE} --directory=helper diff --git a/testsuite/sources/library_1/subdir/helper/Makefile b/testsuite/sources/library_1/subdir/helper/Makefile new file mode 100644 index 0000000..71d0399 --- /dev/null +++ b/testsuite/sources/library_1/subdir/helper/Makefile @@ -0,0 +1,19 @@ +# part of Comfignat's testsuite +# Copyright 2014 B. Persson, Bjorn@Rombobeorn.se +# +# This material is provided as is, with absolutely no warranty expressed +# or implied. Any use is at your own risk. +# +# Permission is hereby granted to use or copy this testsuite +# for any purpose, provided the above notices are retained on all copies. +# Permission to modify the code and to distribute modified code is granted, +# provided the above notices are retained, and a notice that the code was +# modified is included with the above copyright notice. + + +include comfignat.mk + +build: ${stage_libexecdir}/testcase/script + +${stage_libexecdir}/testcase/script: script | ${stage_libexecdir}/testcase/ + cp -p $< $@ diff --git a/testsuite/sources/library_1/subdir/helper/script b/testsuite/sources/library_1/subdir/helper/script new file mode 100755 index 0000000..f013b39 --- /dev/null +++ b/testsuite/sources/library_1/subdir/helper/script @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Hi ho!" -- cgit v1.2.3 From 16639abaf4bc45b92d6ac70e25d457412c1a11bb Mon Sep 17 00:00:00 2001 From: Björn Persson Date: Sun, 2 Feb 2014 07:53:36 +0100 Subject: Fixed inclusion. --- testsuite/sources/library_1/subdir/helper/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/sources/library_1/subdir/helper/Makefile b/testsuite/sources/library_1/subdir/helper/Makefile index 71d0399..f9ec257 100644 --- a/testsuite/sources/library_1/subdir/helper/Makefile +++ b/testsuite/sources/library_1/subdir/helper/Makefile @@ -11,7 +11,7 @@ # modified is included with the above copyright notice. -include comfignat.mk +include ../../comfignat.mk build: ${stage_libexecdir}/testcase/script -- cgit v1.2.3