summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>2016-05-26 20:59:11 +0100
committerAmadeusz Żołnowski <aidecoe@gentoo.org>2016-05-29 10:23:21 +0100
commit98ba2191992c67244e50da4e95d38fd426b817ee (patch)
tree39defaaf95140f875eaf92a9929973a91483a591 /eclass/tests
parentrebar.eclass: Run unit tests (diff)
downloadgentoo-98ba2191992c67244e50da4e95d38fd426b817ee.tar.gz
gentoo-98ba2191992c67244e50da4e95d38fd426b817ee.tar.bz2
gentoo-98ba2191992c67244e50da4e95d38fd426b817ee.zip
rebar.eclass: Optionally provide alternate rebar config to alter
Some packages have separate configs for build and tests. Build config is always named 'rebar.config' and there seem to be no standard name for tests config.
Diffstat (limited to 'eclass/tests')
-rwxr-xr-xeclass/tests/rebar_fix_include_path.sh23
-rwxr-xr-xeclass/tests/rebar_remove_deps.sh23
2 files changed, 46 insertions, 0 deletions
diff --git a/eclass/tests/rebar_fix_include_path.sh b/eclass/tests/rebar_fix_include_path.sh
index 9047f8dcd225..c8ab178a7054 100755
--- a/eclass/tests/rebar_fix_include_path.sh
+++ b/eclass/tests/rebar_fix_include_path.sh
@@ -77,6 +77,25 @@ test_typical_config() {
[[ ${unit_rc}${diff_rc} = 00 ]]
}
+test_typical_config_with_different_name() {
+ local diff_rc
+ local unit_rc
+
+ # Prepare
+ cd "${S}" || die
+ cp typical.config other.config || die
+
+ # Run unit
+ (rebar_fix_include_path foo other.config)
+ unit_rc=$?
+
+ # Test result
+ diff other.config typical.config.expected
+ diff_rc=$?
+
+ [[ ${unit_rc}${diff_rc} = 00 ]]
+}
+
test_multiple_versions() {
local diff_rc
local unit_rc
@@ -144,6 +163,10 @@ tbegin "rebar_fix_include_path deals with typical config"
test_typical_config
tend $?
+tbegin "rebar_fix_include_path deals with typical config with different name"
+test_typical_config_with_different_name
+tend $?
+
tbegin "rebar_fix_include_path fails on multiple versions of dependency"
test_multiple_versions
tend $?
diff --git a/eclass/tests/rebar_remove_deps.sh b/eclass/tests/rebar_remove_deps.sh
index 05207a783cb4..32351bff03cb 100755
--- a/eclass/tests/rebar_remove_deps.sh
+++ b/eclass/tests/rebar_remove_deps.sh
@@ -67,6 +67,25 @@ test_typical_config() {
[[ ${unit_rc}${diff_rc} = 00 ]]
}
+test_typical_config_with_different_name() {
+ local diff_rc
+ local unit_rc
+
+ # Prepare
+ cd "${S}" || die
+ cp typical.config other.config || die
+
+ # Run unit
+ (rebar_remove_deps other.config)
+ unit_rc=$?
+
+ # Test result
+ diff other.config rebar.config.expected
+ diff_rc=$?
+
+ [[ ${unit_rc}${diff_rc} = 00 ]]
+}
+
test_deps_in_one_line() {
local diff_rc
local unit_rc
@@ -92,6 +111,10 @@ tbegin "rebar_remove_deps deals with typical config"
test_typical_config
tend $?
+tbegin "rebar_remove_deps deals with typical config with different name"
+test_typical_config_with_different_name
+tend $?
+
tbegin "rebar_remove_deps deals with all deps in one line"
test_deps_in_one_line
tend $?