summaryrefslogtreecommitdiff
path: root/integration-tests/autotools-test
diff options
context:
space:
mode:
Diffstat (limited to 'integration-tests/autotools-test')
-rw-r--r--integration-tests/autotools-test/elements/amhello-run.bst12
-rw-r--r--integration-tests/autotools-test/elements/amhello.bst13
-rw-r--r--integration-tests/autotools-test/elements/dependencies/base-platform.bst23
-rw-r--r--integration-tests/autotools-test/elements/dependencies/base-sdk.bst20
-rw-r--r--integration-tests/autotools-test/expected/amhello-run/test2
-rwxr-xr-xintegration-tests/autotools-test/expected/amhello/usr/bin/hellobin0 -> 4400 bytes
-rw-r--r--integration-tests/autotools-test/expected/amhello/usr/lib/debug/hellobin0 -> 11112 bytes
-rw-r--r--integration-tests/autotools-test/expected/amhello/usr/share/doc/amhello/README2
-rw-r--r--integration-tests/autotools-test/keys/gnome-sdk.gpgbin0 -> 629 bytes
-rw-r--r--integration-tests/autotools-test/project.conf14
-rw-r--r--integration-tests/autotools-test/run-autotools-test.sh70
-rw-r--r--integration-tests/autotools-test/src/amhello.tar.gzbin0 -> 30507 bytes
12 files changed, 156 insertions, 0 deletions
diff --git a/integration-tests/autotools-test/elements/amhello-run.bst b/integration-tests/autotools-test/elements/amhello-run.bst
new file mode 100644
index 000000000..bd6c903b0
--- /dev/null
+++ b/integration-tests/autotools-test/elements/amhello-run.bst
@@ -0,0 +1,12 @@
+kind: script
+description: Run autotools-built binary
+
+depends:
+ - filename: dependencies/base-platform.bst
+ type: build
+ - filename: amhello.bst
+ type: build
+
+config:
+ commands:
+ - "/usr/bin/hello > /buildstream/install/test"
diff --git a/integration-tests/autotools-test/elements/amhello.bst b/integration-tests/autotools-test/elements/amhello.bst
new file mode 100644
index 000000000..5dc13b4ac
--- /dev/null
+++ b/integration-tests/autotools-test/elements/amhello.bst
@@ -0,0 +1,13 @@
+kind: autotools
+description: Autotools test
+
+depends:
+- filename: dependencies/base-platform.bst
+ type: build
+- filename: dependencies/base-sdk.bst
+ type: build
+
+sources:
+- kind: tar
+ url: file:///amhello.tar.gz
+ ref: 3aa3c2bf7a488fea24303c4d98d1b5c0a72734f61615b935cf62e4e126b127d2
diff --git a/integration-tests/autotools-test/elements/dependencies/base-platform.bst b/integration-tests/autotools-test/elements/dependencies/base-platform.bst
new file mode 100644
index 000000000..09c95acb4
--- /dev/null
+++ b/integration-tests/autotools-test/elements/dependencies/base-platform.bst
@@ -0,0 +1,23 @@
+kind: import
+description: Import the base freedesktop platform
+config:
+ source: files
+public:
+ bst:
+ integration-commands:
+ - ldconfig
+arches:
+ x86_64:
+ sources:
+ - kind: ostree
+ url: gnomesdk:repo/
+ track: runtime/org.freedesktop.BasePlatform/x86_64/1.4
+ gpg-key: keys/gnome-sdk.gpg
+ ref: c9d09b7250a12ef09d95952fc4f49a35e5f8c2c1dd7141b7eeada4069e6f6576
+ i386:
+ sources:
+ - kind: ostree
+ url: gnomesdk:repo/
+ track: runtime/org.freedesktop.BasePlatform/i386/1.4
+ gpg-key: keys/gnome-sdk.gpg
+ ref: 27ebae91839a454596a273391b0e53063eaa8aca4fc9cb64654582bfbc338c96
diff --git a/integration-tests/autotools-test/elements/dependencies/base-sdk.bst b/integration-tests/autotools-test/elements/dependencies/base-sdk.bst
new file mode 100644
index 000000000..cd191fd1b
--- /dev/null
+++ b/integration-tests/autotools-test/elements/dependencies/base-sdk.bst
@@ -0,0 +1,20 @@
+kind: import
+description: Import the base freedesktop SDK
+config:
+ source: files
+ target: usr
+arches:
+ x86_64:
+ sources:
+ - kind: ostree
+ url: gnomesdk:repo/
+ track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
+ gpg-key: keys/gnome-sdk.gpg
+ ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
+ i386:
+ sources:
+ - kind: ostree
+ url: gnomesdk:repo/
+ track: runtime/org.freedesktop.BaseSdk/i386/1.4
+ gpg-key: keys/gnome-sdk.gpg
+ ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
diff --git a/integration-tests/autotools-test/expected/amhello-run/test b/integration-tests/autotools-test/expected/amhello-run/test
new file mode 100644
index 000000000..cb3ea7cb8
--- /dev/null
+++ b/integration-tests/autotools-test/expected/amhello-run/test
@@ -0,0 +1,2 @@
+Hello World!
+This is amhello 1.0.
diff --git a/integration-tests/autotools-test/expected/amhello/usr/bin/hello b/integration-tests/autotools-test/expected/amhello/usr/bin/hello
new file mode 100755
index 000000000..16a0c7cb6
--- /dev/null
+++ b/integration-tests/autotools-test/expected/amhello/usr/bin/hello
Binary files differ
diff --git a/integration-tests/autotools-test/expected/amhello/usr/lib/debug/hello b/integration-tests/autotools-test/expected/amhello/usr/lib/debug/hello
new file mode 100644
index 000000000..b3720a2b1
--- /dev/null
+++ b/integration-tests/autotools-test/expected/amhello/usr/lib/debug/hello
Binary files differ
diff --git a/integration-tests/autotools-test/expected/amhello/usr/share/doc/amhello/README b/integration-tests/autotools-test/expected/amhello/usr/share/doc/amhello/README
new file mode 100644
index 000000000..d24723a81
--- /dev/null
+++ b/integration-tests/autotools-test/expected/amhello/usr/share/doc/amhello/README
@@ -0,0 +1,2 @@
+This is a demonstration package for GNU Automake.
+Type `info Automake' to read the Automake manual.
diff --git a/integration-tests/autotools-test/keys/gnome-sdk.gpg b/integration-tests/autotools-test/keys/gnome-sdk.gpg
new file mode 100644
index 000000000..8434b686c
--- /dev/null
+++ b/integration-tests/autotools-test/keys/gnome-sdk.gpg
Binary files differ
diff --git a/integration-tests/autotools-test/project.conf b/integration-tests/autotools-test/project.conf
new file mode 100644
index 000000000..4212ca3d1
--- /dev/null
+++ b/integration-tests/autotools-test/project.conf
@@ -0,0 +1,14 @@
+# Import-test BuildStream project configuration.
+
+# Project name
+#
+name: script-test
+
+aliases:
+ gnomesdk: https://sdk.gnome.org/
+
+# Base project relative element path, elements will be loaded
+# from this base.
+
+element-path: elements
+
diff --git a/integration-tests/autotools-test/run-autotools-test.sh b/integration-tests/autotools-test/run-autotools-test.sh
new file mode 100644
index 000000000..d2d247cee
--- /dev/null
+++ b/integration-tests/autotools-test/run-autotools-test.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# A script to run a BuildStream test case.
+
+
+TEST_DIR="elements/"
+RESULTS="results/"
+EXPECTED="expected/"
+
+set -eu
+
+# run_test
+#
+# Run tests for this test case.
+#
+# This should create a set of directories that match the directories
+# in 'results/', as well as a log of the BuildStream output in
+# 'test_log.log'.
+#
+run_test () {
+ local element
+ local elements
+ local element_name
+ local test_dir
+ local bst_file
+ local tar_file
+
+ local successes=0
+ local total=0
+ local exit
+
+ source ../lib.sh
+
+ tar_file="$(dirname "$(readlink -f "$0")")/src/amhello.tar.gz"
+ bst_file="$(dirname "$(readlink -f "$0")")/elements/amhello.bst"
+
+ patch_file_location "$bst_file" "$tar_file"
+
+ mkdir -p "$TEST_DIR"
+ elements="$(find "$TEST_DIR" -maxdepth 1 -type f)"
+
+ for element in $elements;
+ do
+ total=$((total + 1))
+
+ element_name="$(basename "$element")"
+ element_name="${element_name%.*}"
+
+ test_dir="$RESULTS/$element_name"
+
+ echo "Running test '$element_name'"
+
+ bst_with_flags build "$element_name".bst
+ bst_with_flags checkout "$element_name".bst "$test_dir"
+
+ exit=0
+ compare_results "$element_name" "$RESULTS" "$EXPECTED" || exit=$?
+ if [ $exit == 0 ]
+ then
+ successes=$((successes + 1))
+ fi
+ done
+
+ if [ $total != $successes ]
+ then
+ return 1
+ fi
+}
+
+run_test "$@"
diff --git a/integration-tests/autotools-test/src/amhello.tar.gz b/integration-tests/autotools-test/src/amhello.tar.gz
new file mode 100644
index 000000000..2850f31aa
--- /dev/null
+++ b/integration-tests/autotools-test/src/amhello.tar.gz
Binary files differ