From b4105e8dea0f4aaaefbbd5a5dce344a939e736dc Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Mon, 18 Jun 2018 15:01:47 -0400 Subject: doc: Adding part 3 of the getting started tutorial: autotools element This part of the tutorial uses a lot of the work from Phil Dawson and James Ennis, and uses their example submitted on merge request 499 as a basis to introduce the user to yaml composition and variable resolution. This is a part of issue #103 --- doc/examples/autotools/elements/base.bst | 5 + doc/examples/autotools/elements/base/alpine.bst | 13 ++ doc/examples/autotools/elements/hello.bst | 21 +++ doc/examples/autotools/project.conf | 13 ++ doc/sessions/autotools.run | 20 +++ doc/source/sessions-stored/autotools-build.html | 135 +++++++++++++++++++ doc/source/sessions-stored/autotools-shell.html | 23 ++++ .../sessions-stored/autotools-show-variables.html | 67 ++++++++++ doc/source/tutorial/autotools.rst | 146 +++++++++++++++++++++ doc/source/using_tutorial.rst | 1 + tests/examples/__init__.py | 0 tests/examples/autotools.py | 47 +++++++ 12 files changed, 491 insertions(+) create mode 100644 doc/examples/autotools/elements/base.bst create mode 100644 doc/examples/autotools/elements/base/alpine.bst create mode 100644 doc/examples/autotools/elements/hello.bst create mode 100644 doc/examples/autotools/project.conf create mode 100644 doc/sessions/autotools.run create mode 100644 doc/source/sessions-stored/autotools-build.html create mode 100644 doc/source/sessions-stored/autotools-shell.html create mode 100644 doc/source/sessions-stored/autotools-show-variables.html create mode 100644 doc/source/tutorial/autotools.rst create mode 100644 tests/examples/__init__.py create mode 100644 tests/examples/autotools.py diff --git a/doc/examples/autotools/elements/base.bst b/doc/examples/autotools/elements/base.bst new file mode 100644 index 000000000..1b85a9e8c --- /dev/null +++ b/doc/examples/autotools/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/autotools/elements/base/alpine.bst b/doc/examples/autotools/elements/base/alpine.bst new file mode 100644 index 000000000..cf85df5bf --- /dev/null +++ b/doc/examples/autotools/elements/base/alpine.bst @@ -0,0 +1,13 @@ +kind: import +description: | + + Alpine Linux base runtime + +sources: +- kind: tar + + # This is a post doctored, trimmed down system image + # of the Alpine linux distribution. + # + url: alpine:integration-tests-base.v1.x86_64.tar.xz + ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639 diff --git a/doc/examples/autotools/elements/hello.bst b/doc/examples/autotools/elements/hello.bst new file mode 100644 index 000000000..510f5b975 --- /dev/null +++ b/doc/examples/autotools/elements/hello.bst @@ -0,0 +1,21 @@ +kind: autotools +description: | + + Hello world example from automake + +variables: + + # The hello world example lives in the doc/amhello folder. + # + # Set the %{command-subdir} variable to that location + # and just have the autotools element run it's commands there. + # + command-subdir: doc/amhello + +sources: +- kind: tar + url: gnu:automake-1.16.tar.gz + ref: 80da43bb5665596ee389e6d8b64b4f122ea4b92a685b1dbd813cd1f0e0c2d83f + +depends: +- base.bst diff --git a/doc/examples/autotools/project.conf b/doc/examples/autotools/project.conf new file mode 100644 index 000000000..61f63c43a --- /dev/null +++ b/doc/examples/autotools/project.conf @@ -0,0 +1,13 @@ +# Unique project name +name: running-commands + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define an alias for our alpine tarball +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ + gnu: https://ftp.gnu.org/gnu/automake/ diff --git a/doc/sessions/autotools.run b/doc/sessions/autotools.run new file mode 100644 index 000000000..d6263acb7 --- /dev/null +++ b/doc/sessions/autotools.run @@ -0,0 +1,20 @@ + +commands: +# Make it fetch first +- directory: ../examples/autotools + command: fetch hello.bst + +# Capture a `bst show` of the variables +- directory: ../examples/autotools + output: ../source/sessions/autotools-show-variables.html + command: show --deps none --format "%{vars}" hello.bst + +# Capture a `bst build` +- directory: ../examples/autotools + output: ../source/sessions/autotools-build.html + command: build hello.bst + +# Capture a shell output +- directory: ../examples/autotools + output: ../source/sessions/autotools-shell.html + command: shell hello.bst -- hello diff --git a/doc/source/sessions-stored/autotools-build.html b/doc/source/sessions-stored/autotools-build.html new file mode 100644 index 000000000..0036110b4 --- /dev/null +++ b/doc/source/sessions-stored/autotools-build.html @@ -0,0 +1,135 @@ + +
+user@host:~/autotools$ bst build hello.bst
+
+[--:--:--][][] START   Build
+[--:--:--][][] START   Loading pipeline
+[00:00:00][][] SUCCESS Loading pipeline
+[--:--:--][][] START   Resolving pipeline
+[00:00:00][][] SUCCESS Resolving pipeline
+[--:--:--][][] START   Resolving cached state
+[00:00:00][][] SUCCESS Resolving cached state
+[--:--:--][][] START   Checking sources
+[00:00:00][][] SUCCESS Checking sources
+
+BuildStream Version 1.1.3+143.g73b93002.dirty
+  Session Start: Monday, 18-06-2018 at 14:51:01
+  Project:       running-commands (/home/user/autotools)
+  Targets:       hello.bst
+
+User Configuration
+  Configuration File:      /home/user/.config/buildstream.conf
+  Log Files:               /home/user/.cache/buildstream/logs
+  Source Mirrors:          /home/user/.cache/buildstream/sources
+  Build Area:              /home/user/.cache/buildstream/build
+  Artifact Cache:          /home/user/.cache/buildstream/artifacts
+  Strict Build Plan:       Yes
+  Maximum Fetch Tasks:     10
+  Maximum Build Tasks:     4
+  Maximum Push Tasks:      4
+  Maximum Network Retries: 2
+
+Pipeline
+   buildable a352c93edfc55a41868b4f482758ad3ea1c21571532373542cd20b9135f0718d base/alpine.bst 
+     waiting a8eeb045115a4a71c18d09fe14b7b4fc3f3e838414a7d23d7c6d4c3027f28743 base.bst 
+     waiting 3f7f32d9cab049f2664b1299c07f0afdd16e8db5f8e9c6e4f6460439bad91013 hello.bst 
+===============================================================================
+[--:--:--][a352c93e][build:base/alpine.bst               ] START   running-commands/base-alpine/a352c93e-build.31006.log
+[--:--:--][a352c93e][build:base/alpine.bst               ] START   Staging sources
+[00:00:04][a352c93e][build:base/alpine.bst               ] SUCCESS Staging sources
+[--:--:--][a352c93e][build:base/alpine.bst               ] START   Caching artifact
+[00:00:09][a352c93e][build:base/alpine.bst               ] SUCCESS Caching artifact
+[00:00:14][a352c93e][build:base/alpine.bst               ] SUCCESS running-commands/base-alpine/a352c93e-build.31006.log
+[--:--:--][a8eeb045][build:base.bst                      ] START   running-commands/base/a8eeb045-build.31014.log
+[--:--:--][a8eeb045][build:base.bst                      ] START   Caching artifact
+[00:00:00][a8eeb045][build:base.bst                      ] SUCCESS Caching artifact
+[00:00:00][a8eeb045][build:base.bst                      ] SUCCESS running-commands/base/a8eeb045-build.31014.log
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   running-commands/hello/3f7f32d9-build.31017.log
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Staging dependencies
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Staging dependencies
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Integrating sandbox
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Integrating sandbox
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Staging sources
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Staging sources
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running configure-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] STATUS  Running configure-commands
+
+    export NOCONFIGURE=1;
+    
+    if [ -x ./configure ]; then true;
+    elif [ -x autogen ]; then ./autogen;
+    elif [ -x autogen.sh ]; then ./autogen.sh;
+    elif [ -x bootstrap ]; then ./bootstrap;
+    elif [ -x bootstrap.sh ]; then ./bootstrap.sh;
+    else autoreconf -ivf;
+    fi
+
+[00:00:02][3f7f32d9][build:hello.bst                     ] SUCCESS Running configure-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running configure-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] STATUS  Running configure-commands
+
+    ./configure --prefix=/usr \
+    --exec-prefix=/usr \
+    --bindir=/usr/bin \
+    --sbindir=/usr/sbin \
+    --sysconfdir=/etc \
+    --datadir=/usr/share \
+    --includedir=/usr/include \
+    --libdir=/usr/lib \
+    --libexecdir=/usr/libexec \
+    --localstatedir=/var \
+    --sharedstatedir=/usr/com \
+    --mandir=/usr/share/man \
+    --infodir=/usr/share/info
+
+[00:00:01][3f7f32d9][build:hello.bst                     ] SUCCESS Running configure-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running build-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running build-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] STATUS  Running build-commands
+
+    make
+
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running build-commands
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running build-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running install-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running install-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] STATUS  Running install-commands
+
+    make -j1 DESTDIR="/buildstream-install" install
+
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running install-commands
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running install-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running strip-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Running strip-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] STATUS  Running strip-commands
+
+    find "/buildstream-install" -type f \
+      '(' -perm -111 -o -name '*.so*' \
+          -o -name '*.cmxs' -o -name '*.node' ')' \
+      -exec sh -ec \
+      'read -n4 hdr <"$1" # check for elf header
+       if [ "$hdr" != "$(printf \\x7fELF)" ]; then
+           exit 0
+       fi
+       debugfile="/buildstream-install/usr/lib/debug/$(basename "$1")"
+       mkdir -p "$(dirname "$debugfile")"
+       objcopy --only-keep-debug --compress-debug-sections "$1" "$debugfile"
+       chmod 644 "$debugfile"
+       strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
+       objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
+
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running strip-commands
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Running strip-commands
+[--:--:--][3f7f32d9][build:hello.bst                     ] START   Caching artifact
+[00:00:00][3f7f32d9][build:hello.bst                     ] SUCCESS Caching artifact
+[00:00:04][3f7f32d9][build:hello.bst                     ] SUCCESS running-commands/hello/3f7f32d9-build.31017.log
+[00:00:20][][] SUCCESS Build
+
+Pipeline Summary
+  Total:       3
+  Session:     3
+  Fetch Queue: processed 0, skipped 3, failed 0 
+  Build Queue: processed 3, skipped 0, failed 0
+
diff --git a/doc/source/sessions-stored/autotools-shell.html b/doc/source/sessions-stored/autotools-shell.html new file mode 100644 index 000000000..c9038e376 --- /dev/null +++ b/doc/source/sessions-stored/autotools-shell.html @@ -0,0 +1,23 @@ + +
+user@host:~/autotools$ bst shell hello.bst -- hello
+
+[--:--:--][][] START   Loading pipeline
+[00:00:00][][] SUCCESS Loading pipeline
+[--:--:--][][] START   Resolving pipeline
+[00:00:00][][] SUCCESS Resolving pipeline
+[--:--:--][][] START   Resolving cached state
+[00:00:00][][] SUCCESS Resolving cached state
+[--:--:--][][] START   Staging dependencies
+[00:00:00][][] SUCCESS Staging dependencies
+[--:--:--][][] START   Integrating sandbox
+[00:00:00][][] SUCCESS Integrating sandbox
+[--:--:--][3f7f32d9][ main:hello.bst                     ] STATUS  Running command
+
+    hello
+
+Hello World!
+This is amhello 1.0.
+
diff --git a/doc/source/sessions-stored/autotools-show-variables.html b/doc/source/sessions-stored/autotools-show-variables.html new file mode 100644 index 000000000..91fc40015 --- /dev/null +++ b/doc/source/sessions-stored/autotools-show-variables.html @@ -0,0 +1,67 @@ + +
+user@host:~/autotools$ bst show --deps none --format "%{vars}" hello.bst
+
+[--:--:--][][] START   Loading pipeline
+[00:00:00][][] SUCCESS Loading pipeline
+[--:--:--][][] START   Resolving pipeline
+[00:00:00][][] SUCCESS Resolving pipeline
+[--:--:--][][] START   Resolving cached state
+[00:00:00][][] SUCCESS Resolving cached state
+autogen: "export NOCONFIGURE=1;\n\nif [ -x ./configure ]; then true;\nelif [ -x autogen\
+  \ ]; then ./autogen;\nelif [ -x autogen.sh ]; then ./autogen.sh;\nelif [ -x bootstrap\
+  \ ]; then ./bootstrap;\nelif [ -x bootstrap.sh ]; then ./bootstrap.sh;\nelse autoreconf\
+  \ -ivf;\nfi"
+bindir: /usr/bin
+build-root: /buildstream/running-commands/hello.bst
+command-subdir: doc/amhello
+conf-args: "--prefix=/usr \\\n--exec-prefix=/usr \\\n--bindir=/usr/bin \\\n--sbindir=/usr/sbin\
+  \ \\\n--sysconfdir=/etc \\\n--datadir=/usr/share \\\n--includedir=/usr/include \\\
+  \n--libdir=/usr/lib \\\n--libexecdir=/usr/libexec \\\n--localstatedir=/var \\\n\
+  --sharedstatedir=/usr/com \\\n--mandir=/usr/share/man \\\n--infodir=/usr/share/info"
+conf-cmd: ./configure
+conf-extra: ''
+conf-global: ''
+conf-local: ''
+configure: "./configure --prefix=/usr \\\n--exec-prefix=/usr \\\n--bindir=/usr/bin\
+  \ \\\n--sbindir=/usr/sbin \\\n--sysconfdir=/etc \\\n--datadir=/usr/share \\\n--includedir=/usr/include\
+  \ \\\n--libdir=/usr/lib \\\n--libexecdir=/usr/libexec \\\n--localstatedir=/var \\\
+  \n--sharedstatedir=/usr/com \\\n--mandir=/usr/share/man \\\n--infodir=/usr/share/info"
+datadir: /usr/share
+debugdir: /usr/lib/debug
+docdir: /usr/share/doc
+element-name: hello.bst
+exec_prefix: /usr
+fix-pyc-timestamps: "find \"/buildstream-install\" -name '*.pyc' -exec \\\n  dd if=/dev/zero\
+  \ of={} bs=1 count=4 seek=4 conv=notrunc ';'"
+includedir: /usr/include
+infodir: /usr/share/info
+install-root: /buildstream-install
+lib: lib
+libdir: /usr/lib
+libexecdir: /usr/libexec
+localstatedir: /var
+make: make
+make-install: make -j1 DESTDIR="/buildstream-install" install
+mandir: /usr/share/man
+max-jobs: '8'
+objcopy-extract-args: --only-keep-debug --compress-debug-sections
+objcopy-link-args: --add-gnu-debuglink
+prefix: /usr
+project-name: running-commands
+sbindir: /usr/sbin
+sharedstatedir: /usr/com
+strip-args: --remove-section=.comment --remove-section=.note --strip-unneeded
+strip-binaries: "find \"/buildstream-install\" -type f \\\n  '(' -perm -111 -o -name\
+  \ '*.so*' \\\n      -o -name '*.cmxs' -o -name '*.node' ')' \\\n  -exec sh -ec \\\
+  \n  'read -n4 hdr <\"$1\" # check for elf header\n   if [ \"$hdr\" != \"$(printf\
+  \ \\\\x7fELF)\" ]; then\n       exit 0\n   fi\n   debugfile=\"/buildstream-install/usr/lib/debug/$(basename\
+  \ \"$1\")\"\n   mkdir -p \"$(dirname \"$debugfile\")\"\n   objcopy --only-keep-debug\
+  \ --compress-debug-sections \"$1\" \"$debugfile\"\n   chmod 644 \"$debugfile\"\n\
+  \   strip --remove-section=.comment --remove-section=.note --strip-unneeded \"$1\"\
+  \n   objcopy --add-gnu-debuglink \"$debugfile\" \"$1\"' - {} ';'"
+sysconfdir: /etc
+
+
diff --git a/doc/source/tutorial/autotools.rst b/doc/source/tutorial/autotools.rst new file mode 100644 index 000000000..ddf490a38 --- /dev/null +++ b/doc/source/tutorial/autotools.rst @@ -0,0 +1,146 @@ + + +Using the autotools element +=========================== +In :ref:`the last chapter ` we observed how the +:mod:`manual ` element works, allowing one to specify and +run commands manually in the process of constructing an *artifact*. + +In this section, we'll go over a mostly automated build of a similar +hello world example. We will observe how our configurations of the +:mod:`autotools ` element translate to configurations +on the :mod:`manual ` element, and observe how +:ref:`variable substitution ` works. + +.. note:: + + This example is distributed with BuildStream + in the `doc/examples/autotools + `_ + subdirectory. + + +Overview +-------- +Instead of using the :mod:`local ` source as we have been using +in the previous examples, we're going to use a :mod:`tar ` source +this time to obtain the ``automake`` release tarball directly from the upstream +hosting. + +In this example we're going to build the example program included in the +upstream ``automake`` tarball itself, and we're going to use the automated +:mod:`autotools ` build element to do so. + + +Project structure +----------------- + + +``project.conf`` +~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/autotools/project.conf + :language: yaml + +Like the :ref:`last project.conf `, we've +added another :ref:`source alias ` for ``gnu``, the location +from which we're going to download the ``automake`` tarball. + + +``elements/base/alpine.bst`` and ``elements/base.bst`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The alpine base and base stack element are defined in the +same way as in the last chapter: :ref:`tutorial_running_commands`. + + +``elements/hello.bst`` +~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/autotools/elements/hello.bst + :language: yaml + +In this case, we haven't touched the element's ``config`` section +at all, instead we just slightly override the bahavior of the +:mod:`autotools ` build element by overriding +the :ref:`command-subdir variable ` + + +Looking at variables +'''''''''''''''''''' +Let's take a moment and observe how :ref:`element composition +` works with variables. + +As :ref:`the documentation ` mentions: + +* The initial settings of the ``project.conf`` variables are setup + using BuildStream's :ref:`builtin defaults `. + +* After this, your local ``project.conf`` may override some variables + on a project wide basis. Those will in turn be overridden by any + defaults provided by element classes, such as the variables set in the + documentation of the :mod:`autotools ` build element. + The variables you set in your final ```` *element declarations*, + will have the final say on the value of a particular variable. + +* Finally, the variables, which may be composed of other variables, + are resolved after all composition has taken place. + +The variable we needed to override was ``command-subdir``, which is an +automatic variable provided by the :mod:`BuildElement ` +abstract class. This variable simply instructs the :mod:`BuildElement ` +in which subdirectory of the ``%{build-root}`` to run it's commands in. + +One can always display the resolved set of variables for a given +element's configuration using :ref:`bst show `: + +.. raw:: html + :file: ../sessions/autotools-show-variables.html + +As an exercise, we suggest that you modify the ``hello.bst`` +element to set the prefix like so: + +.. code:: yaml + + variables: + prefix: "/opt" + +And rerun the above :ref:`bst show ` command to observe how this +changes the output. + +Observe where the variables are declared in the :ref:`builtin defaults +` and :mod:`autotools ` element +documentation, and how overriding these affects the resolved set of variables. + + +Using the project +----------------- + + +Build the hello.bst element +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To build the project, run :ref:`bst build ` in the +following way: + +.. raw:: html + :file: ../sessions/autotools-build.html + + +Run the hello world program +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We probably know by now what's going to happen, but let's run +the program we've compiled anyway using :ref:`bst shell `: + +.. raw:: html + :file: ../sessions/autotools-shell.html + + +Summary +------- +Now we've used a builtin :ref:`build element `, and +we've taken a look into :ref:`how variables work `. + +When browsing the :ref:`build elements ` in the +documentation, we are now equipped with a good idea of what an element is going +to do, based on their default YAML configuration and any configurations +we have in our project. We can also now observe what variables are in effect +for the build of a given element, using :ref:`bst show `. diff --git a/doc/source/using_tutorial.rst b/doc/source/using_tutorial.rst index c9e4dfb57..bd2f26a49 100644 --- a/doc/source/using_tutorial.rst +++ b/doc/source/using_tutorial.rst @@ -10,3 +10,4 @@ projects. tutorial/first-project tutorial/running-commands + tutorial/autotools diff --git a/tests/examples/__init__.py b/tests/examples/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/examples/autotools.py b/tests/examples/autotools.py new file mode 100644 index 000000000..c774776fb --- /dev/null +++ b/tests/examples/autotools.py @@ -0,0 +1,47 @@ +import os +import pytest + +from tests.testutils import cli_integration as cli +from tests.testutils.integration import assert_contains +from tests.testutils.site import IS_LINUX + +pytestmark = pytest.mark.integration + +DATA_DIR = os.path.join( + os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'autotools' +) + + +# Tests a build of the autotools amhello project on a alpine-linux base runtime +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_autotools_build(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + # Check that the project can be built correctly. + result = cli.run(project=project, args=['build', 'hello.bst']) + result.assert_success() + + result = cli.run(project=project, args=['checkout', 'hello.bst', checkout]) + result.assert_success() + + assert_contains(checkout, ['/usr', '/usr/lib', '/usr/bin', + '/usr/share', '/usr/lib/debug', + '/usr/lib/debug/hello', '/usr/bin/hello', + '/usr/share/doc', '/usr/share/doc/amhello', + '/usr/share/doc/amhello/README']) + + +# Test running an executable built with autotools. +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_autotools_run(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + + result = cli.run(project=project, args=['build', 'hello.bst']) + result.assert_success() + + result = cli.run(project=project, args=['shell', 'hello.bst', 'hello']) + result.assert_success() + assert result.output == 'Hello World!\nThis is amhello 1.0.\n' -- cgit v1.2.1