Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthab committed Mar 20, 2024
1 parent ee170a7 commit 20cfa77
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 95 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -63,5 +64,5 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: archive-debug-artifacts
name: archive-debug-artifacts-${{ matrix.os }}-${{ matrix.bazel_version }}-${{ matrix.r_version }}
path: /tmp/debug-artifacts/*
8 changes: 4 additions & 4 deletions tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ r_toolchain(
toolchain(
name = "toolchain-linux",
exec_compatible_with = [
"@bazel_tools//platforms:linux",
"@platforms//os:linux",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@platforms//os:linux",
],
toolchain = ":r-toolchain-linux",
toolchain_type = "@rules_r//R:toolchain_type",
Expand All @@ -127,10 +127,10 @@ toolchain(
toolchain(
name = "toolchain-darwin",
exec_compatible_with = [
"@bazel_tools//platforms:osx",
"@platforms//os:osx",
],
target_compatible_with = [
"@bazel_tools//platforms:osx",
"@platforms//os:osx",
],
toolchain = ":r-toolchain-darwin",
toolchain_type = "@rules_r//R:toolchain_type",
Expand Down
35 changes: 9 additions & 26 deletions tests/coverage/all_instrumented_C.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="31" lines-valid="31" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="23" lines-valid="23" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="external/workspaceroot/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="hello" signature="" line-rate="1" branch-rate="0">
<method name="hello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
</method>
<method name="helloC" signature="" line-rate="1" branch-rate="0">
<method name="helloC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="1" branch="false"/>
</lines>
Expand All @@ -30,7 +31,7 @@
</class>
<class name="fn.R" filename="packages/exampleA/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleA" signature="" line-rate="1" branch-rate="0">
<method name="exampleA" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -42,7 +43,7 @@
</class>
<class name="fn.R" filename="packages/exampleB/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleB" signature="" line-rate="1" branch-rate="0">
<method name="exampleB" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -54,7 +55,7 @@
</class>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -66,12 +67,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -106,24 +107,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/all_instrumented_D.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
3 changes: 1 addition & 2 deletions tests/coverage/coverage_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ echo "=== Testing custom toolchain ==="
echo "Checking coverage results with the LLVM toolchain:"
toolchain_args=(
"--extra_toolchains=//:toolchain-${os}"
"--extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-${os}"
"--incompatible_enable_cc_toolchain_resolution"
"--extra_toolchains=@llvm_toolchain//:cc-toolchain-${bzl_arch}-${os}"
"--toolchain_resolution_debug=rules_r"
)
"${bazel}" coverage "${bazel_test_opts[@]}" "${toolchain_args[@]}" //...
Expand Down
9 changes: 5 additions & 4 deletions tests/coverage/custom_toolchain_C.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="19" lines-valid="19" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="19" lines-valid="19" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -18,12 +19,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/custom_toolchain_D.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
27 changes: 5 additions & 22 deletions tests/coverage/default_instrumented.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="26" lines-valid="26" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="18" lines-valid="18" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -18,12 +19,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -58,24 +59,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
31 changes: 7 additions & 24 deletions tests/coverage/workspace_instrumented_C.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="28" lines-valid="28" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="20" lines-valid="20" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleA/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleA" signature="" line-rate="1" branch-rate="0">
<method name="exampleA" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -18,7 +19,7 @@
</class>
<class name="fn.R" filename="packages/exampleB/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleB" signature="" line-rate="1" branch-rate="0">
<method name="exampleB" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -30,7 +31,7 @@
</class>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -42,12 +43,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -82,24 +83,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/workspace_instrumented_D.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
7 changes: 4 additions & 3 deletions tests/coverage/workspaceroot.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="3" lines-valid="3" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="3" lines-valid="3" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="external/workspaceroot/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="hello" signature="" line-rate="1" branch-rate="0">
<method name="hello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
</method>
<method name="helloC" signature="" line-rate="1" branch-rate="0">
<method name="helloC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="1" branch="false"/>
</lines>
Expand Down
2 changes: 2 additions & 0 deletions tests/cran/Makevars.gnu
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ CPPFLAGS += "-Wno-builtin-macro-redefined" \
"-ffile-prefix-map=_EXEC_ROOT_=" \
"-no-canonical-prefixes" \

LDFLAGS += -fuse-ld=lld

# Following flags should be enabled if switching to gcc:
# CPPFLAGS += -fno-canonical-system-headers
Loading

0 comments on commit 20cfa77

Please sign in to comment.