Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add spread suite for meson plugin #2205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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]