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 8, 2018
1 parent 67d94bd commit 3ec83f1
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 42 deletions.
2 changes: 2 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ suites:
summary: tests of snapcraft's CMake plugin
tests/spread/plugins/go/:
summary: tests of snapcraft's Go 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.

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

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

restore: |
cd "$SNAP_DIR"
snapcraft clean
rm -f ./*.snap
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('meson-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: meson-hello

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

0 comments on commit 3ec83f1

Please sign in to comment.