mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-12 11:04:10 +00:00
Fix these colour tests, refactor gcov script.
This commit is contained in:
parent
ee15e71b35
commit
1296ab8517
@ -1,27 +1,29 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if hash llvm-cov-11 2>/dev/null; then
|
llvm_version_suffixes=(
|
||||||
llvm_cov="llvm-cov-11"
|
""
|
||||||
elif hash llvm-cov110 2>/dev/null; then
|
-15
|
||||||
llvm_cov="llvm-cov110"
|
150
|
||||||
elif hash llvm-cov100 2>/dev/null; then
|
-14
|
||||||
llvm_cov="llvm-cov100"
|
140
|
||||||
elif hash llvm-cov-10 2>/dev/null; then
|
-13
|
||||||
llvm_cov="llvm-cov-10"
|
130
|
||||||
elif hash llvm-cov90 2>/dev/null; then
|
-12
|
||||||
llvm_cov="llvm-cov90"
|
120
|
||||||
elif hash llvm-cov-9 2>/dev/null; then
|
-11
|
||||||
llvm_cov="llvm-cov-9"
|
110
|
||||||
elif hash llvm-cov80 2>/dev/null; then
|
100
|
||||||
llvm_cov="llvm-cov80"
|
-10
|
||||||
elif hash llvm-cov-8 2>/dev/null; then
|
90
|
||||||
llvm_cov="llvm-cov-8"
|
-9
|
||||||
elif hash llvm-cov70 2>/dev/null; then
|
)
|
||||||
llvm_cov="llvm-cov70"
|
|
||||||
elif hash llvm-cov-7 2>/dev/null; then
|
for suffix in "${llvm_version_suffixes[@]}"; do
|
||||||
llvm_cov="llvm-cov-7"
|
llvm_cov_test="llvm-cov${suffix}"
|
||||||
elif hash llvm-cov 2>/dev/null; then
|
if hash $llvm_cov_test 2>/dev/null; then
|
||||||
llvm_cov="llvm-cov"
|
llvm_cov=$llvm_cov_test
|
||||||
fi
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
exec $llvm_cov gcov "$@"
|
exec $llvm_cov gcov "$@"
|
||||||
|
@ -28,24 +28,24 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
|||||||
REQUIRE(colour.blue == 255);
|
REQUIRE(colour.blue == 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("parsing hex red") {
|
SECTION("parsing red") {
|
||||||
auto colour = parse_color("#ff0000");
|
auto colour = parse_color("ff0000");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 255);
|
REQUIRE(colour.red == 255);
|
||||||
REQUIRE(colour.green == 0);
|
REQUIRE(colour.green == 0);
|
||||||
REQUIRE(colour.blue == 0);
|
REQUIRE(colour.blue == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("parsing hex green") {
|
SECTION("parsing green") {
|
||||||
auto colour = parse_color("#00ff00");
|
auto colour = parse_color("00ff00");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 0);
|
REQUIRE(colour.red == 0);
|
||||||
REQUIRE(colour.green == 255);
|
REQUIRE(colour.green == 255);
|
||||||
REQUIRE(colour.blue == 0);
|
REQUIRE(colour.blue == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("parsing hex blue") {
|
SECTION("parsing blue") {
|
||||||
auto colour = parse_color("#0000ff");
|
auto colour = parse_color("0000ff");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 0);
|
REQUIRE(colour.red == 0);
|
||||||
REQUIRE(colour.green == 0);
|
REQUIRE(colour.green == 0);
|
||||||
@ -60,7 +60,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
|||||||
REQUIRE(colour.blue == 0x44);
|
REQUIRE(colour.blue == 0x44);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("it parses the colour red") {
|
SECTION("it parses the colour 'red'") {
|
||||||
auto colour = parse_color("red");
|
auto colour = parse_color("red");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 255);
|
REQUIRE(colour.red == 255);
|
||||||
@ -68,7 +68,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
|||||||
REQUIRE(colour.blue == 0);
|
REQUIRE(colour.blue == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("it parses the colour green") {
|
SECTION("it parses the colour 'green'") {
|
||||||
auto colour = parse_color("green");
|
auto colour = parse_color("green");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 0);
|
REQUIRE(colour.red == 0);
|
||||||
@ -76,7 +76,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
|||||||
REQUIRE(colour.blue == 0);
|
REQUIRE(colour.blue == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("it parses the colour blue") {
|
SECTION("it parses the colour 'blue'") {
|
||||||
auto colour = parse_color("blue");
|
auto colour = parse_color("blue");
|
||||||
REQUIRE(colour.alpha == 255);
|
REQUIRE(colour.alpha == 255);
|
||||||
REQUIRE(colour.red == 0);
|
REQUIRE(colour.red == 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user