From 5b0d9ac9c4d69cc2421ba80d46c9d74d734a80f1 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Wed, 12 Apr 2023 17:41:53 +0200 Subject: [PATCH] Add sharness test framework Will be used to add tests of the ISO generation scripts. Signed-off-by: Yann Dirson --- .gitignore | 3 +++ .gitmodules | 3 +++ tests/0000-sanity.t | 13 +++++++++++++ tests/Makefile | 1 + tests/sharness | 1 + 5 files changed, 21 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100755 tests/0000-sanity.t create mode 120000 tests/Makefile create mode 160000 tests/sharness diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e41395a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/tests/test-results/ +/tests/trash directory.* +/tests/trash_directory.* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3aa21c4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/sharness"] + path = create-install-image/tests/sharness + url = https://github.com/felipec/sharness.git diff --git a/tests/0000-sanity.t b/tests/0000-sanity.t new file mode 100755 index 0000000..6d38783 --- /dev/null +++ b/tests/0000-sanity.t @@ -0,0 +1,13 @@ +#!/bin/sh + +test_description="sanity check before running real tests" + +DIR0="$(dirname "$0")" +TESTDIR="$(realpath "$DIR0")" +. $TESTDIR/sharness/sharness.sh + +test_expect_success "verify test environment" " + echo \"XCPTEST_REPOROOT=$XCPTEST_REPOROOT\" | grep '://' +" + +test_done diff --git a/tests/Makefile b/tests/Makefile new file mode 120000 index 0000000..fef5c61 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1 @@ +sharness/example/Makefile \ No newline at end of file diff --git a/tests/sharness b/tests/sharness new file mode 160000 index 0000000..e457513 --- /dev/null +++ b/tests/sharness @@ -0,0 +1 @@ +Subproject commit e457513ae8d4912994f2ea5423a9392ee6d03f4b