Skip to content

Commit

Permalink
tests: add spread suite for meson plugin
Browse files Browse the repository at this point in the history
Move the plugin integration tests for the Meson plugin into a Spread
suite.

LP: #1783837

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
  • Loading branch information
kyrofa committed Aug 9, 2018
1 parent 10139a4 commit 605fa3f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
2 changes: 2 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ suites:
summary: tests of snapcraft's Go plugin
tests/spread/plugins/kbuild/:
summary: tests of snapcraft's Kbuild plugin
tests/spread/plugins/meson/:
summary: tests of snapcraft's Meson plugin
tests/spread/plugins/nil/:
summary: tests of snapcraft's Nil plugin

Expand Down
31 changes: 0 additions & 31 deletions tests/integration/plugins/test_meson_plugin.py

This file was deleted.

5 changes: 0 additions & 5 deletions tests/integration/snaps/meson-hello/main.c

This file was deleted.

2 changes: 0 additions & 2 deletions tests/integration/snaps/meson-hello/meson.build

This file was deleted.

18 changes: 18 additions & 0 deletions tests/spread/plugins/meson/run/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
summary: Build and run a basic meson snap

environment:
SNAP_DIR: ../snaps/meson-hello

restore: |
cd "$SNAP_DIR"
snapcraft clean
rm -f ./*.snap
# There is no meson on trusty
systems: [-ubuntu-14.04*]

execute: |
cd "$SNAP_DIR"
snapcraft
sudo snap install meson-hello_*.snap --dangerous
[ "$(meson-hello)" = "hello world" ]
7 changes: 7 additions & 0 deletions tests/spread/plugins/meson/snaps/meson-hello/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

int main()
{
printf("hello world\n");
return 0;
}
2 changes: 2 additions & 0 deletions tests/spread/plugins/meson/snaps/meson-hello/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project('meson-hello', 'c')
executable('hello', 'main.c', install : true)
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
name: meson-hello
version: 0.1
version: '1.0'
summary: test the meson plugin
description: |
This is a basic meson snap. It just prints a hello world.
If you want to add other functionalities to this snap, please don't.
Make a new one.
grade: devel
confinement: strict

build-packages: [gcc, libc6-dev]
apps:
meson-hello:
command: hello

parts:
meson-project:
meson-parameters:
- --prefix=/opt
plugin: meson
source: .
meson-parameters:
- --prefix=/
build-packages: [gcc, libc6-dev]

0 comments on commit 605fa3f

Please sign in to comment.