diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2018-01-17 14:17:49 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-02-21 11:26:41 +0100 |
commit | 260946ede14629b01c92fc7e568653e194724418 (patch) | |
tree | 21519a622bc82b5de1f0588a6e212a3bfd20b904 /tests/integration | |
parent | 3ce6b907dafdf31e13053985f3d91e1813dfbe21 (diff) | |
download | buildstream-260946ede14629b01c92fc7e568653e194724418.tar.gz |
tests/integration: Use a simpler CMake test project
The 'step7' tutorial was fine, but it requires a C++ compiler to build.
I have replaced it with a simpler testcase which is based on the
existing amhello testcase.
This means that the integration test suite no longer requires a C++
compiler, and in practice this can allow us to avoid depending on the
GNU C/C++ compilers altogether and instead use the vastly smaller Tiny C
Compiler.
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/cmake.py | 28 | ||||
-rw-r--r-- | tests/integration/project/elements/cmake/cmakehello.bst | 10 | ||||
-rw-r--r-- | tests/integration/project/elements/cmake/step7.bst | 10 | ||||
-rw-r--r-- | tests/integration/project/files/cmakehello.tar.gz | bin | 0 -> 10240 bytes | |||
-rw-r--r-- | tests/integration/project/files/step7.tar.gz | bin | 2742 -> 0 bytes |
5 files changed, 17 insertions, 31 deletions
diff --git a/tests/integration/cmake.py b/tests/integration/cmake.py index 5a9eacf97..c03ccf586 100644 --- a/tests/integration/cmake.py +++ b/tests/integration/cmake.py @@ -19,7 +19,7 @@ def test_cmake_build(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout') element_path = os.path.join(project, 'elements') - element_name = 'cmake/step7.bst' + element_name = 'cmake/cmakehello.bst' result = cli.run(project=project, args=['build', element_name]) assert result.exit_code == 0 @@ -27,36 +27,22 @@ def test_cmake_build(cli, tmpdir, datafiles): result = cli.run(project=project, args=['checkout', element_name, checkout]) assert result.exit_code == 0 - assert_contains(checkout, ['/usr', '/usr/bin', '/usr/include', - '/usr/lib', '/usr/bin/libMathFunctions.a', - '/usr/bin/Tutorial', - '/usr/include/MathFunctions.h', - '/usr/include/TutorialConfig.h', - '/usr/lib/debug', - '/usr/lib/debug/Tutorial']) + assert_contains(checkout, ['/usr', '/usr/bin', '/usr/bin/hello', + '/usr/lib/debug', '/usr/lib/debug/hello']) @pytest.mark.datafiles(DATA_DIR) def test_cmake_run(cli, tmpdir, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) element_path = os.path.join(project, 'elements') - element_name = 'cmake/step7.bst' + element_name = 'cmake/cmakehello.bst' result = cli.run(project=project, args=['build', element_name]) assert result.exit_code == 0 - result = cli.run(project=project, args=['shell', element_name, '/usr/bin/Tutorial', '9']) + result = cli.run(project=project, args=['shell', element_name, '/usr/bin/hello']) assert result.exit_code == 0 - assert result.output == """Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -Computing sqrt of 9 to be 3 -The square root of 9 is 3 + assert result.output == """Hello World! +This is hello. """ diff --git a/tests/integration/project/elements/cmake/cmakehello.bst b/tests/integration/project/elements/cmake/cmakehello.bst new file mode 100644 index 000000000..c5fe496ad --- /dev/null +++ b/tests/integration/project/elements/cmake/cmakehello.bst @@ -0,0 +1,10 @@ +kind: cmake +description: Cmake test + +depends: + - base.bst + +sources: + - kind: tar + url: project_dir:/files/cmakehello.tar.gz + ref: 508266f40dbc5875293bd24c4e50a9eb6b88cbacab742033f7b92f8c087b64e5 diff --git a/tests/integration/project/elements/cmake/step7.bst b/tests/integration/project/elements/cmake/step7.bst deleted file mode 100644 index 625bb8583..000000000 --- a/tests/integration/project/elements/cmake/step7.bst +++ /dev/null @@ -1,10 +0,0 @@ -kind: cmake -description: Cmake test - -depends: - - base.bst - -sources: - - kind: tar - url: project_dir:/files/step7.tar.gz - ref: 9591707afbae77751730b4af4c52a18b1cdc4378237bc64055f099bc95c330db diff --git a/tests/integration/project/files/cmakehello.tar.gz b/tests/integration/project/files/cmakehello.tar.gz Binary files differnew file mode 100644 index 000000000..54d950575 --- /dev/null +++ b/tests/integration/project/files/cmakehello.tar.gz diff --git a/tests/integration/project/files/step7.tar.gz b/tests/integration/project/files/step7.tar.gz Binary files differdeleted file mode 100644 index f9643afce..000000000 --- a/tests/integration/project/files/step7.tar.gz +++ /dev/null |