Skip to content

Commit

Permalink
tests: add spread suite for waf plugin (#2210)
Browse files Browse the repository at this point in the history
Move the plugin integration tests for the Waf plugin into a Spread
suite.

LP: #1783846

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
  • Loading branch information
Kyle Fazzari committed Aug 11, 2018
1 parent 3b12e9c commit 5498d0a
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 41 deletions.
2 changes: 2 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ suites:
summary: tests of snapcraft's Nil plugin
tests/spread/plugins/scons/:
summary: tests of snapcraft's SCons plugin
tests/spread/plugins/waf/:
summary: tests of snapcraft's Waf plugin

spread_tests/:
summary: old tests of the snapcraft snap, being phased out
Expand Down
35 changes: 0 additions & 35 deletions tests/integration/plugins/test_waf_plugin.py

This file was deleted.

14 changes: 14 additions & 0 deletions tests/spread/plugins/waf/cross-compile/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary: Cross-compile waf snaps

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

restore: |
cd "$SNAP_DIR"
snapcraft clean
rm -f ./*.snap
execute: |
cd "$SNAP_DIR"
snapcraft stage --target-arch=armhf
file stage/usr/local/bin/myprogram | MATCH ",\s*ARM\s*,"
15 changes: 15 additions & 0 deletions tests/spread/plugins/waf/run/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
summary: Build and run a basic waf snap

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

restore: |
cd "$SNAP_DIR"
snapcraft clean
rm -f ./*.snap
execute: |
cd "$SNAP_DIR"
snapcraft
sudo snap install waf-hello_*.snap --dangerous
[ "$(waf-hello)" = "hello world" ]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include <stdio.h>

int main() {
printf("Hello Waf!\n");
return 0;
int main()
{
printf("hello world\n");
return 0;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: waf-with-configflags
version: 0.1
name: waf-hello
version: '1.0'
summary: test the waf plugin
description: |
This is a basic waf snap with configflags.
confinement: strict

apps:
waf-with-configflags:
waf-hello:
command: usr/local/bin/myprogram

build-packages: [gcc]
Expand Down

0 comments on commit 5498d0a

Please sign in to comment.