mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-12 02:59:08 +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
|
||||
|
||||
if hash llvm-cov-11 2>/dev/null; then
|
||||
llvm_cov="llvm-cov-11"
|
||||
elif hash llvm-cov110 2>/dev/null; then
|
||||
llvm_cov="llvm-cov110"
|
||||
elif hash llvm-cov100 2>/dev/null; then
|
||||
llvm_cov="llvm-cov100"
|
||||
elif hash llvm-cov-10 2>/dev/null; then
|
||||
llvm_cov="llvm-cov-10"
|
||||
elif hash llvm-cov90 2>/dev/null; then
|
||||
llvm_cov="llvm-cov90"
|
||||
elif hash llvm-cov-9 2>/dev/null; then
|
||||
llvm_cov="llvm-cov-9"
|
||||
elif hash llvm-cov80 2>/dev/null; then
|
||||
llvm_cov="llvm-cov80"
|
||||
elif hash llvm-cov-8 2>/dev/null; then
|
||||
llvm_cov="llvm-cov-8"
|
||||
elif hash llvm-cov70 2>/dev/null; then
|
||||
llvm_cov="llvm-cov70"
|
||||
elif hash llvm-cov-7 2>/dev/null; then
|
||||
llvm_cov="llvm-cov-7"
|
||||
elif hash llvm-cov 2>/dev/null; then
|
||||
llvm_cov="llvm-cov"
|
||||
fi
|
||||
llvm_version_suffixes=(
|
||||
""
|
||||
-15
|
||||
150
|
||||
-14
|
||||
140
|
||||
-13
|
||||
130
|
||||
-12
|
||||
120
|
||||
-11
|
||||
110
|
||||
100
|
||||
-10
|
||||
90
|
||||
-9
|
||||
)
|
||||
|
||||
for suffix in "${llvm_version_suffixes[@]}"; do
|
||||
llvm_cov_test="llvm-cov${suffix}"
|
||||
if hash $llvm_cov_test 2>/dev/null; then
|
||||
llvm_cov=$llvm_cov_test
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
exec $llvm_cov gcov "$@"
|
||||
|
@ -28,24 +28,24 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
||||
REQUIRE(colour.blue == 255);
|
||||
}
|
||||
|
||||
SECTION("parsing hex red") {
|
||||
auto colour = parse_color("#ff0000");
|
||||
SECTION("parsing red") {
|
||||
auto colour = parse_color("ff0000");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 255);
|
||||
REQUIRE(colour.green == 0);
|
||||
REQUIRE(colour.blue == 0);
|
||||
}
|
||||
|
||||
SECTION("parsing hex green") {
|
||||
auto colour = parse_color("#00ff00");
|
||||
SECTION("parsing green") {
|
||||
auto colour = parse_color("00ff00");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 0);
|
||||
REQUIRE(colour.green == 255);
|
||||
REQUIRE(colour.blue == 0);
|
||||
}
|
||||
|
||||
SECTION("parsing hex blue") {
|
||||
auto colour = parse_color("#0000ff");
|
||||
SECTION("parsing blue") {
|
||||
auto colour = parse_color("0000ff");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 0);
|
||||
REQUIRE(colour.green == 0);
|
||||
@ -60,7 +60,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
||||
REQUIRE(colour.blue == 0x44);
|
||||
}
|
||||
|
||||
SECTION("it parses the colour red") {
|
||||
SECTION("it parses the colour 'red'") {
|
||||
auto colour = parse_color("red");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 255);
|
||||
@ -68,7 +68,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
||||
REQUIRE(colour.blue == 0);
|
||||
}
|
||||
|
||||
SECTION("it parses the colour green") {
|
||||
SECTION("it parses the colour 'green'") {
|
||||
auto colour = parse_color("green");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 0);
|
||||
@ -76,7 +76,7 @@ TEST_CASE("parse_color correctly parses colours", "[colours][parse_color]") {
|
||||
REQUIRE(colour.blue == 0);
|
||||
}
|
||||
|
||||
SECTION("it parses the colour blue") {
|
||||
SECTION("it parses the colour 'blue'") {
|
||||
auto colour = parse_color("blue");
|
||||
REQUIRE(colour.alpha == 255);
|
||||
REQUIRE(colour.red == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user