From e87baead65c5307710120847009ec09858b16768 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 16:06:30 -0500 Subject: [PATCH 001/118] test --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 849070d2fe5d..23a735c20f73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ FROM debian:buster-slim # Install binary dependencies RUN apt-get update && \ - apt-get install --no-install-recommends -y curl file gcc g++ hwloc libhwloc-dev make openssh-client \ + apt-get install --no-install-recommends -y curl file gcc g++ hwloc libhwloc-dev \ autoconf automake cmake libtool libcurl4 libcurl4-openssl-dev libssl-dev \ libelf-dev libdw-dev binutils-dev zlib1g-dev libiberty-dev wget \ xz-utils pkg-config python clang ocl-icd-opencl-dev ca-certificates From 8ca169514ed68b3f8bac9238ba8e7b2b7a03b3f0 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 17:05:02 -0500 Subject: [PATCH 002/118] test-pubs --- .circleci/config.yml | 14 ++++++++++++++ scripts/build-rust-docs.sh | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 scripts/build-rust-docs.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f1d2bea5322..a56dcace6715 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -149,6 +149,20 @@ jobs: - run: name: Build Unit Tests command: make install + publish-docs: + executor: test-executor + description: Publish documentation to GitHub pages + steps: + - build_setup + - restore_cargo_package_cache + - run: + name: Build Docs + command: cargo doc --no-deps --all-features + - run: + name: Publish Docs + command: scripts/build-rust-docs.sh + - persist_to_workspace: + root: target/doc workflows: setup_test: diff --git a/scripts/build-rust-docs.sh b/scripts/build-rust-docs.sh new file mode 100644 index 000000000000..08c824233b8b --- /dev/null +++ b/scripts/build-rust-docs.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd target/doc +git init +echo '' > index.html +git add . +git config --global -l +git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' +git push -f -q https://git:${{ GITHUB_TOKEN }}@github.com/${{ forest }} HEAD:gh-pages \ No newline at end of file From 518c0c5229f0faf39b82c18c258b4fca3a03f4ba Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 17:06:20 -0500 Subject: [PATCH 003/118] wip --- .circleci/config.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a56dcace6715..710b401d5274 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,9 +171,12 @@ workflows: - lint: requires: - prefetch-crates - - test: - requires: - - prefetch-crates - - test-vectors: - requires: - - prefetch-crates + # - test: + # requires: + # - prefetch-crates + # - test-vectors: + # requires: + # - prefetch-crates + - publish-docs: + requires: + - prefetch-crates From d3cd22fd5098ff9986cef2948835cde6455fa2dc Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 17:08:06 -0500 Subject: [PATCH 004/118] wip --- .circleci/config.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 710b401d5274..3d2fe21a421a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -161,8 +161,6 @@ jobs: - run: name: Publish Docs command: scripts/build-rust-docs.sh - - persist_to_workspace: - root: target/doc workflows: setup_test: @@ -171,12 +169,6 @@ workflows: - lint: requires: - prefetch-crates - # - test: - # requires: - # - prefetch-crates - # - test-vectors: - # requires: - # - prefetch-crates - publish-docs: - requires: - - prefetch-crates + requires: + - prefetch-crates From 86f9c263e50d2cb3a1b9454c026759be1d16002c Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 17:32:41 -0500 Subject: [PATCH 005/118] wip --- .circleci/config.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d2fe21a421a..ea39c7f49b69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -158,9 +158,19 @@ jobs: - run: name: Build Docs command: cargo doc --no-deps --all-features + - add_ssh_keys: + fingerprints: + - "68:80:3e:38:03:0e:2c:96:ef:6d:ef:13:01:af:18:bd" - run: name: Publish Docs - command: scripts/build-rust-docs.sh + command: | + cd target/doc + git init + echo '' > index.html + git add . + git config --global -l + git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' + git push -f -q https://git:${{ GITHUB_TOKEN }}@github.com/${{ forest }} HEAD:gh-pages workflows: setup_test: From 1ea78fdad84c7f6eb561692e9d1a17b3181b1c44 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 20:28:14 -0500 Subject: [PATCH 006/118] wip --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea39c7f49b69..9fd46c8e7dc7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -170,6 +170,7 @@ jobs: git add . git config --global -l git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' + echo GITHUB_TOKEN git push -f -q https://git:${{ GITHUB_TOKEN }}@github.com/${{ forest }} HEAD:gh-pages workflows: From 6618e0165825d7555f87fe747d910cf51afca212 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 21:04:10 -0500 Subject: [PATCH 007/118] wip --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9fd46c8e7dc7..30a31a867d0d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -170,8 +170,8 @@ jobs: git add . git config --global -l git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' - echo GITHUB_TOKEN - git push -f -q https://git:${{ GITHUB_TOKEN }}@github.com/${{ forest }} HEAD:gh-pages + echo "${GITHUB_TOKEN}" + git push -f -q https://git:${$GITHUB_TOKEN}@github.com/forest HEAD:gh-pages workflows: setup_test: From 310968cf75d156a62919ede84b68ede150aaff50 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 21:30:45 -0500 Subject: [PATCH 008/118] wip --- .circleci/config.yml | 2 +- scripts/codecov.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/codecov.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 30a31a867d0d..85f5dcc3b59e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,7 +171,7 @@ jobs: git config --global -l git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' echo "${GITHUB_TOKEN}" - git push -f -q https://git:${$GITHUB_TOKEN}@github.com/forest HEAD:gh-pages + git push -f -q https://git:${GITHUB_TOKEN}@github.com/dutterbutter/forest HEAD:gh-pages workflows: setup_test: diff --git a/scripts/codecov.sh b/scripts/codecov.sh new file mode 100644 index 000000000000..2b73d00ae8dc --- /dev/null +++ b/scripts/codecov.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Replace 'myproject' by your project name +REPORT=$(find target/debug -maxdepth 1 -name ' .codecov +chmod +x .codecov +./.codecov -t $CODECOV_TOKEN +echo "Uploaded code coverage" \ No newline at end of file From 13520fb37058780198233b93fcfe6b3f46a74d5a Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 22:00:43 -0500 Subject: [PATCH 009/118] wip --- .circleci/config.yml | 22 ++++++++++++++++++++-- scripts/codecov.sh | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 85f5dcc3b59e..7c12c8d186d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,8 @@ executors: test-executor: machine: image: ubuntu-1604:202004-01 - resource_class: large + resource_class: xlarge + commands: install_rust: @@ -46,6 +47,8 @@ commands: echo 'export CARGO_INCREMENTAL=0' >> $BASH_ENV echo 'export CI_TIMEOUT="timeout 40m"' >> $BASH_ENV echo 'export CC=gcc' >> $BASH_ENV + export RUST_NIGHTLY=$(cat cargo-toolchain) + echo 'export RUST_NIGHTLY='"$RUST_NIGHTLY" >> $BASH_ENV install_deps: steps: - run: @@ -172,14 +175,29 @@ jobs: git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' echo "${GITHUB_TOKEN}" git push -f -q https://git:${GITHUB_TOKEN}@github.com/dutterbutter/forest HEAD:gh-pages + generate-cov: + executor: test-executor + description: Coverage + environment: + # Set your codecov token if your repository is private. + CODE_COV_TOKEN: ${CODE_COV_TOKEN} + steps: + - build_setup + - restore_cargo_package_cache + - run: + name: Upload Coverage + command: sh ./scripts/codecov.sh workflows: setup_test: jobs: - prefetch-crates - - lint: + - test: requires: - prefetch-crates + - generate-cov: + requires: + - test - publish-docs: requires: - prefetch-crates diff --git a/scripts/codecov.sh b/scripts/codecov.sh index 2b73d00ae8dc..837c0770b611 100644 --- a/scripts/codecov.sh +++ b/scripts/codecov.sh @@ -10,5 +10,5 @@ done wget -O - -q "https://codecov.io/bash" > .codecov chmod +x .codecov -./.codecov -t $CODECOV_TOKEN +./.codecov -t $CODE_COV_TOKEN echo "Uploaded code coverage" \ No newline at end of file From 208de4b759c0d048fbade5774d9550f9d7af64e6 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 22:08:46 -0500 Subject: [PATCH 010/118] wip --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c12c8d186d0..3d36975d0d7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,7 +174,7 @@ jobs: git config --global -l git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' echo "${GITHUB_TOKEN}" - git push -f -q https://git:${GITHUB_TOKEN}@github.com/dutterbutter/forest HEAD:gh-pages + git push -f -q https://git:${GITHUB_TOKEN}@github.com/dutterbutter/dutterbutter.github.io generate-cov: executor: test-executor description: Coverage From 195269d8a7f4538432ff4da0a3ec49357c49df4a Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Fri, 30 Oct 2020 22:54:08 -0500 Subject: [PATCH 011/118] wip --- .circleci/config.yml | 31 +++++++++++++++++++++---------- scripts/build-rust-docs.sh | 3 ++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d36975d0d7a..305ce40c6936 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -113,6 +113,18 @@ jobs: name: Fetch workspace dependencies over network command: cargo fetch - save_cargo_package_cache + build-nightly: + executor: test-executor + description: Checks nightly builds + steps: + - checkout + - restore_cargo_package_cache + - run: + name: Nightly builds + command: | + rustup run nightly rustc --version --verbose + rustup run nightly cargo --version --verbose + rustup run nightly cargo build lint: executor: test-executor description: Run Rust linting tools. @@ -128,12 +140,16 @@ jobs: test: executor: test-executor description: Run Rust tests + parallelism: 4 steps: - build_setup - restore_cargo_package_cache - run: name: Run Unit Tests - command: make test + command: | + echo $(circleci tests glob "**/*.rs" | circleci tests split --split-by=timings") + circleci tests glob "**/*.rs" | circleci tests split --split-by=timings + make test test-vectors: executor: test-executor description: Run serialization and conformance tests @@ -166,15 +182,7 @@ jobs: - "68:80:3e:38:03:0e:2c:96:ef:6d:ef:13:01:af:18:bd" - run: name: Publish Docs - command: | - cd target/doc - git init - echo '' > index.html - git add . - git config --global -l - git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' - echo "${GITHUB_TOKEN}" - git push -f -q https://git:${GITHUB_TOKEN}@github.com/dutterbutter/dutterbutter.github.io + command: sh build-rust-docs.sh generate-cov: executor: test-executor description: Coverage @@ -201,3 +209,6 @@ workflows: - publish-docs: requires: - prefetch-crates + - build-nightly: + requires: + - prefetch-crates diff --git a/scripts/build-rust-docs.sh b/scripts/build-rust-docs.sh index 08c824233b8b..e6f4c54ba331 100644 --- a/scripts/build-rust-docs.sh +++ b/scripts/build-rust-docs.sh @@ -6,4 +6,5 @@ echo ' Date: Fri, 30 Oct 2020 23:09:21 -0500 Subject: [PATCH 012/118] wip --- .circleci/config.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 305ce40c6936..f6a2e0ae919f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,6 +49,9 @@ commands: echo 'export CC=gcc' >> $BASH_ENV export RUST_NIGHTLY=$(cat cargo-toolchain) echo 'export RUST_NIGHTLY='"$RUST_NIGHTLY" >> $BASH_ENV + export CARGO_INCREMENTAL=0 + export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" + export RUSTDOCFLAGS="-Cpanic=abort" install_deps: steps: - run: @@ -113,18 +116,6 @@ jobs: name: Fetch workspace dependencies over network command: cargo fetch - save_cargo_package_cache - build-nightly: - executor: test-executor - description: Checks nightly builds - steps: - - checkout - - restore_cargo_package_cache - - run: - name: Nightly builds - command: | - rustup run nightly rustc --version --verbose - rustup run nightly cargo --version --verbose - rustup run nightly cargo build lint: executor: test-executor description: Run Rust linting tools. @@ -147,7 +138,7 @@ jobs: - run: name: Run Unit Tests command: | - echo $(circleci tests glob "**/*.rs" | circleci tests split --split-by=timings") + echo $(circleci tests glob "**/*.rs" | circleci tests split --split-by=timings) circleci tests glob "**/*.rs" | circleci tests split --split-by=timings make test test-vectors: @@ -194,7 +185,10 @@ jobs: - restore_cargo_package_cache - run: name: Upload Coverage - command: sh ./scripts/codecov.sh + command: | + cargo test + grcov ./target/debug/ -s . -t html --llvm --branch --ignore-not-existing -o ./target/debug/coverage/ + sh codecov.sh workflows: setup_test: @@ -209,6 +203,6 @@ workflows: - publish-docs: requires: - prefetch-crates - - build-nightly: - requires: - - prefetch-crates + # - build-nightly: + # requires: + # - prefetch-crates From 7764241a4a8cea82f91a46672b5a489ae162f02d Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 13:09:11 -0500 Subject: [PATCH 013/118] wip --- .circleci/config.yml | 30 +++++++++++++++++------------- Cargo.lock | 6 +++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f6a2e0ae919f..69e3b56141b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,8 +138,8 @@ jobs: - run: name: Run Unit Tests command: | - echo $(circleci tests glob "**/*.rs" | circleci tests split --split-by=timings) - circleci tests glob "**/*.rs" | circleci tests split --split-by=timings + echo $(circleci tests glob "/**/**/tests/*.rs" | circleci tests split --split-by=timings) + circleci tests glob "/**/**/tests/*.rs" | circleci tests split --split-by=timings make test test-vectors: executor: test-executor @@ -163,7 +163,7 @@ jobs: executor: test-executor description: Publish documentation to GitHub pages steps: - - build_setup + - checkout - restore_cargo_package_cache - run: name: Build Docs @@ -173,7 +173,7 @@ jobs: - "68:80:3e:38:03:0e:2c:96:ef:6d:ef:13:01:af:18:bd" - run: name: Publish Docs - command: sh build-rust-docs.sh + command: bash ./build-rust-docs.sh generate-cov: executor: test-executor description: Coverage @@ -181,14 +181,20 @@ jobs: # Set your codecov token if your repository is private. CODE_COV_TOKEN: ${CODE_COV_TOKEN} steps: - - build_setup + - checkout - restore_cargo_package_cache - run: - name: Upload Coverage + name: Coverage command: | - cargo test - grcov ./target/debug/ -s . -t html --llvm --branch --ignore-not-existing -o ./target/debug/coverage/ - sh codecov.sh + export PATH=~/.cargo/bin:$PATH + # install kcov + cargo install cargo-kcov + cargo kcov --print-install-kcov-sh | sh + echo "Install kcov successfully" + # coverage + cargo kcov --all -v + bash <(curl -s https://codecov.io/bash) + echo "Upload code coverage successfully" workflows: setup_test: @@ -197,12 +203,10 @@ workflows: - test: requires: - prefetch-crates - - generate-cov: - requires: - - test + - generate-cov - publish-docs: requires: - prefetch-crates # - build-nightly: # requires: - # - prefetch-crates + # - prefetch-crates/**/*.js diff --git a/Cargo.lock b/Cargo.lock index 6d0f81a2a90f..217fae14df9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5332,8 +5332,7 @@ dependencies = [ [[package]] name = "serde_cbor" version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +source = "git+https://github.com/ChainSafe/cbor?rev=3e7bf81f57e9010762dbc12292bd6f927fdfe83a#3e7bf81f57e9010762dbc12292bd6f927fdfe83a" dependencies = [ "half", "serde", @@ -5342,7 +5341,8 @@ dependencies = [ [[package]] name = "serde_cbor" version = "0.11.1" -source = "git+https://github.com/ChainSafe/cbor?rev=3e7bf81f57e9010762dbc12292bd6f927fdfe83a#3e7bf81f57e9010762dbc12292bd6f927fdfe83a" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" dependencies = [ "half", "serde", From a3044c4a35b383b7ef80ef1d09213a4030fc3b53 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 13:13:12 -0500 Subject: [PATCH 014/118] wip --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69e3b56141b3..4134cd5007fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -186,7 +186,7 @@ jobs: - run: name: Coverage command: | - export PATH=~/.cargo/bin:$PATH + export PATH=$HOME/.cargo/bin:$PATH # install kcov cargo install cargo-kcov cargo kcov --print-install-kcov-sh | sh From 5404cfb556f9c35de3d010cdaee8e24f27c92b8f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 13:14:47 -0500 Subject: [PATCH 015/118] wip --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4134cd5007fd..46a34ecb268d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -203,7 +203,9 @@ workflows: - test: requires: - prefetch-crates - - generate-cov + - generate-cov: + requires: + - prefetch-crates - publish-docs: requires: - prefetch-crates From ee1186016a6062b9615bbfc952f6a26691d9f55e Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 13:23:08 -0500 Subject: [PATCH 016/118] wip --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 46a34ecb268d..15b57ff36ecb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -163,7 +163,7 @@ jobs: executor: test-executor description: Publish documentation to GitHub pages steps: - - checkout + - build_setup - restore_cargo_package_cache - run: name: Build Docs @@ -181,7 +181,7 @@ jobs: # Set your codecov token if your repository is private. CODE_COV_TOKEN: ${CODE_COV_TOKEN} steps: - - checkout + - build_setup - restore_cargo_package_cache - run: name: Coverage From 16dbc88fa5e75cb7bf5ec160baa91b2af8dcbe86 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 14:43:53 -0500 Subject: [PATCH 017/118] wip --- .circleci/config.yml | 64 +- automation/emit_coverage_info.sh | 57 + coveralls.json | 1751 ++++++++++++++++++++++++++++++ scripts/codecov.sh | 2 +- 4 files changed, 1847 insertions(+), 27 deletions(-) create mode 100644 automation/emit_coverage_info.sh create mode 100644 coveralls.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 15b57ff36ecb..f9db47467b35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,6 +96,24 @@ commands: command: | ls -all $HOME/.cargo du -ssh $HOME/.cargo + install-grcov: + steps: + - run: + name: Install grcov + command: | + GRCOV_VERSION=v0.5.15 + GRCOV_ARCHIVE=grcov-linux-x86_64.tar.bz2 + GRCOV_SHA256=1182739b2b1df31dee74ed3533330001f9da921cf169bd8da4ec0386e4243ad0 + GRCOV_URL="https://github.com/mozilla/grcov/releases/download/${GRCOV_VERSION}/${GRCOV_ARCHIVE}" + curl -sfSL --retry 5 --retry-delay 10 -O "${GRCOV_URL}" + echo "${GRCOV_SHA256} *${GRCOV_ARCHIVE}" | shasum -a 256 -c - + # Just install `grcov` to ~/.bin + mkdir -p "$HOME/.bin" + tar jxf "${GRCOV_ARCHIVE}" -C "$HOME/.bin" + echo 'export PATH="$HOME/.bin:$PATH"' >> $BASH_ENV + # Run in a different shell to source $BASH_ENV + - run: | + grcov --version build_setup: description: Sets up environment for future jobs steps: @@ -137,10 +155,7 @@ jobs: - restore_cargo_package_cache - run: name: Run Unit Tests - command: | - echo $(circleci tests glob "/**/**/tests/*.rs" | circleci tests split --split-by=timings) - circleci tests glob "/**/**/tests/*.rs" | circleci tests split --split-by=timings - make test + command: make test test-vectors: executor: test-executor description: Run serialization and conformance tests @@ -173,28 +188,22 @@ jobs: - "68:80:3e:38:03:0e:2c:96:ef:6d:ef:13:01:af:18:bd" - run: name: Publish Docs - command: bash ./build-rust-docs.sh - generate-cov: - executor: test-executor - description: Coverage - environment: - # Set your codecov token if your repository is private. - CODE_COV_TOKEN: ${CODE_COV_TOKEN} + command: bash ./scripts/build-rust-docs.sh + cov: + docker: + - image: circleci/rust:latest + resource_class: medium steps: + # Need to use nightly for this. - build_setup - - restore_cargo_package_cache + - install-grcov + - run: bash ./automation/emit_coverage_info.sh - run: - name: Coverage - command: | - export PATH=$HOME/.cargo/bin:$PATH - # install kcov - cargo install cargo-kcov - cargo kcov --print-install-kcov-sh | sh - echo "Install kcov successfully" - # coverage - cargo kcov --all -v - bash <(curl -s https://codecov.io/bash) - echo "Upload code coverage successfully" + name: Compile coverage + command: grcov ./target/debug/ -s . -t lcov --llvm --ignore-not-existing --ignore "target/*" --ignore "/*" -o lcov.info + - run: + name: Upload to codecov.io + command: bash <(curl -s https://codecov.io/bash) -f lcov.info workflows: setup_test: @@ -203,12 +212,15 @@ workflows: - test: requires: - prefetch-crates - - generate-cov: - requires: - - prefetch-crates + docs: + jobs: + - prefetch-crates - publish-docs: requires: - prefetch-crates + coverage: + jobs: + - cov # - build-nightly: # requires: # - prefetch-crates/**/*.js diff --git a/automation/emit_coverage_info.sh b/automation/emit_coverage_info.sh new file mode 100644 index 000000000000..61811a466a94 --- /dev/null +++ b/automation/emit_coverage_info.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# Run tests in order to produce coverage data. Does not collect coverage data, +# just produces it. Note that we ignore all test failures -- some of the +# experimental flags we use cause test failures, we don't really care, other CI +# tasks check this anyway. +# +# Note that running this outside of CI doesn't work on all platforms. In +# particular, macos needs further patches in order to work, probably windows +# too. It's really intended for use inside CI only. +# +# Finally, this must be done on nightly -- `cargo-tarpaulin`, which works on +# stable, also has issues with NSS, but not ones that seem easy to work around. +# As a result, we use `grcov`. Ultimately `grcov` should long-term allow us to +# integrate coverage data from over the FFI, which is a huge plus to this +# approach, so it's probably for the best, even if `grcov`'s actual coverage +# information seems to be of lower quality than `tarpaulin`. + +if [[ ! -f "$PWD/automation/emit_coverage_info.sh" ]] +then + echo "emit_coverage_info.sh must be executed from the root directory." + exit 1 +fi + +cargo +nightly clean +# Note that incremental builds, as well as sccache seems to break coverage :(. +# So, we disable those. +export CARGO_INCREMENTAL=0 +unset RUSTC_WRAPPER +# TODO: re-add `-Clink-dead-code` to RUSTFLAGS -- right now it causes a build +# linker error in NSS, as apparently some part of NSS we don't use doesn't have +# the build flags set up correctly. This makes our code coverage accuracy worse, +# but AFAICT, not in a massive way -- or at least codecov.io seems to account +# for it in some manner. +# +# Also, this `--cfg coverage` is how the `#[cfg(coverage)]` we use in some parts +# of the rust code comes into existence (it's non-standard) +export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort --cfg coverage"; +export RUSTDOCFLAGS="-Cpanic=abort" + +# Apparently --no-default-features doesn't work in the root, even with -p to select a specific package. +# Instead we pull the list of individual package manifest files which have default features +# out of `cargo metadata` and test using --manifest-path for each individual package. +for manifest in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select((.features | .default | length) > 0) | .manifest_path'); do + package=$(dirname "$manifest") + package=$(basename "$package") + echo "## no-default-features test for package $package (manifest @ $manifest)" + cargo +nightly test --manifest-path "$manifest" --no-default-features --no-fail-fast || true +done + +cargo +nightly test --all --no-fail-fast || true + +cargo +nightly run -p sync-test || true +cargo +nightly run -p protobuf-gen -- tools/protobuf_files.toml || true +cargo +nightly run -p systest || true + +env RUSTFLAGS="--cfg __appsvc_ci_hack $RUSTFLAGS" cargo +nightly test --all --all-features --no-fail-fast || true \ No newline at end of file diff --git a/coveralls.json b/coveralls.json new file mode 100644 index 000000000000..153b5251cacc --- /dev/null +++ b/coveralls.json @@ -0,0 +1,1751 @@ +#!/usr/bin/env bash + +# Apache License Version 2.0, January 2004 +# https://github.com/codecov/codecov-bash/blob/master/LICENSE + + +set -e +o pipefail + +VERSION="20201009-048fee3" + +codecov_flags=( ) +url="https://codecov.io" +env="$CODECOV_ENV" +service="" +token="" +search_in="" +# shellcheck disable=SC2153 +flags="$CODECOV_FLAGS" +exit_with=0 +curlargs="" +curlawsargs="" +dump="0" +clean="0" +curl_s="-s" +name="$CODECOV_NAME" +include_cov="" +exclude_cov="" +ddp="$HOME/Library/Developer/Xcode/DerivedData" +xp="" +files="" +save_to="" +cacert="$CODECOV_CA_BUNDLE" +gcov_ignore="-not -path './bower_components/**' -not -path './node_modules/**' -not -path './vendor/**'" +gcov_include="" + +ft_gcov="1" +ft_coveragepy="1" +ft_fix="1" +ft_search="1" +ft_s3="1" +ft_network="1" +ft_xcodellvm="1" +ft_xcodeplist="0" +ft_gcovout="1" +ft_html="0" + +_git_root=$(git rev-parse --show-toplevel 2>/dev/null || hg root 2>/dev/null || echo "$PWD") +git_root="$_git_root" +remote_addr="" +if [ "$git_root" = "$PWD" ]; +then + git_root="." +fi + +url_o="" +pr_o="" +build_o="" +commit_o="" +search_in_o="" +tag_o="" +branch_o="" +slug_o="" +prefix_o="" +git_ls_files_recurse_submodules_o="" + +commit="$VCS_COMMIT_ID" +branch="$VCS_BRANCH_NAME" +pr="$VCS_PULL_REQUEST" +slug="$VCS_SLUG" +tag="$VCS_TAG" +build_url="$CI_BUILD_URL" +build="$CI_BUILD_ID" +job="$CI_JOB_ID" + +beta_xcode_partials="" + +proj_root="$git_root" +gcov_exe="gcov" +gcov_arg="" + +b="\033[0;36m" +g="\033[0;32m" +r="\033[0;31m" +e="\033[0;90m" +x="\033[0m" + +show_help() { +cat << EOF + + Codecov Bash $VERSION + + Global report uploading tool for Codecov + Documentation at https://docs.codecov.io/docs + Contribute at https://github.com/codecov/codecov-bash + + + -h Display this help and exit + -f FILE Target file(s) to upload + + -f "path/to/file" only upload this file + skips searching unless provided patterns below + + -f '!*.bar' ignore all files at pattern *.bar + -f '*.foo' include all files at pattern *.foo + Must use single quotes. + This is non-exclusive, use -s "*.foo" to match specific paths. + + -s DIR Directory to search for coverage reports. + Already searches project root and artifact folders. + -t TOKEN Set the private repository token + (option) set environment variable CODECOV_TOKEN=:uuid + + -t @/path/to/token_file + -t uuid + + -n NAME Custom defined name of the upload. Visible in Codecov UI + + -e ENV Specify environment variables to be included with this build + Also accepting environment variables: CODECOV_ENV=VAR,VAR2 + + -e VAR,VAR2 + + -X feature Toggle functionalities + + -X gcov Disable gcov + -X coveragepy Disable python coverage + -X fix Disable report fixing + -X search Disable searching for reports + -X xcode Disable xcode processing + -X network Disable uploading the file network + -X gcovout Disable gcov output + -X html Enable coverage for HTML files + -X recursesubs Enable recurse submodules in git projects when searching for source files + + -N The commit SHA of the parent for which you are uploading coverage. If not present, + the parent will be determined using the API of your repository provider. + When using the repository provider's API, the parent is determined via finding + the closest ancestor to the commit. + + -R root dir Used when not in git/hg project to identify project root directory + -F flag Flag the upload to group coverage metrics + + -F unittests This upload is only unittests + -F integration This upload is only integration tests + -F ui,chrome This upload is Chrome - UI tests + + -c Move discovered coverage reports to the trash + -Z Exit with 1 if not successful. Default will Exit with 0 + + -- xcode -- + -D Custom Derived Data Path for Coverage.profdata and gcov processing + Default '~/Library/Developer/Xcode/DerivedData' + -J Specify packages to build coverage. Uploader will only build these packages. + This can significantly reduces time to build coverage reports. + + -J 'MyAppName' Will match "MyAppName" and "MyAppNameTests" + -J '^ExampleApp$' Will match only "ExampleApp" not "ExampleAppTests" + + -- gcov -- + -g GLOB Paths to ignore during gcov gathering + -G GLOB Paths to include during gcov gathering + -p dir Project root directory + Also used when preparing gcov + -k prefix Prefix filepaths to help resolve path fixing: https://github.com/codecov/support/issues/472 + -x gcovexe gcov executable to run. Defaults to 'gcov' + -a gcovargs extra arguments to pass to gcov + + -- Override CI Environment Variables -- + These variables are automatically detected by popular CI providers + + -B branch Specify the branch name + -C sha Specify the commit sha + -P pr Specify the pull request number + -b build Specify the build number + -T tag Specify the git tag + + -- Enterprise -- + -u URL Set the target url for Enterprise customers + Not required when retrieving the bash uploader from your CCE + (option) Set environment variable CODECOV_URL=https://my-hosted-codecov.com + -r SLUG owner/repo slug used instead of the private repo token in Enterprise + (option) set environment variable CODECOV_SLUG=:owner/:repo + (option) set in your codecov.yml "codecov.slug" + -S PATH File path to your cacert.pem file used to verify ssl with Codecov Enterprise (optional) + (option) Set environment variable: CODECOV_CA_BUNDLE="/path/to/ca.pem" + -U curlargs Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy" + -A curlargs Extra curl arguments to communicate with AWS. + + -- Debugging -- + -d Don't upload, but dump upload file to stdout + -q PATH Write upload file to path + -K Remove color from the output + -v Verbose mode + +EOF +} + + +say() { + echo -e "$1" +} + + +urlencode() { + echo "$1" | curl -Gso /dev/null -w "%{url_effective}" --data-urlencode @- "" | cut -c 3- | sed -e 's/%0A//' +} + + +swiftcov() { + _dir=$(dirname "$1" | sed 's/\(Build\).*/\1/g') + for _type in app framework xctest + do + find "$_dir" -name "*.$_type" | while read -r f + do + _proj=${f##*/} + _proj=${_proj%."$_type"} + if [ "$2" = "" ] || [ "$(echo "$_proj" | grep -i "$2")" != "" ]; + then + say " $g+$x Building reports for $_proj $_type" + dest=$([ -f "$f/$_proj" ] && echo "$f/$_proj" || echo "$f/Contents/MacOS/$_proj") + # shellcheck disable=SC2001 + _proj_name=$(echo "$_proj" | sed -e 's/[[:space:]]//g') + # shellcheck disable=SC2086 + xcrun llvm-cov show $beta_xcode_partials -instr-profile "$1" "$dest" > "$_proj_name.$_type.coverage.txt" \ + || say " ${r}x>${x} llvm-cov failed to produce results for $dest" + fi + done + done +} + + +# Credits to: https://gist.github.com/pkuczynski/8665367 +parse_yaml() { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' + local fs + fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" | + awk -F"$fs" '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; if (indent > 0) {vn=(vn)(vname[0])("_")} + printf("%s%s%s=\"%s\"\n", "'"$prefix"'",vn, $2, $3); + } + }' +} + + +if [ $# != 0 ]; +then + while getopts "a:A:b:B:cC:dD:e:f:F:g:G:hJ:k:Kn:p:P:q:r:R:s:S:t:T:u:U:vx:X:ZN:" o + do + codecov_flags+=( "$o" ) + case "$o" in + "N") + parent=$OPTARG + ;; + "a") + gcov_arg=$OPTARG + ;; + "A") + curlawsargs="$OPTARG" + ;; + "b") + build_o="$OPTARG" + ;; + "B") + branch_o="$OPTARG" + ;; + "c") + clean="1" + ;; + "C") + commit_o="$OPTARG" + ;; + "d") + dump="1" + ;; + "D") + ddp="$OPTARG" + ;; + "e") + env="$env,$OPTARG" + ;; + "f") + if [ "${OPTARG::1}" = "!" ]; + then + exclude_cov="$exclude_cov -not -path '${OPTARG:1}'" + + elif [[ "$OPTARG" = *"*"* ]]; + then + include_cov="$include_cov -or -name '$OPTARG'" + + else + ft_search=0 + if [ "$files" = "" ]; + then + files="$OPTARG" + else + files="$files +$OPTARG" + fi + fi + ;; + "F") + if [ "$flags" = "" ]; + then + flags="$OPTARG" + else + flags="$flags,$OPTARG" + fi + ;; + "g") + gcov_ignore="$gcov_ignore -not -path '$OPTARG'" + ;; + "G") + gcov_include="$gcov_include -path '$OPTARG'" + ;; + "h") + show_help + exit 0; + ;; + "J") + ft_xcodellvm="1" + ft_xcodeplist="0" + if [ "$xp" = "" ]; + then + xp="$OPTARG" + else + xp="$xp\|$OPTARG" + fi + ;; + "k") + prefix_o=$(echo "$OPTARG" | sed -e 's:^/*::' -e 's:/*$::') + ;; + "K") + b="" + g="" + r="" + e="" + x="" + ;; + "n") + name="$OPTARG" + ;; + "p") + proj_root="$OPTARG" + ;; + "P") + pr_o="$OPTARG" + ;; + "q") + save_to="$OPTARG" + ;; + "r") + slug_o="$OPTARG" + ;; + "R") + git_root="$OPTARG" + ;; + "s") + if [ "$search_in_o" = "" ]; + then + search_in_o="$OPTARG" + else + search_in_o="$search_in_o $OPTARG" + fi + ;; + "S") + # shellcheck disable=SC2089 + cacert="--cacert \"$OPTARG\"" + ;; + "t") + if [ "${OPTARG::1}" = "@" ]; + then + token=$(< "${OPTARG:1}" tr -d ' \n') + else + token="$OPTARG" + fi + ;; + "T") + tag_o="$OPTARG" + ;; + "u") + url_o=$(echo "$OPTARG" | sed -e 's/\/$//') + ;; + "U") + curlargs="$OPTARG" + ;; + "v") + set -x + curl_s="" + ;; + "x") + gcov_exe=$OPTARG + ;; + "X") + if [ "$OPTARG" = "gcov" ]; + then + ft_gcov="0" + elif [ "$OPTARG" = "coveragepy" ] || [ "$OPTARG" = "py" ]; + then + ft_coveragepy="0" + elif [ "$OPTARG" = "gcovout" ]; + then + ft_gcovout="0" + elif [ "$OPTARG" = "xcodellvm" ]; + then + ft_xcodellvm="1" + ft_xcodeplist="0" + elif [ "$OPTARG" = "fix" ] || [ "$OPTARG" = "fixes" ]; + then + ft_fix="0" + elif [ "$OPTARG" = "xcode" ]; + then + ft_xcodellvm="0" + ft_xcodeplist="0" + elif [ "$OPTARG" = "search" ]; + then + ft_search="0" + elif [ "$OPTARG" = "xcodepartials" ]; + then + beta_xcode_partials="-use-color" + elif [ "$OPTARG" = "network" ]; + then + ft_network="0" + elif [ "$OPTARG" = "s3" ]; + then + ft_s3="0" + elif [ "$OPTARG" = "html" ]; + then + ft_html="1" + elif [ "$OPTARG" = "recursesubs" ]; + then + git_ls_files_recurse_submodules_o="--recurse-submodules" + fi + ;; + "Z") + exit_with=1 + ;; + *) + echo -e "${r}Unexpected flag not supported${x}" + ;; + esac + done +fi + +say " + _____ _ + / ____| | | +| | ___ __| | ___ ___ _____ __ +| | / _ \\ / _\` |/ _ \\/ __/ _ \\ \\ / / +| |___| (_) | (_| | __/ (_| (_) \\ V / + \\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/ + Bash-$VERSION + +" + +search_in="$proj_root" + +#shellcheck disable=SC2154 +if [ "$JENKINS_URL" != "" ]; +then + say "$e==>$x Jenkins CI detected." + # https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project + # https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables + service="jenkins" + + # shellcheck disable=SC2154 + if [ "$ghprbSourceBranch" != "" ]; + then + branch="$ghprbSourceBranch" + elif [ "$GIT_BRANCH" != "" ]; + then + branch="$GIT_BRANCH" + elif [ "$BRANCH_NAME" != "" ]; + then + branch="$BRANCH_NAME" + fi + + # shellcheck disable=SC2154 + if [ "$ghprbActualCommit" != "" ]; + then + commit="$ghprbActualCommit" + elif [ "$GIT_COMMIT" != "" ]; + then + commit="$GIT_COMMIT" + fi + + # shellcheck disable=SC2154 + if [ "$ghprbPullId" != "" ]; + then + pr="$ghprbPullId" + elif [ "$CHANGE_ID" != "" ]; + then + pr="$CHANGE_ID" + fi + + build="$BUILD_NUMBER" + # shellcheck disable=SC2153 + build_url=$(urlencode "$BUILD_URL") + +elif [ "$CI" = "true" ] && [ "$TRAVIS" = "true" ] && [ "$SHIPPABLE" != "true" ]; +then + say "$e==>$x Travis CI detected." + # https://docs.travis-ci.com/user/environment-variables/ + service="travis" + commit="${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}" + build="$TRAVIS_JOB_NUMBER" + pr="$TRAVIS_PULL_REQUEST" + job="$TRAVIS_JOB_ID" + slug="$TRAVIS_REPO_SLUG" + env="$env,TRAVIS_OS_NAME" + tag="$TRAVIS_TAG" + if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ]; + then + branch="$TRAVIS_BRANCH" + fi + + language=$(compgen -A variable | grep "^TRAVIS_.*_VERSION$" | head -1) + if [ "$language" != "" ]; + then + env="$env,${!language}" + fi + +elif [ "$CODEBUILD_CI" = "true" ]; +then + say "$e==>$x AWS Codebuild detected." + # https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html + service="codebuild" + commit="$CODEBUILD_RESOLVED_SOURCE_VERSION" + build="$CODEBUILD_BUILD_ID" + branch="$(echo "$CODEBUILD_WEBHOOK_HEAD_REF" | sed 's/^refs\/heads\///')" + if [ "${CODEBUILD_SOURCE_VERSION/pr}" = "$CODEBUILD_SOURCE_VERSION" ] ; then + pr="false" + else + pr="$(echo "$CODEBUILD_SOURCE_VERSION" | sed 's/^pr\///')" + fi + job="$CODEBUILD_BUILD_ID" + slug="$(echo "$CODEBUILD_SOURCE_REPO_URL" | sed 's/^.*:\/\/[^\/]*\///' | sed 's/\.git$//')" + +elif [ "$DOCKER_REPO" != "" ]; +then + say "$e==>$x Docker detected." + # https://docs.docker.com/docker-cloud/builds/advanced/ + service="docker" + branch="$SOURCE_BRANCH" + commit="$SOURCE_COMMIT" + slug="$DOCKER_REPO" + tag="$CACHE_TAG" + env="$env,IMAGE_NAME" + +elif [ "$CI" = "true" ] && [ "$CI_NAME" = "codeship" ]; +then + say "$e==>$x Codeship CI detected." + # https://www.codeship.io/documentation/continuous-integration/set-environment-variables/ + service="codeship" + branch="$CI_BRANCH" + build="$CI_BUILD_NUMBER" + build_url=$(urlencode "$CI_BUILD_URL") + commit="$CI_COMMIT_ID" + +elif [ -n "$CF_BUILD_URL" ] && [ -n "$CF_BUILD_ID" ]; +then + say "$e==>$x Codefresh CI detected." + # https://docs.codefresh.io/v1.0/docs/variables + service="codefresh" + branch="$CF_BRANCH" + build="$CF_BUILD_ID" + build_url=$(urlencode "$CF_BUILD_URL") + commit="$CF_REVISION" + +elif [ "$TEAMCITY_VERSION" != "" ]; +then + say "$e==>$x TeamCity CI detected." + # https://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters + # https://confluence.jetbrains.com/plugins/servlet/mobile#content/view/74847298 + if [ "$TEAMCITY_BUILD_BRANCH" = '' ]; + then + echo " Teamcity does not automatically make build parameters available as environment variables." + echo " Add the following environment parameters to the build configuration" + echo " env.TEAMCITY_BUILD_BRANCH = %teamcity.build.branch%" + echo " env.TEAMCITY_BUILD_ID = %teamcity.build.id%" + echo " env.TEAMCITY_BUILD_URL = %teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%" + echo " env.TEAMCITY_BUILD_COMMIT = %system.build.vcs.number%" + echo " env.TEAMCITY_BUILD_REPOSITORY = %vcsroot..url%" + fi + service="teamcity" + branch="$TEAMCITY_BUILD_BRANCH" + build="$TEAMCITY_BUILD_ID" + build_url=$(urlencode "$TEAMCITY_BUILD_URL") + if [ "$TEAMCITY_BUILD_COMMIT" != "" ]; + then + commit="$TEAMCITY_BUILD_COMMIT" + else + commit="$BUILD_VCS_NUMBER" + fi + remote_addr="$TEAMCITY_BUILD_REPOSITORY" + +elif [ "$CI" = "true" ] && [ "$CIRCLECI" = "true" ]; +then + say "$e==>$x Circle CI detected." + # https://circleci.com/docs/environment-variables + service="circleci" + branch="$CIRCLE_BRANCH" + build="$CIRCLE_BUILD_NUM" + job="$CIRCLE_NODE_INDEX" + if [ "$CIRCLE_PROJECT_REPONAME" != "" ]; + then + slug="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME" + else + # git@github.com:owner/repo.git + slug="${CIRCLE_REPOSITORY_URL##*:}" + # owner/repo.git + slug="${slug%%.git}" + fi + pr="$CIRCLE_PR_NUMBER" + commit="$CIRCLE_SHA1" + search_in="$search_in $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS" + +elif [ "$BUDDYBUILD_BRANCH" != "" ]; +then + say "$e==>$x buddybuild detected" + # http://docs.buddybuild.com/v6/docs/custom-prebuild-and-postbuild-steps + service="buddybuild" + branch="$BUDDYBUILD_BRANCH" + build="$BUDDYBUILD_BUILD_NUMBER" + build_url="https://dashboard.buddybuild.com/public/apps/$BUDDYBUILD_APP_ID/build/$BUDDYBUILD_BUILD_ID" + # BUDDYBUILD_TRIGGERED_BY + if [ "$ddp" = "$HOME/Library/Developer/Xcode/DerivedData" ]; + then + ddp="/private/tmp/sandbox/${BUDDYBUILD_APP_ID}/bbtest" + fi + +elif [ "${bamboo_planRepository_revision}" != "" ]; +then + say "$e==>$x Bamboo detected" + # https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html#Bamboovariables-Build-specificvariables + service="bamboo" + commit="${bamboo_planRepository_revision}" + # shellcheck disable=SC2154 + branch="${bamboo_planRepository_branch}" + # shellcheck disable=SC2154 + build="${bamboo_buildNumber}" + # shellcheck disable=SC2154 + build_url="${bamboo_buildResultsUrl}" + # shellcheck disable=SC2154 + remote_addr="${bamboo_planRepository_repositoryUrl}" + +elif [ "$CI" = "true" ] && [ "$BITRISE_IO" = "true" ]; +then + # http://devcenter.bitrise.io/faq/available-environment-variables/ + say "$e==>$x Bitrise CI detected." + service="bitrise" + branch="$BITRISE_GIT_BRANCH" + build="$BITRISE_BUILD_NUMBER" + build_url=$(urlencode "$BITRISE_BUILD_URL") + pr="$BITRISE_PULL_REQUEST" + if [ "$GIT_CLONE_COMMIT_HASH" != "" ]; + then + commit="$GIT_CLONE_COMMIT_HASH" + fi + +elif [ "$CI" = "true" ] && [ "$SEMAPHORE" = "true" ]; +then + say "$e==>$x Semaphore CI detected." +# https://docs.semaphoreci.com/ci-cd-environment/environment-variables/#semaphore-related + service="semaphore" + branch="$SEMAPHORE_GIT_BRANCH" + build="$SEMAPHORE_WORKFLOW_NUMBER" + job="$SEMAPHORE_JOB_ID" + pr="$PULL_REQUEST_NUMBER" + slug="$SEMAPHORE_REPO_SLUG" + commit="$REVISION" + env="$env,SEMAPHORE_TRIGGER_SOURCE" + +elif [ "$CI" = "true" ] && [ "$BUILDKITE" = "true" ]; +then + say "$e==>$x Buildkite CI detected." + # https://buildkite.com/docs/guides/environment-variables + service="buildkite" + branch="$BUILDKITE_BRANCH" + build="$BUILDKITE_BUILD_NUMBER" + job="$BUILDKITE_JOB_ID" + build_url=$(urlencode "$BUILDKITE_BUILD_URL") + slug="$BUILDKITE_PROJECT_SLUG" + commit="$BUILDKITE_COMMIT" + if [[ "$BUILDKITE_PULL_REQUEST" != "false" ]]; then + pr="$BUILDKITE_PULL_REQUEST" + fi + tag="$BUILDKITE_TAG" + +elif [ "$CI" = "drone" ] || [ "$DRONE" = "true" ]; +then + say "$e==>$x Drone CI detected." + # http://docs.drone.io/env.html + # drone commits are not full shas + service="drone.io" + branch="$DRONE_BRANCH" + build="$DRONE_BUILD_NUMBER" + build_url=$(urlencode "${DRONE_BUILD_LINK}") + pr="$DRONE_PULL_REQUEST" + job="$DRONE_JOB_NUMBER" + tag="$DRONE_TAG" + +elif [ "$CI" = "true" ] && [ "$HEROKU_TEST_RUN_BRANCH" != "" ]; +then + say "$e==>$x Heroku CI detected." + # https://devcenter.heroku.com/articles/heroku-ci#environment-variables + service="heroku" + branch="$HEROKU_TEST_RUN_BRANCH" + build="$HEROKU_TEST_RUN_ID" + commit="$HEROKU_TEST_RUN_COMMIT_VERSION" + +elif [[ "$CI" = "true" || "$CI" = "True" ]] && [[ "$APPVEYOR" = "true" || "$APPVEYOR" = "True" ]]; +then + say "$e==>$x Appveyor CI detected." + # http://www.appveyor.com/docs/environment-variables + service="appveyor" + branch="$APPVEYOR_REPO_BRANCH" + build=$(urlencode "$APPVEYOR_JOB_ID") + pr="$APPVEYOR_PULL_REQUEST_NUMBER" + job="$APPVEYOR_ACCOUNT_NAME%2F$APPVEYOR_PROJECT_SLUG%2F$APPVEYOR_BUILD_VERSION" + slug="$APPVEYOR_REPO_NAME" + commit="$APPVEYOR_REPO_COMMIT" + build_url=$(urlencode "${APPVEYOR_URL}/project/${APPVEYOR_REPO_NAME}/builds/$APPVEYOR_BUILD_ID/job/${APPVEYOR_JOB_ID}") + +elif [ "$CI" = "true" ] && [ "$WERCKER_GIT_BRANCH" != "" ]; +then + say "$e==>$x Wercker CI detected." + # http://devcenter.wercker.com/articles/steps/variables.html + service="wercker" + branch="$WERCKER_GIT_BRANCH" + build="$WERCKER_MAIN_PIPELINE_STARTED" + slug="$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY" + commit="$WERCKER_GIT_COMMIT" + +elif [ "$CI" = "true" ] && [ "$MAGNUM" = "true" ]; +then + say "$e==>$x Magnum CI detected." + # https://magnum-ci.com/docs/environment + service="magnum" + branch="$CI_BRANCH" + build="$CI_BUILD_NUMBER" + commit="$CI_COMMIT" + +elif [ "$SHIPPABLE" = "true" ]; +then + say "$e==>$x Shippable CI detected." + # http://docs.shippable.com/ci_configure/ + service="shippable" + # shellcheck disable=SC2153 + branch=$([ "$HEAD_BRANCH" != "" ] && echo "$HEAD_BRANCH" || echo "$BRANCH") + build="$BUILD_NUMBER" + build_url=$(urlencode "$BUILD_URL") + pr="$PULL_REQUEST" + slug="$REPO_FULL_NAME" + # shellcheck disable=SC2153 + commit="$COMMIT" + +elif [ "$TDDIUM" = "true" ]; +then + say "Solano CI detected." + # http://docs.solanolabs.com/Setup/tddium-set-environment-variables/ + service="solano" + commit="$TDDIUM_CURRENT_COMMIT" + branch="$TDDIUM_CURRENT_BRANCH" + build="$TDDIUM_TID" + pr="$TDDIUM_PR_ID" + +elif [ "$GREENHOUSE" = "true" ]; +then + say "$e==>$x Greenhouse CI detected." + # http://docs.greenhouseci.com/docs/environment-variables-files + service="greenhouse" + branch="$GREENHOUSE_BRANCH" + build="$GREENHOUSE_BUILD_NUMBER" + build_url=$(urlencode "$GREENHOUSE_BUILD_URL") + pr="$GREENHOUSE_PULL_REQUEST" + commit="$GREENHOUSE_COMMIT" + search_in="$search_in $GREENHOUSE_EXPORT_DIR" + +elif [ "$GITLAB_CI" != "" ]; +then + say "$e==>$x GitLab CI detected." + # http://doc.gitlab.com/ce/ci/variables/README.html + service="gitlab" + branch="${CI_BUILD_REF_NAME:-$CI_COMMIT_REF_NAME}" + build="${CI_BUILD_ID:-$CI_JOB_ID}" + remote_addr="${CI_BUILD_REPO:-$CI_REPOSITORY_URL}" + commit="${CI_BUILD_REF:-$CI_COMMIT_SHA}" + slug="${CI_PROJECT_PATH}" + +elif [ "$GITHUB_ACTIONS" != "" ]; +then + say "$e==>$x GitHub Actions detected." + + # https://github.com/features/actions + service="github-actions" + + # https://help.github.com/en/articles/virtual-environments-for-github-actions#environment-variables + branch="${GITHUB_REF#refs/heads/}" + if [ "$GITHUB_HEAD_REF" != "" ]; + then + # PR refs are in the format: refs/pull/7/merge + pr="${GITHUB_REF#refs/pull/}" + pr="${pr%/merge}" + branch="${GITHUB_HEAD_REF}" + fi + commit="${GITHUB_SHA}" + slug="${GITHUB_REPOSITORY}" + build="${GITHUB_RUN_ID}" + build_url=$(urlencode "http://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}") + +elif [ "$SYSTEM_TEAMFOUNDATIONSERVERURI" != "" ]; +then + say "$e==>$x Azure Pipelines detected." + # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=vsts + # https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&viewFallbackFrom=vsts&tabs=yaml + service="azure_pipelines" + commit="$BUILD_SOURCEVERSION" + build="$BUILD_BUILDNUMBER" + if [ -z "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; + then + pr="$SYSTEM_PULLREQUEST_PULLREQUESTID" + else + pr="$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" + fi + project="${SYSTEM_TEAMPROJECT}" + server_uri="${SYSTEM_TEAMFOUNDATIONSERVERURI}" + job="${BUILD_BUILDID}" + branch="$BUILD_SOURCEBRANCHNAME" + build_url=$(urlencode "${SYSTEM_TEAMFOUNDATIONSERVERURI}${SYSTEM_TEAMPROJECT}/_build/results?buildId=${BUILD_BUILDID}") +elif [ "$CI" = "true" ] && [ "$BITBUCKET_BUILD_NUMBER" != "" ]; +then + say "$e==>$x Bitbucket detected." + # https://confluence.atlassian.com/bitbucket/variables-in-pipelines-794502608.html + service="bitbucket" + branch="$BITBUCKET_BRANCH" + build="$BITBUCKET_BUILD_NUMBER" + slug="$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG" + job="$BITBUCKET_BUILD_NUMBER" + pr="$BITBUCKET_PR_ID" + commit="$BITBUCKET_COMMIT" + # See https://jira.atlassian.com/browse/BCLOUD-19393 + if [ "${#commit}" = 12 ]; + then + commit=$(git rev-parse "$BITBUCKET_COMMIT") + fi +elif [ "$CI" = "true" ] && [ "$BUDDY" = "true" ]; +then + say "$e==>$x Buddy CI detected." + # https://buddy.works/docs/pipelines/environment-variables + service="buddy" + branch="$BUDDY_EXECUTION_BRANCH" + build="$BUDDY_EXECUTION_ID" + build_url=$(urlencode "$BUDDY_EXECUTION_URL") + commit="$BUDDY_EXECUTION_REVISION" + pr="$BUDDY_EXECUTION_PULL_REQUEST_NO" + tag="$BUDDY_EXECUTION_TAG" + slug="$BUDDY_REPO_SLUG" + +elif [ "$CIRRUS_CI" != "" ]; +then + say "$e==>$x Cirrus CI detected." + # https://cirrus-ci.org/guide/writing-tasks/#environment-variables + service="cirrus-ci" + slug="$CIRRUS_REPO_FULL_NAME" + branch="$CIRRUS_BRANCH" + pr="$CIRRUS_PR" + commit="$CIRRUS_CHANGE_IN_REPO" + build="$CIRRUS_TASK_ID" + job="$CIRRUS_TASK_NAME" + +else + say "${r}x>${x} No CI provider detected." + say " Testing inside Docker? ${b}http://docs.codecov.io/docs/testing-with-docker${x}" + say " Testing with Tox? ${b}https://docs.codecov.io/docs/python#section-testing-with-tox${x}" + +fi + +say " ${e}project root:${x} $git_root" + +# find branch, commit, repo from git command +if [ "$GIT_BRANCH" != "" ]; +then + branch="$GIT_BRANCH" + +elif [ "$branch" = "" ]; +then + branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || hg branch 2>/dev/null || echo "") + if [ "$branch" = "HEAD" ]; + then + branch="" + fi +fi + +if [ "$commit_o" = "" ]; +then + # merge commit -> actual commit + mc= + if [ -n "$pr" ] && [ "$pr" != false ]; + then + mc=$(git show --no-patch --format="%P" 2>/dev/null || echo "") + fi + if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]]; + then + say " Fixing merge commit SHA" + commit=$(echo "$mc" | cut -d' ' -f2) + elif [ "$GIT_COMMIT" != "" ]; + then + commit="$GIT_COMMIT" + elif [ "$commit" = "" ]; + then + commit=$(git log -1 --format="%H" 2>/dev/null || hg id -i --debug 2>/dev/null | tr -d '+' || echo "") + fi +else + commit="$commit_o" +fi + +if [ "$CODECOV_TOKEN" != "" ] && [ "$token" = "" ]; +then + say "${e}-->${x} token set from env" + token="$CODECOV_TOKEN" +fi + +if [ "$CODECOV_URL" != "" ] && [ "$url_o" = "" ]; +then + say "${e}-->${x} url set from env" + url_o=$(echo "$CODECOV_URL" | sed -e 's/\/$//') +fi + +if [ "$CODECOV_SLUG" != "" ]; +then + say "${e}-->${x} slug set from env" + slug_o="$CODECOV_SLUG" + +elif [ "$slug" = "" ]; +then + if [ "$remote_addr" = "" ]; + then + remote_addr=$(git config --get remote.origin.url || hg paths default || echo '') + fi + if [ "$remote_addr" != "" ]; + then + if echo "$remote_addr" | grep -q "//"; then + # https + slug=$(echo "$remote_addr" | cut -d / -f 4,5 | sed -e 's/\.git$//') + else + # ssh + slug=$(echo "$remote_addr" | cut -d : -f 2 | sed -e 's/\.git$//') + fi + fi + if [ "$slug" = "/" ]; + then + slug="" + fi +fi + +yaml=$(cd "$git_root" && \ + git ls-files "*codecov.yml" "*codecov.yaml" 2>/dev/null \ + || hg locate "*codecov.yml" "*codecov.yaml" 2>/dev/null \ + || cd "$proj_root" && find . -maxdepth 1 -type f -name '*codecov.y*ml' 2>/dev/null \ + || echo '') +yaml=$(echo "$yaml" | head -1) + +if [ "$yaml" != "" ]; +then + say " ${e}Yaml found at:${x} $yaml" + if [[ "$yaml" != /* ]]; then + # relative path for yaml file given, assume relative to the repo root + yaml="$git_root/$yaml" + fi + config=$(parse_yaml "$yaml" || echo '') + + # TODO validate the yaml here + + if [ "$(echo "$config" | grep 'codecov_token="')" != "" ] && [ "$token" = "" ]; + then + say "${e}-->${x} token set from yaml" + token="$(echo "$config" | grep 'codecov_token="' | sed -e 's/codecov_token="//' | sed -e 's/"\.*//')" + fi + + if [ "$(echo "$config" | grep 'codecov_url="')" != "" ] && [ "$url_o" = "" ]; + then + say "${e}-->${x} url set from yaml" + url_o="$(echo "$config" | grep 'codecov_url="' | sed -e 's/codecov_url="//' | sed -e 's/"\.*//')" + fi + + if [ "$(echo "$config" | grep 'codecov_slug="')" != "" ] && [ "$slug_o" = "" ]; + then + say "${e}-->${x} slug set from yaml" + slug_o="$(echo "$config" | grep 'codecov_slug="' | sed -e 's/codecov_slug="//' | sed -e 's/"\.*//')" + fi +else + say " ${g}Yaml not found, that's ok! Learn more at${x} ${b}http://docs.codecov.io/docs/codecov-yaml${x}" +fi + +if [ "$branch_o" != "" ]; +then + branch=$(urlencode "$branch_o") +else + branch=$(urlencode "$branch") +fi + +if [ "$slug_o" = "" ]; +then + urlencoded_slug=$(urlencode "$slug") +else + urlencoded_slug=$(urlencode "$slug_o") +fi + +query="branch=$branch\ + &commit=$commit\ + &build=$([ "$build_o" = "" ] && echo "$build" || echo "$build_o")\ + &build_url=$build_url\ + &name=$(urlencode "$name")\ + &tag=$([ "$tag_o" = "" ] && echo "$tag" || echo "$tag_o")\ + &slug=$urlencoded_slug\ + &service=$service\ + &flags=$flags\ + &pr=$([ "$pr_o" = "" ] && echo "${pr##\#}" || echo "${pr_o##\#}")\ + &job=$job\ + &cmd_args=$(IFS=,; echo "${codecov_flags[*]}")" + +if [ -n "$project" ] && [ -n "$server_uri" ]; +then + query=$(echo "$query&project=$project&server_uri=$server_uri" | tr -d ' ') +fi + +if [ "$parent" != "" ]; +then + query=$(echo "parent=$parent&$query" | tr -d ' ') +fi + +if [ "$ft_search" = "1" ]; +then + # detect bower comoponents location + bower_components="bower_components" + bower_rc=$(cd "$git_root" && cat .bowerrc 2>/dev/null || echo "") + if [ "$bower_rc" != "" ]; + then + bower_components=$(echo "$bower_rc" | tr -d '\n' | grep '"directory"' | cut -d'"' -f4 | sed -e 's/\/$//') + if [ "$bower_components" = "" ]; + then + bower_components="bower_components" + fi + fi + + # Swift Coverage + if [ "$ft_xcodellvm" = "1" ] && [ -d "$ddp" ]; + then + say "${e}==>${x} Processing Xcode reports via llvm-cov" + say " DerivedData folder: $ddp" + profdata_files=$(find "$ddp" -name '*.profdata' 2>/dev/null || echo '') + if [ "$profdata_files" != "" ]; + then + # xcode via profdata + if [ "$xp" = "" ]; + then + # xp=$(xcodebuild -showBuildSettings 2>/dev/null | grep -i "^\s*PRODUCT_NAME" | sed -e 's/.*= \(.*\)/\1/') + # say " ${e}->${x} Speed up Xcode processing by adding ${e}-J '$xp'${x}" + say " ${g}hint${x} Speed up Swift processing by using use ${g}-J 'AppName'${x} (regexp accepted)" + say " ${g}hint${x} This will remove Pods/ from your report. Also ${b}https://docs.codecov.io/docs/ignoring-paths${x}" + fi + while read -r profdata; + do + if [ "$profdata" != "" ]; + then + swiftcov "$profdata" "$xp" + fi + done <<< "$profdata_files" + else + say " ${e}->${x} No Swift coverage found" + fi + + # Obj-C Gcov Coverage + if [ "$ft_gcov" = "1" ]; + then + say " ${e}->${x} Running $gcov_exe for Obj-C" + if [ "$ft_gcovout" = "0" ]; + then + # suppress gcov output + bash -c "find $ddp -type f -name '*.gcda' $gcov_include $gcov_ignore -exec $gcov_exe -p $gcov_arg {} +" >/dev/null 2>&1 || true + else + bash -c "find $ddp -type f -name '*.gcda' $gcov_include $gcov_ignore -exec $gcov_exe -p $gcov_arg {} +" || true + fi + fi + fi + + if [ "$ft_xcodeplist" = "1" ] && [ -d "$ddp" ]; + then + say "${e}==>${x} Processing Xcode plists" + plists_files=$(find "$ddp" -name '*.xccoverage' 2>/dev/null || echo '') + if [ "$plists_files" != "" ]; + then + while read -r plist; + do + if [ "$plist" != "" ]; + then + say " ${g}Found${x} plist file at $plist" + plutil -convert xml1 -o "$(basename "$plist").plist" -- "$plist" + fi + done <<< "$plists_files" + fi + fi + + # Gcov Coverage + if [ "$ft_gcov" = "1" ]; + then + say "${e}==>${x} Running $gcov_exe in $proj_root ${e}(disable via -X gcov)${x}" + if [ "$ft_gcovout" = "0" ]; + then + # suppress gcov output + bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" >/dev/null 2>&1 || true + else + bash -c "find $proj_root -type f -name '*.gcno' $gcov_include $gcov_ignore -exec $gcov_exe -pb $gcov_arg {} +" || true + fi + else + say "${e}==>${x} gcov disabled" + fi + + # Python Coverage + if [ "$ft_coveragepy" = "1" ]; + then + if [ ! -f coverage.xml ]; + then + if command -v coverage >/dev/null 2>&1; + then + say "${e}==>${x} Python coveragepy exists ${e}disable via -X coveragepy${x}" + + dotcoverage=$(find "$git_root" -name '.coverage' -or -name '.coverage.*' | head -1 || echo '') + if [ "$dotcoverage" != "" ]; + then + cd "$(dirname "$dotcoverage")" + if [ ! -f .coverage ]; + then + say " ${e}->${x} Running coverage combine" + coverage combine -a + fi + say " ${e}->${x} Running coverage xml" + if [ "$(coverage xml -i)" != "No data to report." ]; + then + files="$files +$PWD/coverage.xml" + else + say " ${r}No data to report.${x}" + fi + cd "$proj_root" + else + say " ${r}No .coverage file found.${x}" + fi + else + say "${e}==>${x} Python coveragepy not found" + fi + fi + else + say "${e}==>${x} Python coveragepy disabled" + fi + + if [ "$search_in_o" != "" ]; + then + # location override + search_in="$search_in_o" + fi + + say "$e==>$x Searching for coverage reports in:" + for _path in $search_in + do + say " ${g}+${x} $_path" + done + + patterns="find $search_in \( \ + -name vendor \ + -or -name htmlcov \ + -or -name virtualenv \ + -or -name js/generated/coverage \ + -or -name .virtualenv \ + -or -name virtualenvs \ + -or -name .virtualenvs \ + -or -name .env \ + -or -name .envs \ + -or -name env \ + -or -name .yarn-cache \ + -or -name envs \ + -or -name .venv \ + -or -name .venvs \ + -or -name venv \ + -or -name venvs \ + -or -name .git \ + -or -name .hg \ + -or -name .tox \ + -or -name __pycache__ \ + -or -name '.egg-info*' \ + -or -name '$bower_components' \ + -or -name node_modules \ + -or -name 'conftest_*.c.gcov' \ + \) -prune -or \ + -type f \( -name '*coverage*.*' \ + -or -name '*.clover' \ + -or -name '*.codecov.*' \ + -or -name '*.gcov' \ + -or -name '*.lcov' \ + -or -name '*.lst' \ + -or -name 'clover.xml' \ + -or -name 'cobertura.xml' \ + -or -name 'codecov.*' \ + -or -name 'cover.out' \ + -or -name 'coverage-final.json' \ + -or -name 'excoveralls.json' \ + -or -name 'gcov.info' \ + -or -name 'jacoco*.xml' \ + -or -name '*Jacoco*.xml' \ + -or -name 'lcov.dat' \ + -or -name 'lcov.info' \ + -or -name 'luacov.report.out' \ + -or -name 'naxsi.info' \ + -or -name 'nosetests.xml' \ + -or -name 'report.xml' \ + $include_cov \) \ + $exclude_cov \ + -not -name '*.am' \ + -not -name '*.bash' \ + -not -name '*.bat' \ + -not -name '*.bw' \ + -not -name '*.cfg' \ + -not -name '*.class' \ + -not -name '*.cmake' \ + -not -name '*.cmake' \ + -not -name '*.conf' \ + -not -name '*.coverage' \ + -not -name '*.cp' \ + -not -name '*.cpp' \ + -not -name '*.crt' \ + -not -name '*.css' \ + -not -name '*.csv' \ + -not -name '*.csv' \ + -not -name '*.data' \ + -not -name '*.db' \ + -not -name '*.dox' \ + -not -name '*.ec' \ + -not -name '*.ec' \ + -not -name '*.egg' \ + -not -name '*.el' \ + -not -name '*.env' \ + -not -name '*.erb' \ + -not -name '*.exe' \ + -not -name '*.ftl' \ + -not -name '*.gif' \ + -not -name '*.gradle' \ + -not -name '*.gz' \ + -not -name '*.h' \ + -not -name '*.html' \ + -not -name '*.in' \ + -not -name '*.jade' \ + -not -name '*.jar*' \ + -not -name '*.jpeg' \ + -not -name '*.jpg' \ + -not -name '*.js' \ + -not -name '*.less' \ + -not -name '*.log' \ + -not -name '*.m4' \ + -not -name '*.mak*' \ + -not -name '*.md' \ + -not -name '*.o' \ + -not -name '*.p12' \ + -not -name '*.pem' \ + -not -name '*.png' \ + -not -name '*.pom*' \ + -not -name '*.profdata' \ + -not -name '*.proto' \ + -not -name '*.ps1' \ + -not -name '*.pth' \ + -not -name '*.py' \ + -not -name '*.pyc' \ + -not -name '*.pyo' \ + -not -name '*.rb' \ + -not -name '*.rsp' \ + -not -name '*.rst' \ + -not -name '*.ru' \ + -not -name '*.sbt' \ + -not -name '*.scss' \ + -not -name '*.scss' \ + -not -name '*.serialized' \ + -not -name '*.sh' \ + -not -name '*.snapshot' \ + -not -name '*.sql' \ + -not -name '*.svg' \ + -not -name '*.tar.tz' \ + -not -name '*.template' \ + -not -name '*.whl' \ + -not -name '*.xcconfig' \ + -not -name '*.xcoverage.*' \ + -not -name '*/classycle/report.xml' \ + -not -name '*codecov.yml' \ + -not -name '*~' \ + -not -name '.*coveragerc' \ + -not -name '.coverage*' \ + -not -name 'coverage-summary.json' \ + -not -name 'createdFiles.lst' \ + -not -name 'fullLocaleNames.lst' \ + -not -name 'include.lst' \ + -not -name 'inputFiles.lst' \ + -not -name 'phpunit-code-coverage.xml' \ + -not -name 'phpunit-coverage.xml' \ + -not -name 'remapInstanbul.coverage*.json' \ + -not -name 'scoverage.measurements.*' \ + -not -name 'test_*_coverage.txt' \ + -not -name 'testrunner-coverage*' \ + -print 2>/dev/null" + files=$(eval "$patterns" || echo '') + +elif [ "$include_cov" != "" ]; +then + files=$(eval "find $search_in -type f \( ${include_cov:5} \)$exclude_cov 2>/dev/null" || echo '') +fi + +num_of_files=$(echo "$files" | wc -l | tr -d ' ') +if [ "$num_of_files" != '' ] && [ "$files" != '' ]; +then + say " ${e}->${x} Found $num_of_files reports" +fi + +# no files found +if [ "$files" = "" ]; +then + say "${r}-->${x} No coverage report found." + say " Please visit ${b}http://docs.codecov.io/docs/supported-languages${x}" + exit ${exit_with}; +fi + +if [ "$ft_network" == "1" ]; +then + say "${e}==>${x} Detecting git/mercurial file structure" + network=$(cd "$git_root" && git ls-files $git_ls_files_recurse_submodules_o 2>/dev/null || hg locate 2>/dev/null || echo "") + if [ "$network" = "" ]; + then + network=$(find "$git_root" \( \ + -name virtualenv \ + -name .virtualenv \ + -name virtualenvs \ + -name .virtualenvs \ + -name '*.png' \ + -name '*.gif' \ + -name '*.jpg' \ + -name '*.jpeg' \ + -name '*.md' \ + -name .env \ + -name .envs \ + -name env \ + -name envs \ + -name .venv \ + -name .venvs \ + -name venv \ + -name venvs \ + -name .git \ + -name .egg-info \ + -name shunit2-2.1.6 \ + -name vendor \ + -name __pycache__ \ + -name node_modules \ + -path "*/$bower_components/*" \ + -path '*/target/delombok/*' \ + -path '*/build/lib/*' \ + -path '*/js/generated/coverage/*' \ + \) -prune -or \ + -type f -print 2>/dev/null || echo '') + fi + + if [ "$prefix_o" != "" ]; + then + network=$(echo "$network" | awk "{print \"$prefix_o/\"\$0}") + fi +fi + +upload_file=$(mktemp /tmp/codecov.XXXXXX) +adjustments_file=$(mktemp /tmp/codecov.adjustments.XXXXXX) + +cleanup() { + rm -f "$upload_file" "$adjustments_file" "$upload_file.gz" +} + +trap cleanup INT ABRT TERM + +if [ "$env" != "" ]; +then + inc_env="" + say "${e}==>${x} Appending build variables" + for varname in $(echo "$env" | tr ',' ' ') + do + if [ "$varname" != "" ]; + then + say " ${g}+${x} $varname" + inc_env="${inc_env}${varname}=$(eval echo "\$${varname}") +" + fi + done + +echo "$inc_env<<<<<< ENV" >> "$upload_file" +fi + +# Append git file list +# write discovered yaml location +echo "$yaml" >> "$upload_file" +if [ "$ft_network" == "1" ]; +then + i="woff|eot|otf" # fonts + i="$i|gif|png|jpg|jpeg|psd" # images + i="$i|ptt|pptx|numbers|pages|md|txt|xlsx|docx|doc|pdf|csv" # docs + i="$i|yml|yaml|.gitignore" # supporting docs + + if [ "$ft_html" != "1" ]; + then + i="$i|html" + fi + + echo "$network" | grep -vwE "($i)$" >> "$upload_file" +fi +echo "<<<<<< network" >> "$upload_file" + +fr=0 +say "${e}==>${x} Reading reports" +while IFS='' read -r file; +do + # read the coverage file + if [ "$(echo "$file" | tr -d ' ')" != '' ]; + then + if [ -f "$file" ]; + then + report_len=$(wc -c < "$file") + if [ "$report_len" -ne 0 ]; + then + say " ${g}+${x} $file ${e}bytes=$(echo "$report_len" | tr -d ' ')${x}" + # append to to upload + _filename=$(basename "$file") + if [ "${_filename##*.}" = 'gcov' ]; + then + { + echo "# path=$(echo "$file.reduced" | sed "s|^$git_root/||")"; + # get file name + head -1 "$file"; + } >> "$upload_file" + # 1. remove source code + # 2. remove ending bracket lines + # 3. remove whitespace + # 4. remove contextual lines + # 5. remove function names + awk -F': *' '{print $1":"$2":"}' "$file" \ + | sed '\/: *} *$/d' \ + | sed 's/^ *//' \ + | sed '/^-/d' \ + | sed 's/^function.*/func/' >> "$upload_file" + else + { + echo "# path=${file//^$git_root/||}"; + cat "$file"; + } >> "$upload_file" + fi + echo "<<<<<< EOF" >> "$upload_file" + fr=1 + if [ "$clean" = "1" ]; + then + rm "$file" + fi + else + say " ${r}-${x} Skipping empty file $file" + fi + else + say " ${r}-${x} file not found at $file" + fi + fi +done <<< "$(echo -e "$files")" + +if [ "$fr" = "0" ]; +then + say "${r}-->${x} No coverage data found." + say " Please visit ${b}http://docs.codecov.io/docs/supported-languages${x}" + say " search for your projects language to learn how to collect reports." + exit ${exit_with}; +fi + +if [ "$ft_fix" = "1" ]; +then + say "${e}==>${x} Appending adjustments" + say " ${b}https://docs.codecov.io/docs/fixing-reports${x}" + + empty_line='^[[:space:]]*$' + # // + syntax_comment='^[[:space:]]*//.*' + # /* or */ + syntax_comment_block='^[[:space:]]*(\/\*|\*\/)[[:space:]]*$' + # { or } + syntax_bracket='^[[:space:]]*[\{\}][[:space:]]*(//.*)?$' + # [ or ] + syntax_list='^[[:space:]]*[][][[:space:]]*(//.*)?$' + # func ... { + syntax_go_func='^[[:space:]]*[func].*[\{][[:space:]]*$' + + # shellcheck disable=SC2089 + skip_dirs="-not -path '*/$bower_components/*' \ + -not -path '*/node_modules/*'" + + cut_and_join() { + awk 'BEGIN { FS=":" } + $3 ~ /\/\*/ || $3 ~ /\*\// { print $0 ; next } + $1!=key { if (key!="") print out ; key=$1 ; out=$1":"$2 ; next } + { out=out","$2 } + END { print out }' 2>/dev/null + } + + if echo "$network" | grep -m1 '.kt$' 1>/dev/null; + then + # skip brackets and comments + cd "$git_root" && \ + find . -type f \ + -name '*.kt' \ + -exec \ + grep -nIHE -e "$syntax_bracket" \ + -e "$syntax_comment_block" {} \; \ + | cut_and_join \ + >> "$adjustments_file" \ + || echo '' + + # last line in file + cd "$git_root" && \ + find . -type f \ + -name '*.kt' -exec \ + wc -l {} \; \ + | while read -r l; do echo "EOF: $l"; done \ + 2>/dev/null \ + >> "$adjustments_file" \ + || echo '' + fi + + if echo "$network" | grep -m1 '.go$' 1>/dev/null; + then + # skip empty lines, comments, and brackets + cd "$git_root" && \ + find . -type f \ + -not -path '*/vendor/*' \ + -not -path '*/caches/*' \ + -name '*.go' \ + -exec \ + grep -nIHE \ + -e "$empty_line" \ + -e "$syntax_comment" \ + -e "$syntax_comment_block" \ + -e "$syntax_bracket" \ + -e "$syntax_go_func" \ + {} \; \ + | cut_and_join \ + >> "$adjustments_file" \ + || echo '' + fi + + if echo "$network" | grep -m1 '.dart$' 1>/dev/null; + then + # skip brackets + cd "$git_root" && \ + find . -type f \ + -name '*.dart' \ + -exec \ + grep -nIHE \ + -e "$syntax_bracket" \ + {} \; \ + | cut_and_join \ + >> "$adjustments_file" \ + || echo '' + fi + + if echo "$network" | grep -m1 '.php$' 1>/dev/null; + then + # skip empty lines, comments, and brackets + cd "$git_root" && \ + find . -type f \ + -not -path "*/vendor/*" \ + -name '*.php' \ + -exec \ + grep -nIHE \ + -e "$syntax_list" \ + -e "$syntax_bracket" \ + -e '^[[:space:]]*\);[[:space:]]*(//.*)?$' \ + {} \; \ + | cut_and_join \ + >> "$adjustments_file" \ + || echo '' + fi + + if echo "$network" | grep -m1 '\(.cpp\|.h\|.cxx\|.c\|.hpp\|.m\|.swift\)$' 1>/dev/null; + then + # skip brackets + # shellcheck disable=SC2086,SC2090 + cd "$git_root" && \ + find . -type f \ + $skip_dirs \ + \( \ + -name '*.h' \ + -or -name '*.cpp' \ + -or -name '*.cxx' \ + -or -name '*.m' \ + -or -name '*.c' \ + -or -name '*.hpp' \ + -or -name '*.swift' \ + \) -exec \ + grep -nIHE \ + -e "$empty_line" \ + -e "$syntax_bracket" \ + -e '// LCOV_EXCL' \ + {} \; \ + | cut_and_join \ + >> "$adjustments_file" \ + || echo '' + + # skip brackets + # shellcheck disable=SC2086,SC2090 + cd "$git_root" && \ + find . -type f \ + $skip_dirs \ + \( \ + -name '*.h' \ + -or -name '*.cpp' \ + -or -name '*.cxx' \ + -or -name '*.m' \ + -or -name '*.c' \ + -or -name '*.hpp' \ + -or -name '*.swift' \ + \) -exec \ + grep -nIH '// LCOV_EXCL' \ + {} \; \ + >> "$adjustments_file" \ + || echo '' + + fi + + found=$(< "$adjustments_file" tr -d ' ') + + if [ "$found" != "" ]; + then + say " ${g}+${x} Found adjustments" + { + echo "# path=fixes"; + cat "$adjustments_file"; + echo "<<<<<< EOF"; + } >> "$upload_file" + rm -rf "$adjustments_file" + else + say " ${e}->${x} No adjustments found" + fi +fi + +if [ "$url_o" != "" ]; +then + url="$url_o" +fi + +if [ "$dump" != "0" ]; +then + # trim whitespace from query + say " ${e}->${x} Dumping upload file (no upload)" + echo "$url/upload/v4?$(echo "package=bash-$VERSION&token=$token&$query" | tr -d ' ')" + cat "$upload_file" +else + if [ "$save_to" != "" ]; + then + say "${e}==>${x} Copying upload file to ${save_to}" + cp "$upload_file" "$save_to" + fi + + say "${e}==>${x} Gzipping contents" + gzip -nf9 "$upload_file" + + query=$(echo "${query}" | tr -d ' ') + say "${e}==>${x} Uploading reports" + say " ${e}url:${x} $url" + say " ${e}query:${x} $query" + + # Full query without token (to display on terminal output) + queryNoToken=$(echo "package=bash-$VERSION&token=secret&$query" | tr -d ' ') + # now add token to query + query=$(echo "package=bash-$VERSION&token=$token&$query" | tr -d ' ') + + if [ "$ft_s3" = "1" ]; + then + say "${e}->${x} Pinging Codecov" + say "$url/upload/v4?$queryNoToken" + # shellcheck disable=SC2086,2090 + res=$(curl $curl_s -X POST $curlargs $cacert \ + --retry 5 --retry-delay 2 --connect-timeout 2 \ + -H 'X-Reduced-Redundancy: false' \ + -H 'X-Content-Type: application/x-gzip' \ + "$url/upload/v4?$query" || true) + # a good reply is "https://codecov.io" + "\n" + "https://storage.googleapis.com/codecov/..." + status=$(echo "$res" | head -1 | grep 'HTTP ' | cut -d' ' -f2) + if [ "$status" = "" ] && [ "$res" != "" ]; + then + s3target=$(echo "$res" | sed -n 2p) + say "${e}->${x} Uploading to" + say "${s3target}" + + # shellcheck disable=SC2086 + s3=$(curl -fiX PUT $curlawsargs \ + --data-binary @"$upload_file.gz" \ + -H 'Content-Type: application/x-gzip' \ + -H 'Content-Encoding: gzip' \ + "$s3target" || true) + + if [ "$s3" != "" ]; + then + say " ${g}->${x} View reports at ${b}$(echo "$res" | sed -n 1p)${x}" + exit 0 + else + say " ${r}X>${x} Failed to upload" + fi + elif [ "$status" = "400" ]; + then + # 400 Error + say "${g}${res}${x}" + exit ${exit_with} + fi + fi + + say "${e}==>${x} Uploading to Codecov" + + # shellcheck disable=SC2086,2090 + res=$(curl -X POST $curlargs $cacert \ + --data-binary @"$upload_file.gz" \ + --retry 5 --retry-delay 2 --connect-timeout 2 \ + -H 'Content-Type: text/plain' \ + -H 'Content-Encoding: gzip' \ + -H 'X-Content-Encoding: gzip' \ + -H 'Accept: text/plain' \ + "$url/upload/v2?$query&attempt=$i" || echo 'HTTP 500') + # HTTP 200 + # http://.... + status=$(echo "$res" | head -1 | cut -d' ' -f2) + if [ "$status" = "" ] || [ "$status" = "200" ]; + then + say " View reports at ${b}$(echo "$res" | head -2 | tail -1)${x}" + exit 0 + else + say " ${g}${res}${x}" + exit ${exit_with} + fi + + say " ${r}X> Failed to upload coverage reports${x}" +fi + +exit ${exit_with} diff --git a/scripts/codecov.sh b/scripts/codecov.sh index 837c0770b611..2b73d00ae8dc 100644 --- a/scripts/codecov.sh +++ b/scripts/codecov.sh @@ -10,5 +10,5 @@ done wget -O - -q "https://codecov.io/bash" > .codecov chmod +x .codecov -./.codecov -t $CODE_COV_TOKEN +./.codecov -t $CODECOV_TOKEN echo "Uploaded code coverage" \ No newline at end of file From bd8483699b7b606f27d0a220ecba0a022ebda00e Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 15:12:01 -0500 Subject: [PATCH 018/118] wip --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f9db47467b35..35e5472b0904 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,8 +178,6 @@ jobs: executor: test-executor description: Publish documentation to GitHub pages steps: - - build_setup - - restore_cargo_package_cache - run: name: Build Docs command: cargo doc --no-deps --all-features @@ -196,6 +194,12 @@ jobs: steps: # Need to use nightly for this. - build_setup + - run: + name: Nightly Build + command: | + rustup run nightly rustc --version --verbose + rustup run nightly cargo --version --verbose + rustup run nightly cargo build - install-grcov - run: bash ./automation/emit_coverage_info.sh - run: From 0b8c6c603c6c5f4e9dccab534674dbf0eacc2a47 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 15:18:42 -0500 Subject: [PATCH 019/118] wip --- .circleci/config.yml | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35e5472b0904..c21664e9b86e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -124,6 +124,22 @@ commands: - env_setup - install_deps jobs: + cov: + machine: true + steps: + - checkout + - run: + name: Pull xd009642/tarpaulin + command: docker pull xd009642/tarpaulin:latest + - run: + name: Generate report + command: > + docker run --security-opt seccomp=unconfined -e CODECOV_TOKEN=${CODECOV_TOKEN} + -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --ciserver circle-ci + --out Xml --all-features + - run: + name: Upload + command: bash <(curl -s https://codecov.io/bash) -Z -f cobertura.xml prefetch-crates: executor: test-executor description: Prefetch cargo crates for subsequent jobs. @@ -149,7 +165,6 @@ jobs: test: executor: test-executor description: Run Rust tests - parallelism: 4 steps: - build_setup - restore_cargo_package_cache @@ -178,6 +193,8 @@ jobs: executor: test-executor description: Publish documentation to GitHub pages steps: + - build_setup + - restore_cargo_package_cache - run: name: Build Docs command: cargo doc --no-deps --all-features @@ -187,27 +204,6 @@ jobs: - run: name: Publish Docs command: bash ./scripts/build-rust-docs.sh - cov: - docker: - - image: circleci/rust:latest - resource_class: medium - steps: - # Need to use nightly for this. - - build_setup - - run: - name: Nightly Build - command: | - rustup run nightly rustc --version --verbose - rustup run nightly cargo --version --verbose - rustup run nightly cargo build - - install-grcov - - run: bash ./automation/emit_coverage_info.sh - - run: - name: Compile coverage - command: grcov ./target/debug/ -s . -t lcov --llvm --ignore-not-existing --ignore "target/*" --ignore "/*" -o lcov.info - - run: - name: Upload to codecov.io - command: bash <(curl -s https://codecov.io/bash) -f lcov.info workflows: setup_test: From 26bbb5ab0af92bb1f1c4a9989baec36c5a0c1ed7 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 15:49:40 -0500 Subject: [PATCH 020/118] wip --- .circleci/config.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c21664e9b86e..414e409b1504 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -96,24 +96,6 @@ commands: command: | ls -all $HOME/.cargo du -ssh $HOME/.cargo - install-grcov: - steps: - - run: - name: Install grcov - command: | - GRCOV_VERSION=v0.5.15 - GRCOV_ARCHIVE=grcov-linux-x86_64.tar.bz2 - GRCOV_SHA256=1182739b2b1df31dee74ed3533330001f9da921cf169bd8da4ec0386e4243ad0 - GRCOV_URL="https://github.com/mozilla/grcov/releases/download/${GRCOV_VERSION}/${GRCOV_ARCHIVE}" - curl -sfSL --retry 5 --retry-delay 10 -O "${GRCOV_URL}" - echo "${GRCOV_SHA256} *${GRCOV_ARCHIVE}" | shasum -a 256 -c - - # Just install `grcov` to ~/.bin - mkdir -p "$HOME/.bin" - tar jxf "${GRCOV_ARCHIVE}" -C "$HOME/.bin" - echo 'export PATH="$HOME/.bin:$PATH"' >> $BASH_ENV - # Run in a different shell to source $BASH_ENV - - run: | - grcov --version build_setup: description: Sets up environment for future jobs steps: @@ -135,7 +117,7 @@ jobs: name: Generate report command: > docker run --security-opt seccomp=unconfined -e CODECOV_TOKEN=${CODECOV_TOKEN} - -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --ciserver circle-ci + -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --tests --ciserver circle-ci --out Xml --all-features - run: name: Upload From cbb37f879d7e7abfbcd7a22a57f5691d0d734e4f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:04:02 -0500 Subject: [PATCH 021/118] wip --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 414e409b1504..998be3fa08b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,7 @@ jobs: name: Generate report command: > docker run --security-opt seccomp=unconfined -e CODECOV_TOKEN=${CODECOV_TOKEN} - -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --tests --ciserver circle-ci + -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --all-features --ciserver circle-ci --out Xml --all-features - run: name: Upload From 17fc52244ab680215125859b02e667018aadd27a Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:05:23 -0500 Subject: [PATCH 022/118] wip --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 998be3fa08b1..bce1b55fd492 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,7 +117,7 @@ jobs: name: Generate report command: > docker run --security-opt seccomp=unconfined -e CODECOV_TOKEN=${CODECOV_TOKEN} - -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --all-features --ciserver circle-ci + -v $PWD:/volume xd009642/tarpaulin cargo tarpaulin -v --ciserver circle-ci --out Xml --all-features - run: name: Upload From e912bdb4bd28229028acd74533c808866e62df00 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:25:24 -0500 Subject: [PATCH 023/118] wip --- .github/workflows/ci-rust.yml | 97 ++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 86bb8face340..efce76a44846 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -9,9 +9,32 @@ on: - main jobs: + cov: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + - id: coverage + - uses: actions-rs/grcov@v0.1 + - name: Coveralls upload + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ${{ steps.coverage.outputs.report }} test: name: test - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -47,7 +70,7 @@ jobs: fmt: name: rustfmt - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -70,7 +93,7 @@ jobs: clippy: name: clippy - runs-on: ubuntu-16.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -106,37 +129,37 @@ jobs: command: check args: -p forest - publish_docs: - if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' - name: Publish Documentation - needs: [clippy, test] - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: "recursive" - - - name: Install Rust - run: rustup update beta && rustup default beta - - - name: Update apt repositories - run: sudo apt update - - - name: Install OpenCL - run: sudo apt install ocl-icd-opencl-dev - - # - name: Install Protoc - # uses: arduino/setup-protoc@master - # with: - # version: "3.9.1" - - - name: Build documentation - run: cargo doc --no-deps --all-features - - name: Publish documentation - run: | - cd target/doc - git init - echo '' > index.html - git add . - git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' - git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages + # publish_docs: + # if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' + # name: Publish Documentation + # needs: [clippy, test] + # runs-on: ubuntu-16.04 + # steps: + # - uses: actions/checkout@v2 + # with: + # submodules: "recursive" + + # - name: Install Rust + # run: rustup update beta && rustup default beta + + # - name: Update apt repositories + # run: sudo apt update + + # - name: Install OpenCL + # run: sudo apt install ocl-icd-opencl-dev + + # # - name: Install Protoc + # # uses: arduino/setup-protoc@master + # # with: + # # version: "3.9.1" + + # - name: Build documentation + # run: cargo doc --no-deps --all-features + # - name: Publish documentation + # run: | + # cd target/doc + # git init + # echo '' > index.html + # git add . + # git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation' + # git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages From dccc042837fb4e8464b7bcce4b6d24fe7de28d88 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:27:43 -0500 Subject: [PATCH 024/118] wip --- .github/workflows/ci-rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index efce76a44846..4b64f32ae229 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -3,10 +3,10 @@ name: Rust CI on: push: branches: - - main + - master pull_request: branches: - - main + - master jobs: cov: From 17f7173c25b76c4ae1e7f3686dc495ca0521d6cc Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:29:30 -0500 Subject: [PATCH 025/118] wip --- .github/workflows/ci-rust.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 4b64f32ae229..b12892ec1e2e 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -6,7 +6,7 @@ on: - master pull_request: branches: - - master + - main jobs: cov: @@ -27,11 +27,6 @@ jobs: RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage - uses: actions-rs/grcov@v0.1 - - name: Coveralls upload - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ${{ steps.coverage.outputs.report }} test: name: test runs-on: ubuntu-latest From 3adc4e1804b55f912c8387c9080985d56ddbfa59 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:32:02 -0500 Subject: [PATCH 026/118] wip --- .github/workflows/ci-rust.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index b12892ec1e2e..92c7661f446b 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -10,23 +10,34 @@ on: jobs: cov: + name: Rust project runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions-rs/toolchain@v1 + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: stable override: true - - uses: actions-rs/cargo@v1 + + - name: Run cargo-tarpaulin + uses: actions-rs/tarpaulin@v0.1 + with: + version: '0.9.0' + args: '-- --test-threads 1' + + - name: Upload to codecov.io + uses: codecov/codecov-action@v1.0.2 + with: + token: ${{secrets.CODECOV_TOKEN}} + + - name: Archive code coverage results + uses: actions/upload-artifact@v1 with: - command: test - args: --all-features --no-fail-fast - env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - - id: coverage - - uses: actions-rs/grcov@v0.1 + name: code-coverage-report + path: cobertura.xml test: name: test runs-on: ubuntu-latest From c54ebc3440ac7267b945e0a52f1629029df4efc1 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:33:44 -0500 Subject: [PATCH 027/118] wip --- .github/workflows/ci-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 92c7661f446b..09fcec94c7b8 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -6,7 +6,7 @@ on: - master pull_request: branches: - - main + - master jobs: cov: From 84ae035e314190d3c1d0e140a223188106e7436f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:43:57 -0500 Subject: [PATCH 028/118] wip --- .github/workflows/grcov.yml | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/grcov.yml diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml new file mode 100644 index 000000000000..e8c484377511 --- /dev/null +++ b/.github/workflows/grcov.yml @@ -0,0 +1,73 @@ + +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: Code coverage with grcov + +jobs: + grcov: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + profile: minimal + + - name: Execute tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --all + env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" + + # Note that `actions-rs/grcov` Action can install `grcov` too, + # but can't use faster installation methods yet. + # As a temporary experiment `actions-rs/install` Action plugged in here. + # Consider **NOT** to copy that into your workflow, + # but use `actions-rs/grcov` only + - name: Pre-installing grcov + uses: actions-rs/install@v0.1 + with: + crate: grcov + use-tool-cache: true + + - name: Gather coverage data + id: coverage + uses: actions-rs/grcov@v0.1 + with: + coveralls-token: ${{ secrets.COVERALLS_TOKEN }} + + - name: Coveralls upload + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GIT_TOKEN }} + parallel: true + path-to-lcov: ${{ steps.coverage.outputs.report }} + + grcov_finalize: + runs-on: ubuntu-latest + needs: grcov + steps: + - name: Coveralls finalization + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GIT_TOKEN }} + parallel-finished: true \ No newline at end of file From a614be767ab67389fe05df49eb48bfe62463fe8f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 16:50:41 -0500 Subject: [PATCH 029/118] wip --- .github/workflows/ci-rust.yml | 29 ----------------------------- .github/workflows/grcov.yml | 1 - 2 files changed, 30 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 09fcec94c7b8..fe81a25aa947 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -9,35 +9,6 @@ on: - master jobs: - cov: - name: Rust project - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Run cargo-tarpaulin - uses: actions-rs/tarpaulin@v0.1 - with: - version: '0.9.0' - args: '-- --test-threads 1' - - - name: Upload to codecov.io - uses: codecov/codecov-action@v1.0.2 - with: - token: ${{secrets.CODECOV_TOKEN}} - - - name: Archive code coverage results - uses: actions/upload-artifact@v1 - with: - name: code-coverage-report - path: cobertura.xml test: name: test runs-on: ubuntu-latest diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index e8c484377511..319f8380c68d 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -17,7 +17,6 @@ jobs: os: - ubuntu-latest - macOS-latest - - windows-latest steps: - uses: actions/checkout@v2 From ac0d172e6aedf2840736a775918d14f5d9a1014f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 17:02:57 -0500 Subject: [PATCH 030/118] wip --- .github/workflows/grcov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 319f8380c68d..a5992141b47e 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -16,7 +16,7 @@ jobs: matrix: os: - ubuntu-latest - - macOS-latest + # - macOS-latest steps: - uses: actions/checkout@v2 @@ -32,7 +32,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --all + args: --all-features env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" From 5bf818c1a379224c430293fc927f791cf73fd9ed Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 17:04:52 -0500 Subject: [PATCH 031/118] wip --- .github/workflows/grcov.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index a5992141b47e..9de9579a9432 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -16,10 +16,18 @@ jobs: matrix: os: - ubuntu-latest - # - macOS-latest + - macOS-latest steps: - uses: actions/checkout@v2 + + - name: Update apt repositories + run: sudo apt update + + - name: Install apt packages + run: | + sudo apt install ocl-icd-opencl-dev clang llvm + sudo apt-get install -y libhwloc-dev - name: Install toolchain uses: actions-rs/toolchain@v1 From 00119f366bf90d7276eab5c6caa65e6a82d9df51 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 17:06:19 -0500 Subject: [PATCH 032/118] wip --- .github/workflows/grcov.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 9de9579a9432..4f3ec8c34b83 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -16,19 +16,11 @@ jobs: matrix: os: - ubuntu-latest - - macOS-latest + # - macOS-latest steps: - uses: actions/checkout@v2 - - name: Update apt repositories - run: sudo apt update - - - name: Install apt packages - run: | - sudo apt install ocl-icd-opencl-dev clang llvm - sudo apt-get install -y libhwloc-dev - - name: Install toolchain uses: actions-rs/toolchain@v1 with: From e127cb33c9b8f01b59159eb4f02b745db523df8f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 17:15:24 -0500 Subject: [PATCH 033/118] wip --- .github/workflows/grcov.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 4f3ec8c34b83..6d8699a7f406 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -20,6 +20,14 @@ jobs: steps: - uses: actions/checkout@v2 + + - name: Update apt repositories + run: sudo apt update + + - name: Install apt packages + run: | + sudo apt install ocl-icd-opencl-dev + sudo apt-get install -y libhwloc-dev - name: Install toolchain uses: actions-rs/toolchain@v1 From 5ceb5767143a6b44d99678790bc1246bdb356e5f Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 17:30:07 -0500 Subject: [PATCH 034/118] wip --- .github/workflows/ci-rust.yml | 13 +++++++++++++ .github/workflows/grcov.yml | 14 +++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index fe81a25aa947..c3392065776c 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -9,6 +9,19 @@ on: - master jobs: + cov: + name: Code Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Push to coveralls.io + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --ciserver github-ci --coveralls $COVERALLS_TOKEN test: name: test runs-on: ubuntu-latest diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 6d8699a7f406..16df4b39b3ea 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -36,11 +36,15 @@ jobs: override: true profile: minimal - - name: Execute tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features + - name: Pull submodules + run: git submodule update --init + + - name: Run all unit tests + run: make test + + - name: Run test vectors + run: make run-vectors + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" From 93b7409015f307e93c5a40ba30d91daa80c2ed49 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 18:14:50 -0500 Subject: [PATCH 035/118] wip --- .github/workflows/ci-rust.yml | 2 +- .github/workflows/grcov.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index c3392065776c..1d007ad34707 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 0 - name: Push to coveralls.io env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} + COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} run: | cargo install cargo-tarpaulin cargo tarpaulin --ciserver github-ci --coveralls $COVERALLS_TOKEN diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 16df4b39b3ea..094cdf47d90f 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -26,7 +26,7 @@ jobs: - name: Install apt packages run: | - sudo apt install ocl-icd-opencl-dev + sudo apt install ocl-icd-opencl-dev libclang-dev sudo apt-get install -y libhwloc-dev - name: Install toolchain @@ -44,7 +44,7 @@ jobs: - name: Run test vectors run: make run-vectors - + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" From 363c21652a19421626fd511a144f7abcaab0534a Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 18:53:05 -0500 Subject: [PATCH 036/118] wip --- .github/workflows/ci-rust.yml | 13 +++++++------ .github/workflows/grcov.yml | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 1d007ad34707..3210157d32ff 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -16,12 +16,13 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Push to coveralls.io - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - run: | - cargo install cargo-tarpaulin - cargo tarpaulin --ciserver github-ci --coveralls $COVERALLS_TOKEN + - name: Push to codecov.io + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml + bash <(curl -s https://codecov.io/bash) -X gcov -t $CODECOV_TOKEN test: name: test runs-on: ubuntu-latest diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 094cdf47d90f..ba45fb050ae2 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -26,8 +26,8 @@ jobs: - name: Install apt packages run: | - sudo apt install ocl-icd-opencl-dev libclang-dev - sudo apt-get install -y libhwloc-dev + sudo apt install ocl-icd-opencl-dev + sudo apt-get install -y libhwloc-dev libclang-dev gcc - name: Install toolchain uses: actions-rs/toolchain@v1 @@ -42,8 +42,8 @@ jobs: - name: Run all unit tests run: make test - - name: Run test vectors - run: make run-vectors + # - name: Run test vectors + # run: make run-vectors env: CARGO_INCREMENTAL: 0 From 3937c535321725d2c213431401b82507a0147865 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 19:12:23 -0500 Subject: [PATCH 037/118] wip --- .github/workflows/grcov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index ba45fb050ae2..25063b7acda3 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -27,7 +27,7 @@ jobs: - name: Install apt packages run: | sudo apt install ocl-icd-opencl-dev - sudo apt-get install -y libhwloc-dev libclang-dev gcc + sudo apt-get install -y libhwloc-dev libclang-dev - name: Install toolchain uses: actions-rs/toolchain@v1 From 48642483a6e9ec1975385797995b6e6095406e32 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 19:13:27 -0500 Subject: [PATCH 038/118] wip --- .github/workflows/ci-rust.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index 3210157d32ff..d1d52e8b9f50 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -16,13 +16,13 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Push to codecov.io - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: | - cargo install cargo-tarpaulin - cargo tarpaulin --out Xml - bash <(curl -s https://codecov.io/bash) -X gcov -t $CODECOV_TOKEN + - name: Push to codecov.io + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + cargo install cargo-tarpaulin + cargo tarpaulin --out Xml + bash <(curl -s https://codecov.io/bash) -X gcov -t $CODECOV_TOKEN test: name: test runs-on: ubuntu-latest From f4015cca09ec5516c4e3d90515e38bb8e3e21dd8 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 19:28:08 -0500 Subject: [PATCH 039/118] wip --- .github/workflows/grcov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 25063b7acda3..702a0b1c9c3f 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -26,8 +26,8 @@ jobs: - name: Install apt packages run: | - sudo apt install ocl-icd-opencl-dev - sudo apt-get install -y libhwloc-dev libclang-dev + sudo apt install ocl-icd-opencl-dev make clang pkg-config libssl-dev libclang-dev + sudo apt-get install -y libhwloc-dev - name: Install toolchain uses: actions-rs/toolchain@v1 From d1080f581e08482ea489939cc2d69a204130bf2d Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Sat, 31 Oct 2020 19:51:57 -0500 Subject: [PATCH 040/118] wip --- .github/workflows/ci-rust.yml | 2 +- .github/workflows/grcov.yml | 4 +- kcov-38/.dockerignore | 2 + kcov-38/.gitignore | 13 + kcov-38/.gitmodules | 3 + kcov-38/.travis.yml | 47 + kcov-38/CMakeLists.txt | 50 + kcov-38/CONTRIBUTING.md | 12 + kcov-38/COPYING | 339 ++ kcov-38/COPYING.externals | 3 + kcov-38/CPack.local.cmake | 29 + kcov-38/ChangeLog | 740 ++++ kcov-38/Dockerfile | 40 + kcov-38/INSTALL.md | 94 + kcov-38/README | 1 + kcov-38/README.md | 96 + kcov-38/cmake/FindBfd.cmake | 85 + kcov-38/cmake/FindElfutils.cmake | 77 + kcov-38/cmake/FindLibCRPCUT.cmake | 59 + kcov-38/cmake/FindLibElf.cmake | 68 + kcov-38/cmake/TargetArch.cmake | 134 + kcov-38/data/amber.png | Bin 0 -> 141 bytes kcov-38/data/bcov.css | 32 + kcov-38/data/glass.png | Bin 0 -> 167 bytes kcov-38/data/index.html | 97 + kcov-38/data/js/handlebars.js | 3079 +++++++++++++++++ kcov-38/data/js/jquery.min.js | 4 + kcov-38/data/js/jquery.tablesorter.min.js | 5 + .../data/js/jquery.tablesorter.widgets.min.js | 17 + kcov-38/data/js/kcov.js | 78 + kcov-38/data/source-file.html | 71 + kcov-38/data/tablesorter-theme.css | 221 ++ kcov-38/debian/.gitignore | 3 + kcov-38/debian/README | 6 + kcov-38/debian/changelog | 5 + kcov-38/debian/compat | 1 + kcov-38/debian/control | 19 + kcov-38/debian/copyright | 34 + kcov-38/debian/kcov-docs.docs | 3 + kcov-38/debian/rules | 25 + kcov-38/debian/source/format | 1 + kcov-38/doc/CMakeLists.txt | 1 + kcov-38/doc/codecov.md | 17 + kcov-38/doc/coveralls.md | 11 + kcov-38/doc/design.txt | 78 + kcov-38/doc/full-system-instrumentation.md | 35 + kcov-38/doc/gitlab.md | 8 + kcov-38/doc/jenkins.md | 6 + kcov-38/doc/kcov.1 | 175 + kcov-38/doc/sonarqube.md | 5 + kcov-38/external/lldb/include/lldb/API/LLDB.h | 57 + .../lldb/include/lldb/API/SBAddress.h | 152 + .../lldb/include/lldb/API/SBAttachInfo.h | 149 + .../external/lldb/include/lldb/API/SBBlock.h | 123 + .../lldb/include/lldb/API/SBBreakpoint.h | 193 ++ .../include/lldb/API/SBBreakpointLocation.h | 114 + .../lldb/include/lldb/API/SBBroadcaster.h | 97 + .../include/lldb/API/SBCommandInterpreter.h | 318 ++ .../include/lldb/API/SBCommandReturnObject.h | 133 + .../lldb/include/lldb/API/SBCommunication.h | 100 + .../lldb/include/lldb/API/SBCompileUnit.h | 119 + .../external/lldb/include/lldb/API/SBData.h | 181 + .../lldb/include/lldb/API/SBDebugger.h | 363 ++ .../lldb/include/lldb/API/SBDeclaration.h | 89 + .../lldb/include/lldb/API/SBDefines.h | 101 + .../external/lldb/include/lldb/API/SBError.h | 108 + .../external/lldb/include/lldb/API/SBEvent.h | 105 + .../include/lldb/API/SBExecutionContext.h | 74 + .../include/lldb/API/SBExpressionOptions.h | 135 + .../lldb/include/lldb/API/SBFileSpec.h | 104 + .../lldb/include/lldb/API/SBFileSpecList.h | 72 + .../external/lldb/include/lldb/API/SBFrame.h | 237 ++ .../lldb/include/lldb/API/SBFunction.h | 96 + .../external/lldb/include/lldb/API/SBHostOS.h | 60 + .../lldb/include/lldb/API/SBInstruction.h | 94 + .../lldb/include/lldb/API/SBInstructionList.h | 71 + .../lldb/include/lldb/API/SBLanguageRuntime.h | 29 + .../lldb/include/lldb/API/SBLaunchInfo.h | 195 ++ .../lldb/include/lldb/API/SBLineEntry.h | 99 + .../lldb/include/lldb/API/SBListener.h | 145 + .../external/lldb/include/lldb/API/SBModule.h | 359 ++ .../lldb/include/lldb/API/SBModuleSpec.h | 154 + .../lldb/include/lldb/API/SBPlatform.h | 211 ++ .../lldb/include/lldb/API/SBProcess.h | 369 ++ .../external/lldb/include/lldb/API/SBQueue.h | 89 + .../lldb/include/lldb/API/SBQueueItem.h | 57 + .../lldb/include/lldb/API/SBSection.h | 116 + .../lldb/include/lldb/API/SBSourceManager.h | 53 + .../external/lldb/include/lldb/API/SBStream.h | 114 + .../lldb/include/lldb/API/SBStringList.h | 71 + .../external/lldb/include/lldb/API/SBSymbol.h | 109 + .../lldb/include/lldb/API/SBSymbolContext.h | 94 + .../include/lldb/API/SBSymbolContextList.h | 69 + .../external/lldb/include/lldb/API/SBTarget.h | 819 +++++ .../external/lldb/include/lldb/API/SBThread.h | 259 ++ .../include/lldb/API/SBThreadCollection.h | 68 + .../lldb/include/lldb/API/SBThreadPlan.h | 129 + .../external/lldb/include/lldb/API/SBType.h | 333 ++ .../lldb/include/lldb/API/SBTypeCategory.h | 168 + .../lldb/include/lldb/API/SBTypeEnumMember.h | 98 + .../lldb/include/lldb/API/SBTypeFilter.h | 92 + .../lldb/include/lldb/API/SBTypeFormat.h | 100 + .../include/lldb/API/SBTypeNameSpecifier.h | 77 + .../lldb/include/lldb/API/SBTypeSummary.h | 165 + .../lldb/include/lldb/API/SBTypeSynthetic.h | 102 + .../lldb/include/lldb/API/SBUnixSignals.h | 84 + .../external/lldb/include/lldb/API/SBValue.h | 504 +++ .../lldb/include/lldb/API/SBValueList.h | 96 + .../include/lldb/API/SBVariablesOptions.h | 98 + .../lldb/include/lldb/API/SBWatchpoint.h | 104 + .../include/lldb/API/SystemInitializerFull.h | 40 + .../lldb/include/lldb/Utility/SharingPtr.h | 841 +++++ .../external/lldb/include/lldb/lldb-defines.h | 153 + .../lldb/include/lldb/lldb-enumerations.h | 1052 ++++++ .../external/lldb/include/lldb/lldb-forward.h | 440 +++ .../external/lldb/include/lldb/lldb-types.h | 118 + .../lldb/include/lldb/lldb-versioning.h | 1607 +++++++++ kcov-38/src/CMakeLists.txt | 460 +++ kcov-38/src/bin-to-c-source.py | 36 + kcov-38/src/capabilities.cc | 49 + kcov-38/src/cmake_uninstall.cmake.in | 21 + kcov-38/src/collector.cc | 198 ++ kcov-38/src/configuration.cc | 809 +++++ kcov-38/src/dummy-solib-handler.cc | 20 + kcov-38/src/engine-factory.cc | 63 + kcov-38/src/engines/bash-engine.cc | 845 +++++ kcov-38/src/engines/bash-execve-redirector.c | 87 + kcov-38/src/engines/bash-helper-debug-trap.sh | 5 + kcov-38/src/engines/bash-helper.sh | 4 + kcov-38/src/engines/clang-coverage-engine.cc | 268 ++ kcov-38/src/engines/gcov-engine.cc | 205 ++ kcov-38/src/engines/kernel-engine.cc | 189 + kcov-38/src/engines/lldb-engine.cc | 486 +++ kcov-38/src/engines/ptrace.cc | 471 +++ kcov-38/src/engines/ptrace_freebsd.cc | 184 + kcov-38/src/engines/ptrace_linux.cc | 430 +++ kcov-38/src/engines/ptrace_sys.hh | 26 + kcov-38/src/engines/python-engine.cc | 474 +++ kcov-38/src/engines/python-helper.py | 109 + kcov-38/src/engines/script-engine-base.hh | 117 + kcov-38/src/engines/system-mode-binary-lib.cc | 86 + kcov-38/src/engines/system-mode-engine.cc | 267 ++ .../src/engines/system-mode-file-format.cc | 125 + .../src/engines/system-mode-file-format.hh | 86 + kcov-38/src/filter.cc | 362 ++ kcov-38/src/gcov.cc | 409 +++ kcov-38/src/include/capabilities.hh | 52 + kcov-38/src/include/collector.hh | 60 + kcov-38/src/include/configuration.hh | 128 + kcov-38/src/include/disassembler.hh | 48 + kcov-38/src/include/elf.hh | 129 + kcov-38/src/include/engine.hh | 124 + kcov-38/src/include/file-parser.hh | 184 + kcov-38/src/include/filter.hh | 58 + kcov-38/src/include/gcov.hh | 182 + kcov-38/src/include/generated-data-base.hh | 29 + kcov-38/src/include/lineid.hh | 14 + kcov-38/src/include/manager.hh | 10 + kcov-38/src/include/output-handler.hh | 34 + kcov-38/src/include/phdr_data.h | 50 + kcov-38/src/include/reporter.hh | 130 + kcov-38/src/include/solib-handler.hh | 22 + kcov-38/src/include/source-file-cache.hh | 38 + kcov-38/src/include/swap-endian.hh | 67 + kcov-38/src/include/system-mode/file-data.hh | 66 + .../src/include/system-mode/registration.hh | 23 + kcov-38/src/include/utils.hh | 212 ++ kcov-38/src/include/writer.hh | 33 + kcov-38/src/kernel/Makefile | 12 + kcov-38/src/kernel/kprobe-coverage.c | 589 ++++ kcov-38/src/main-system-daemon.cc | 472 +++ kcov-38/src/main.cc | 579 ++++ kcov-38/src/merge-file-parser.cc | 616 ++++ kcov-38/src/merge-parser.hh | 23 + kcov-38/src/output-handler.cc | 150 + kcov-38/src/parser-manager.cc | 63 + kcov-38/src/parsers/bfd-disassembler.cc | 439 +++ kcov-38/src/parsers/dummy-disassembler.cc | 49 + kcov-38/src/parsers/dwarf-libdwarf.cc | 152 + kcov-38/src/parsers/dwarf.cc | 229 ++ kcov-38/src/parsers/dwarf.hh | 32 + kcov-38/src/parsers/elf-parser.cc | 585 ++++ kcov-38/src/parsers/elf.cc | 275 ++ kcov-38/src/parsers/libdwarf-dwarf.cpp | 9 + kcov-38/src/reporter.cc | 788 +++++ kcov-38/src/solib-handler.cc | 281 ++ kcov-38/src/solib-parser/lib.c | 125 + kcov-38/src/solib-parser/phdr_data.c | 108 + kcov-38/src/source-file-cache.cc | 112 + kcov-38/src/system-mode/file-data.cc | 280 ++ kcov-38/src/system-mode/registration.cc | 66 + kcov-38/src/utils.cc | 722 ++++ kcov-38/src/writers/cobertura-writer.cc | 206 ++ kcov-38/src/writers/cobertura-writer.hh | 13 + kcov-38/src/writers/coveralls-writer.cc | 248 ++ kcov-38/src/writers/coveralls-writer.hh | 9 + kcov-38/src/writers/dummy-coveralls-writer.cc | 29 + kcov-38/src/writers/html-writer.cc | 413 +++ kcov-38/src/writers/html-writer.hh | 14 + kcov-38/src/writers/json-writer.cc | 131 + kcov-38/src/writers/json-writer.hh | 11 + kcov-38/src/writers/sonarqube-xml-writer.cc | 106 + kcov-38/src/writers/sonarqube-xml-writer.hh | 11 + kcov-38/src/writers/writer-base.cc | 167 + kcov-38/src/writers/writer-base.hh | 64 + kcov-38/tests/CMakeLists.txt | 193 ++ kcov-38/tests/argv-dependent.c | 23 + kcov-38/tests/assembly/illegal-insn.S | 4 + kcov-38/tests/bash/dollar-one-question.sh | 4 + kcov-38/tests/bash/dollar-var-replacements.sh | 5 + kcov-38/tests/bash/first-dir/a.sh | 10 + kcov-38/tests/bash/first-dir/b.sh | 3 + kcov-38/tests/bash/first-dir/c.sh | 4 + kcov-38/tests/bash/function-with-spaces.sh | 19 + kcov-38/tests/bash/handle-all-output.sh | 5 + kcov-38/tests/bash/multiline-alias.sh | 6 + kcov-38/tests/bash/multiline-backslash.sh | 5 + kcov-38/tests/bash/no-executed-statements.sh | 6 + kcov-38/tests/bash/other.sh | 55 + kcov-38/tests/bash/redirect-stderr.sh | 3 + kcov-38/tests/bash/second-dir/a.sh | 10 + kcov-38/tests/bash/second-dir/b.sh | 3 + kcov-38/tests/bash/second-dir/c.sh | 4 + kcov-38/tests/bash/sh-shebang.sh | 4 + kcov-38/tests/bash/shell-main | 180 + kcov-38/tests/bash/short-test.sh | 6 + kcov-38/tests/bash/subshell.sh | 8 + kcov-38/tests/bash/trap.sh | 14 + kcov-38/tests/bash/unitundertest.sh | 40 + kcov-38/tests/daemon/test-daemon.cc | 44 + kcov-38/tests/daemon/test-issue31.cc | 32 + kcov-38/tests/daemon/test-script.sh | 20 + kcov-38/tests/dlopen/dlopen-main.cc | 13 + kcov-38/tests/dlopen/dlopen.cc | 28 + kcov-38/tests/fork/fork+exec.c | 32 + kcov-38/tests/fork/fork-no-wait.c | 30 + kcov-38/tests/fork/fork.c | 47 + kcov-38/tests/fork/vfork.c | 27 + .../global-constructors/test-global-ctors.cc | 14 + kcov-38/tests/include/header.h | 17 + kcov-38/tests/main.cc | 26 + kcov-38/tests/merge-tests/file.c | 9 + kcov-38/tests/merge-tests/main_1.c | 13 + kcov-38/tests/merge-tests/main_2.c | 13 + kcov-38/tests/multi-fork/code-template.c | 29 + .../tests/multi-fork/generate-functions.py | 29 + kcov-38/tests/multi-fork/test-multi-fork.c | 46 + kcov-38/tests/pie.c | 7 + kcov-38/tests/popen/test-popen.c | 63 + kcov-38/tests/python/main | 30 + kcov-38/tests/python/second.py | 78 + kcov-38/tests/python/short-test.py | 10 + kcov-38/tests/python/unittest/testdriver | 28 + .../tests/python/unittest/unitundertest.py | 11 + kcov-38/tests/recursive-ptrace/main.cc | 68 + kcov-38/tests/sanitizer-coverage.c | 26 + .../tests/setpgid-kill/setpgid-kill-main.cc | 28 + kcov-38/tests/setpgid-kill/test-script.sh | 16 + kcov-38/tests/shared-library/big-symbol.S | 9 + kcov-38/tests/shared-library/main.c | 12 + .../shared-library/recursive-ld-preload.c | 7 + kcov-38/tests/shared-library/solib.c | 18 + kcov-38/tests/short-file.c | 1 + kcov-38/tests/signals/test-signals.c | 297 ++ kcov-38/tests/subdir/file.c | 8 + kcov-38/tests/subdir2/file.c | 8 + kcov-38/tests/subdir2/file2.c | 8 + kcov-38/tests/test-module/Makefile | 12 + kcov-38/tests/test-module/test_module.c | 64 + kcov-38/tests/threads/thread-main.c | 40 + kcov-38/tests/tools/accumulate.py | 80 + kcov-38/tests/tools/bash.py | 326 ++ kcov-38/tests/tools/bash_linux_only.py | 12 + kcov-38/tests/tools/basic.py | 28 + kcov-38/tests/tools/compiled.py | 474 +++ kcov-38/tests/tools/dummy-python.sh | 3 + kcov-38/tests/tools/filter.py | 44 + kcov-38/tests/tools/parse_cobertura.py | 82 + kcov-38/tests/tools/python.py | 111 + kcov-38/tests/tools/run-tests | 27 + kcov-38/tests/tools/system_mode.py | 68 + kcov-38/tests/tools/testbase.py | 65 + kcov-38/tests/unit-tests/CMakeLists.txt | 126 + kcov-38/tests/unit-tests/main.cc | 11 + .../tests/unit-tests/mocks/mock-collector.hh | 23 + kcov-38/tests/unit-tests/mocks/mock-engine.hh | 26 + .../tests/unit-tests/mocks/mock-reporter.hh | 39 + kcov-38/tests/unit-tests/second-source.c | 8 + kcov-38/tests/unit-tests/test-source.c | 20 + kcov-38/tests/unit-tests/test.hh | 6 + kcov-38/tests/unit-tests/tests-collector.cc | 87 + .../tests/unit-tests/tests-configuration.cc | 150 + kcov-38/tests/unit-tests/tests-elf.cc | 68 + kcov-38/tests/unit-tests/tests-filter.cc | 85 + .../tests/unit-tests/tests-merge-parser.cc | 312 ++ kcov-38/tests/unit-tests/tests-reporter.cc | 151 + kcov-38/tests/unit-tests/tests-system-mode.cc | 449 +++ kcov-38/tests/unit-tests/tests-utils.cc | 69 + kcov-38/tests/unit-tests/tests-writer.cc | 198 ++ kcov-38/tools/CMakeLists.txt | 83 + kcov-38/tools/line2addr.cc | 73 + kcov-38/travis/Makefile | 159 + kcov-38/travis/perf-test.sh | 18 + 303 files changed, 41432 insertions(+), 3 deletions(-) create mode 100644 kcov-38/.dockerignore create mode 100644 kcov-38/.gitignore create mode 100644 kcov-38/.gitmodules create mode 100644 kcov-38/.travis.yml create mode 100644 kcov-38/CMakeLists.txt create mode 100644 kcov-38/CONTRIBUTING.md create mode 100644 kcov-38/COPYING create mode 100644 kcov-38/COPYING.externals create mode 100644 kcov-38/CPack.local.cmake create mode 100644 kcov-38/ChangeLog create mode 100644 kcov-38/Dockerfile create mode 100644 kcov-38/INSTALL.md create mode 120000 kcov-38/README create mode 100644 kcov-38/README.md create mode 100644 kcov-38/cmake/FindBfd.cmake create mode 100644 kcov-38/cmake/FindElfutils.cmake create mode 100644 kcov-38/cmake/FindLibCRPCUT.cmake create mode 100644 kcov-38/cmake/FindLibElf.cmake create mode 100644 kcov-38/cmake/TargetArch.cmake create mode 100644 kcov-38/data/amber.png create mode 100644 kcov-38/data/bcov.css create mode 100644 kcov-38/data/glass.png create mode 100644 kcov-38/data/index.html create mode 100644 kcov-38/data/js/handlebars.js create mode 100644 kcov-38/data/js/jquery.min.js create mode 100644 kcov-38/data/js/jquery.tablesorter.min.js create mode 100644 kcov-38/data/js/jquery.tablesorter.widgets.min.js create mode 100644 kcov-38/data/js/kcov.js create mode 100644 kcov-38/data/source-file.html create mode 100644 kcov-38/data/tablesorter-theme.css create mode 100644 kcov-38/debian/.gitignore create mode 100644 kcov-38/debian/README create mode 100644 kcov-38/debian/changelog create mode 100644 kcov-38/debian/compat create mode 100644 kcov-38/debian/control create mode 100644 kcov-38/debian/copyright create mode 100644 kcov-38/debian/kcov-docs.docs create mode 100755 kcov-38/debian/rules create mode 100644 kcov-38/debian/source/format create mode 100644 kcov-38/doc/CMakeLists.txt create mode 100644 kcov-38/doc/codecov.md create mode 100644 kcov-38/doc/coveralls.md create mode 100644 kcov-38/doc/design.txt create mode 100644 kcov-38/doc/full-system-instrumentation.md create mode 100644 kcov-38/doc/gitlab.md create mode 100644 kcov-38/doc/jenkins.md create mode 100644 kcov-38/doc/kcov.1 create mode 100644 kcov-38/doc/sonarqube.md create mode 100644 kcov-38/external/lldb/include/lldb/API/LLDB.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBAddress.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBAttachInfo.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBBlock.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBBreakpoint.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBBreakpointLocation.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBBroadcaster.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBCommandInterpreter.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBCommandReturnObject.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBCommunication.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBCompileUnit.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBData.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBDebugger.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBDeclaration.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBDefines.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBError.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBEvent.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBExecutionContext.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBExpressionOptions.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBFileSpec.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBFileSpecList.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBFrame.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBFunction.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBHostOS.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBInstruction.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBInstructionList.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBLanguageRuntime.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBLaunchInfo.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBLineEntry.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBListener.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBModule.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBModuleSpec.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBPlatform.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBProcess.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBQueue.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBQueueItem.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBSection.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBSourceManager.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBStream.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBStringList.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBSymbol.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBSymbolContext.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBSymbolContextList.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTarget.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBThread.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBThreadCollection.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBThreadPlan.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBType.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeCategory.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeEnumMember.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeFilter.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeFormat.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeNameSpecifier.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeSummary.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBTypeSynthetic.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBUnixSignals.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBValue.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBValueList.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBVariablesOptions.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SBWatchpoint.h create mode 100644 kcov-38/external/lldb/include/lldb/API/SystemInitializerFull.h create mode 100644 kcov-38/external/lldb/include/lldb/Utility/SharingPtr.h create mode 100644 kcov-38/external/lldb/include/lldb/lldb-defines.h create mode 100644 kcov-38/external/lldb/include/lldb/lldb-enumerations.h create mode 100644 kcov-38/external/lldb/include/lldb/lldb-forward.h create mode 100644 kcov-38/external/lldb/include/lldb/lldb-types.h create mode 100644 kcov-38/external/lldb/include/lldb/lldb-versioning.h create mode 100644 kcov-38/src/CMakeLists.txt create mode 100755 kcov-38/src/bin-to-c-source.py create mode 100644 kcov-38/src/capabilities.cc create mode 100644 kcov-38/src/cmake_uninstall.cmake.in create mode 100644 kcov-38/src/collector.cc create mode 100644 kcov-38/src/configuration.cc create mode 100644 kcov-38/src/dummy-solib-handler.cc create mode 100644 kcov-38/src/engine-factory.cc create mode 100644 kcov-38/src/engines/bash-engine.cc create mode 100644 kcov-38/src/engines/bash-execve-redirector.c create mode 100755 kcov-38/src/engines/bash-helper-debug-trap.sh create mode 100644 kcov-38/src/engines/bash-helper.sh create mode 100644 kcov-38/src/engines/clang-coverage-engine.cc create mode 100644 kcov-38/src/engines/gcov-engine.cc create mode 100644 kcov-38/src/engines/kernel-engine.cc create mode 100644 kcov-38/src/engines/lldb-engine.cc create mode 100644 kcov-38/src/engines/ptrace.cc create mode 100644 kcov-38/src/engines/ptrace_freebsd.cc create mode 100644 kcov-38/src/engines/ptrace_linux.cc create mode 100644 kcov-38/src/engines/ptrace_sys.hh create mode 100644 kcov-38/src/engines/python-engine.cc create mode 100644 kcov-38/src/engines/python-helper.py create mode 100644 kcov-38/src/engines/script-engine-base.hh create mode 100644 kcov-38/src/engines/system-mode-binary-lib.cc create mode 100644 kcov-38/src/engines/system-mode-engine.cc create mode 100644 kcov-38/src/engines/system-mode-file-format.cc create mode 100644 kcov-38/src/engines/system-mode-file-format.hh create mode 100644 kcov-38/src/filter.cc create mode 100644 kcov-38/src/gcov.cc create mode 100644 kcov-38/src/include/capabilities.hh create mode 100644 kcov-38/src/include/collector.hh create mode 100644 kcov-38/src/include/configuration.hh create mode 100644 kcov-38/src/include/disassembler.hh create mode 100644 kcov-38/src/include/elf.hh create mode 100644 kcov-38/src/include/engine.hh create mode 100644 kcov-38/src/include/file-parser.hh create mode 100644 kcov-38/src/include/filter.hh create mode 100644 kcov-38/src/include/gcov.hh create mode 100644 kcov-38/src/include/generated-data-base.hh create mode 100644 kcov-38/src/include/lineid.hh create mode 100644 kcov-38/src/include/manager.hh create mode 100644 kcov-38/src/include/output-handler.hh create mode 100644 kcov-38/src/include/phdr_data.h create mode 100644 kcov-38/src/include/reporter.hh create mode 100644 kcov-38/src/include/solib-handler.hh create mode 100644 kcov-38/src/include/source-file-cache.hh create mode 100644 kcov-38/src/include/swap-endian.hh create mode 100644 kcov-38/src/include/system-mode/file-data.hh create mode 100644 kcov-38/src/include/system-mode/registration.hh create mode 100644 kcov-38/src/include/utils.hh create mode 100644 kcov-38/src/include/writer.hh create mode 100644 kcov-38/src/kernel/Makefile create mode 100644 kcov-38/src/kernel/kprobe-coverage.c create mode 100644 kcov-38/src/main-system-daemon.cc create mode 100644 kcov-38/src/main.cc create mode 100644 kcov-38/src/merge-file-parser.cc create mode 100644 kcov-38/src/merge-parser.hh create mode 100644 kcov-38/src/output-handler.cc create mode 100644 kcov-38/src/parser-manager.cc create mode 100644 kcov-38/src/parsers/bfd-disassembler.cc create mode 100644 kcov-38/src/parsers/dummy-disassembler.cc create mode 100644 kcov-38/src/parsers/dwarf-libdwarf.cc create mode 100644 kcov-38/src/parsers/dwarf.cc create mode 100644 kcov-38/src/parsers/dwarf.hh create mode 100644 kcov-38/src/parsers/elf-parser.cc create mode 100644 kcov-38/src/parsers/elf.cc create mode 100644 kcov-38/src/parsers/libdwarf-dwarf.cpp create mode 100644 kcov-38/src/reporter.cc create mode 100644 kcov-38/src/solib-handler.cc create mode 100644 kcov-38/src/solib-parser/lib.c create mode 100644 kcov-38/src/solib-parser/phdr_data.c create mode 100644 kcov-38/src/source-file-cache.cc create mode 100644 kcov-38/src/system-mode/file-data.cc create mode 100644 kcov-38/src/system-mode/registration.cc create mode 100644 kcov-38/src/utils.cc create mode 100644 kcov-38/src/writers/cobertura-writer.cc create mode 100644 kcov-38/src/writers/cobertura-writer.hh create mode 100644 kcov-38/src/writers/coveralls-writer.cc create mode 100644 kcov-38/src/writers/coveralls-writer.hh create mode 100644 kcov-38/src/writers/dummy-coveralls-writer.cc create mode 100644 kcov-38/src/writers/html-writer.cc create mode 100644 kcov-38/src/writers/html-writer.hh create mode 100644 kcov-38/src/writers/json-writer.cc create mode 100644 kcov-38/src/writers/json-writer.hh create mode 100644 kcov-38/src/writers/sonarqube-xml-writer.cc create mode 100644 kcov-38/src/writers/sonarqube-xml-writer.hh create mode 100644 kcov-38/src/writers/writer-base.cc create mode 100644 kcov-38/src/writers/writer-base.hh create mode 100644 kcov-38/tests/CMakeLists.txt create mode 100644 kcov-38/tests/argv-dependent.c create mode 100644 kcov-38/tests/assembly/illegal-insn.S create mode 100755 kcov-38/tests/bash/dollar-one-question.sh create mode 100755 kcov-38/tests/bash/dollar-var-replacements.sh create mode 100644 kcov-38/tests/bash/first-dir/a.sh create mode 100644 kcov-38/tests/bash/first-dir/b.sh create mode 100644 kcov-38/tests/bash/first-dir/c.sh create mode 100755 kcov-38/tests/bash/function-with-spaces.sh create mode 100755 kcov-38/tests/bash/handle-all-output.sh create mode 100755 kcov-38/tests/bash/multiline-alias.sh create mode 100755 kcov-38/tests/bash/multiline-backslash.sh create mode 100755 kcov-38/tests/bash/no-executed-statements.sh create mode 100644 kcov-38/tests/bash/other.sh create mode 100755 kcov-38/tests/bash/redirect-stderr.sh create mode 100644 kcov-38/tests/bash/second-dir/a.sh create mode 100644 kcov-38/tests/bash/second-dir/b.sh create mode 100644 kcov-38/tests/bash/second-dir/c.sh create mode 100755 kcov-38/tests/bash/sh-shebang.sh create mode 100755 kcov-38/tests/bash/shell-main create mode 100755 kcov-38/tests/bash/short-test.sh create mode 100755 kcov-38/tests/bash/subshell.sh create mode 100755 kcov-38/tests/bash/trap.sh create mode 100755 kcov-38/tests/bash/unitundertest.sh create mode 100644 kcov-38/tests/daemon/test-daemon.cc create mode 100644 kcov-38/tests/daemon/test-issue31.cc create mode 100755 kcov-38/tests/daemon/test-script.sh create mode 100644 kcov-38/tests/dlopen/dlopen-main.cc create mode 100644 kcov-38/tests/dlopen/dlopen.cc create mode 100644 kcov-38/tests/fork/fork+exec.c create mode 100644 kcov-38/tests/fork/fork-no-wait.c create mode 100644 kcov-38/tests/fork/fork.c create mode 100644 kcov-38/tests/fork/vfork.c create mode 100644 kcov-38/tests/global-constructors/test-global-ctors.cc create mode 100644 kcov-38/tests/include/header.h create mode 100644 kcov-38/tests/main.cc create mode 100644 kcov-38/tests/merge-tests/file.c create mode 100644 kcov-38/tests/merge-tests/main_1.c create mode 100644 kcov-38/tests/merge-tests/main_2.c create mode 100644 kcov-38/tests/multi-fork/code-template.c create mode 100755 kcov-38/tests/multi-fork/generate-functions.py create mode 100644 kcov-38/tests/multi-fork/test-multi-fork.c create mode 100644 kcov-38/tests/pie.c create mode 100644 kcov-38/tests/popen/test-popen.c create mode 100755 kcov-38/tests/python/main create mode 100644 kcov-38/tests/python/second.py create mode 100755 kcov-38/tests/python/short-test.py create mode 100755 kcov-38/tests/python/unittest/testdriver create mode 100644 kcov-38/tests/python/unittest/unitundertest.py create mode 100644 kcov-38/tests/recursive-ptrace/main.cc create mode 100644 kcov-38/tests/sanitizer-coverage.c create mode 100644 kcov-38/tests/setpgid-kill/setpgid-kill-main.cc create mode 100755 kcov-38/tests/setpgid-kill/test-script.sh create mode 100644 kcov-38/tests/shared-library/big-symbol.S create mode 100644 kcov-38/tests/shared-library/main.c create mode 100644 kcov-38/tests/shared-library/recursive-ld-preload.c create mode 100644 kcov-38/tests/shared-library/solib.c create mode 100644 kcov-38/tests/short-file.c create mode 100644 kcov-38/tests/signals/test-signals.c create mode 100644 kcov-38/tests/subdir/file.c create mode 100644 kcov-38/tests/subdir2/file.c create mode 100644 kcov-38/tests/subdir2/file2.c create mode 100644 kcov-38/tests/test-module/Makefile create mode 100644 kcov-38/tests/test-module/test_module.c create mode 100644 kcov-38/tests/threads/thread-main.c create mode 100644 kcov-38/tests/tools/accumulate.py create mode 100644 kcov-38/tests/tools/bash.py create mode 100644 kcov-38/tests/tools/bash_linux_only.py create mode 100644 kcov-38/tests/tools/basic.py create mode 100644 kcov-38/tests/tools/compiled.py create mode 100755 kcov-38/tests/tools/dummy-python.sh create mode 100644 kcov-38/tests/tools/filter.py create mode 100755 kcov-38/tests/tools/parse_cobertura.py create mode 100644 kcov-38/tests/tools/python.py create mode 100755 kcov-38/tests/tools/run-tests create mode 100644 kcov-38/tests/tools/system_mode.py create mode 100644 kcov-38/tests/tools/testbase.py create mode 100644 kcov-38/tests/unit-tests/CMakeLists.txt create mode 100644 kcov-38/tests/unit-tests/main.cc create mode 100644 kcov-38/tests/unit-tests/mocks/mock-collector.hh create mode 100644 kcov-38/tests/unit-tests/mocks/mock-engine.hh create mode 100644 kcov-38/tests/unit-tests/mocks/mock-reporter.hh create mode 100644 kcov-38/tests/unit-tests/second-source.c create mode 100644 kcov-38/tests/unit-tests/test-source.c create mode 100644 kcov-38/tests/unit-tests/test.hh create mode 100644 kcov-38/tests/unit-tests/tests-collector.cc create mode 100644 kcov-38/tests/unit-tests/tests-configuration.cc create mode 100644 kcov-38/tests/unit-tests/tests-elf.cc create mode 100644 kcov-38/tests/unit-tests/tests-filter.cc create mode 100644 kcov-38/tests/unit-tests/tests-merge-parser.cc create mode 100644 kcov-38/tests/unit-tests/tests-reporter.cc create mode 100644 kcov-38/tests/unit-tests/tests-system-mode.cc create mode 100644 kcov-38/tests/unit-tests/tests-utils.cc create mode 100644 kcov-38/tests/unit-tests/tests-writer.cc create mode 100644 kcov-38/tools/CMakeLists.txt create mode 100644 kcov-38/tools/line2addr.cc create mode 100644 kcov-38/travis/Makefile create mode 100755 kcov-38/travis/perf-test.sh diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml index d1d52e8b9f50..4c5327de50b8 100644 --- a/.github/workflows/ci-rust.yml +++ b/.github/workflows/ci-rust.yml @@ -21,7 +21,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | cargo install cargo-tarpaulin - cargo tarpaulin --out Xml + cargo tarpaulin make test-vectors --out Xml bash <(curl -s https://codecov.io/bash) -X gcov -t $CODECOV_TOKEN test: name: test diff --git a/.github/workflows/grcov.yml b/.github/workflows/grcov.yml index 702a0b1c9c3f..020715d78c31 100644 --- a/.github/workflows/grcov.yml +++ b/.github/workflows/grcov.yml @@ -27,8 +27,8 @@ jobs: - name: Install apt packages run: | sudo apt install ocl-icd-opencl-dev make clang pkg-config libssl-dev libclang-dev - sudo apt-get install -y libhwloc-dev - + sudo apt-get install -y libhwloc-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc + - name: Install toolchain uses: actions-rs/toolchain@v1 with: diff --git a/kcov-38/.dockerignore b/kcov-38/.dockerignore new file mode 100644 index 000000000000..6a6e01c108cb --- /dev/null +++ b/kcov-38/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +build diff --git a/kcov-38/.gitignore b/kcov-38/.gitignore new file mode 100644 index 000000000000..d824ba11c26a --- /dev/null +++ b/kcov-38/.gitignore @@ -0,0 +1,13 @@ +*.o +*~ +*.pyc +*.pyo +*.cmd +.tmp_versions +*.ko +*.symvers +*.order +*.mod.c +kcov +build +obj-*/ diff --git a/kcov-38/.gitmodules b/kcov-38/.gitmodules new file mode 100644 index 000000000000..4177d127eb92 --- /dev/null +++ b/kcov-38/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tests/unit-tests/trompeloeil"] + path = tests/unit-tests/trompeloeil + url = https://github.com/rollbear/trompeloeil.git diff --git a/kcov-38/.travis.yml b/kcov-38/.travis.yml new file mode 100644 index 000000000000..3892f43a2108 --- /dev/null +++ b/kcov-38/.travis.yml @@ -0,0 +1,47 @@ +# Build matrix / environment variable are explained on: +# http://about.travis-ci.org/docs/user/build-configuration/ +# This file can be validated on: +# http://lint.travis-ci.org/ + +sudo: required +dist: trusty + +before_install: make -f travis/Makefile prepare_environment + +os: + - linux + - osx + +language: cpp +compiler: + - gcc + - clang + + +env: + global: + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: "WG/iday4nudNJ9acP/gjjuXzI0Jw0MN0zP9JA3WueMvMV0UrVRnBKM+papB06XiB4Gyiaoy92pfOGzmby0ciMAvydBn2DyuGZhM1nXuEIbkQqfP3AR3z6nCZHY27NAhVnpnEAyb56FwD353JMVZj34cnRmcjgKArMM3Y8W66Zls=" + # This, and before_script, is taken from from https://github.com/umlaeute/Gem + - COVERITY_SCAN_BRANCH_PATTERN="master" + - COVERITY_SCAN_NOTIFICATION_EMAIL="simon.kagstrom@gmail.com" + - COVERITY_SCAN_BUILD_COMMAND_PREPEND="mkdir -p coverity-build && cd coverity-build && cmake .. && cd .." + - COVERITY_SCAN_BUILD_COMMAND="make -C coverity-build" + - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG" + + +before_script: + - mkdir -p coverity-build && cd coverity-build && cmake .. && cd .. + - if [[ "x${CC}" = "xclang" ]] ; then curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash || true ; fi + + +script: make -f travis/Makefile run-tests + +notifications: + recipients: + - simon.kagstrom@gmail.com + email: + on_success: change + on_failure: always + diff --git a/kcov-38/CMakeLists.txt b/kcov-38/CMakeLists.txt new file mode 100644 index 000000000000..a71af0072b4b --- /dev/null +++ b/kcov-38/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required (VERSION 2.8.4) +project (kcov) + +set (PROJECT_VERSION_MAJOR 35) +set (PROJECT_VERSION_MINOR 0) +set (PROJECT_VERSION_PATCH 0) +set (PROJECT_VERSION + "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + +if (POLICY CMP0042) + # MACOSX_RPATH is enabled by default. + cmake_policy (SET CMP0042 NEW) +endif (POLICY CMP0042) + +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set (CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are None Debug Release RelWithDebInfo MinSizeRel" + FORCE) + set_property (CACHE CMAKE_BUILD_TYPE PROPERTY + STRINGS None Debug Release RelWithDebInfo MinSizeRel) +endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + +add_definitions(-DPACKAGE) +add_definitions(-DPACKAGE_VERSION) +# ==================================== +# configuring +# ==================================== +list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +option (SPECIFY_RPATH "Specify RPATH for installed executables" OFF) +mark_as_advanced (SPECIFY_RPATH) + +# ==================================== +# default install paths for targets +# ==================================== +include (CPack.local.cmake OPTIONAL) + +set (KCOV_INSTALL_BINDIR "bin" CACHE STRING "Install destination for user executables") +set (KCOV_INSTALL_DOCDIR "share/doc/kcov" CACHE STRING "Install destination for documentation") +set (KCOV_INSTALL_MANDIR "share/man" CACHE STRING "Install destination for man documentation") +mark_as_advanced (KCOV_INSTALL_BINDIR KCOV_INSTALL_DOCDIR KCOV_INSTALL_MANDIR) + +install (FILES ChangeLog COPYING COPYING.externals + DESTINATION "${KCOV_INSTALL_DOCDIR}") + +# ==================================== +# build all +# ==================================== +add_subdirectory (src) +add_subdirectory (doc) diff --git a/kcov-38/CONTRIBUTING.md b/kcov-38/CONTRIBUTING.md new file mode 100644 index 000000000000..3c6330e097f3 --- /dev/null +++ b/kcov-38/CONTRIBUTING.md @@ -0,0 +1,12 @@ +# Contributing to Kcov + +Contributors are welcome! + +## Patch acceptance process + +* If the contribution is a fix to a bug report or an issue, prefix the commit + message with Issue #xxx + +* Submit a pull request via github + +* There is some documentation about the design in the doc/ subdirectory diff --git a/kcov-38/COPYING b/kcov-38/COPYING new file mode 100644 index 000000000000..d159169d1050 --- /dev/null +++ b/kcov-38/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/kcov-38/COPYING.externals b/kcov-38/COPYING.externals new file mode 100644 index 000000000000..4f206baaa144 --- /dev/null +++ b/kcov-38/COPYING.externals @@ -0,0 +1,3 @@ +handlebars.js: MIT +tablesorter (mottie): GPLv2 or MIT +jquery: MIT diff --git a/kcov-38/CPack.local.cmake b/kcov-38/CPack.local.cmake new file mode 100644 index 000000000000..d6baacb1ab95 --- /dev/null +++ b/kcov-38/CPack.local.cmake @@ -0,0 +1,29 @@ +# ==================================== +# cpack settings +# ==================================== +set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Code coverage tester based on Bcov") +set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README") +set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") +set (CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README") +set (CPACK_PACKAGE_VENDOR "Simon Kagstrom") +set (CPACK_PACKAGE_CONTACT "Simon Kagstrom ") +set (CPACK_STRIP_FILES ON) +set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}") +set (CPACK_SOURCE_IGNORE_FILES + /Debug/ /Release/ /build/ + /.git/ /.gitignore + .*~ .*.log +) + +set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION + /usr/share/man /usr/share/man/man1 + /usr/local/share/man /usr/local/share/man/man1) + +set (CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) +set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set (CPACK_DEBIAN_PACKAGE_HOMEPAGE https://simonkagstrom.github.io/kcov/) + +include (CPack) diff --git a/kcov-38/ChangeLog b/kcov-38/ChangeLog new file mode 100644 index 000000000000..8bbafa566391 --- /dev/null +++ b/kcov-38/ChangeLog @@ -0,0 +1,740 @@ +Kcov (38): + * Issue #267: Fix hang on Aarch64 (Julian Stecklina) + + -- Simon Kagstrom , Fri Jan 17 12:10:17 CET 2020 + +Kcov (37): + * Issue #312: Avoid unaligned access warnings for merged data + (Didri Boukelmoune) + + * Issue #309: Correct encoding for non-english charsets (Zhenwei Ding) + + * Issues #307, #308: Python 3 cleanup (Didri Boukelmoune) + + * Issue #304: Bash: Correct PS4 parsing (Koichi Nakashima) + + * Issues #295, #296: Comply with Cobertura coverage-04.dtd (Arnaud Botella) + + * Issues #292, #294 : bash: Correct peek_file, xtrace-fd handling (kimkim19642004) + + * Issues #282, #286, #287 Lots of build system fixes (Jamie Snape, + Akos Somfai) + + * Issue #285: Cobertura schema fixed + + * Issue #279: Rust: #[should_panic] files are now ignored + + * Issue #274: Automated docker builds (Manuel Mendez) + + * Issues #268, #310: A Debian packate file has been added (Paul Dreik) + + * Issue #190: Code style changed to K&R + + -- Simon Kagstrom , Tue Oct 1 09:14:07 CEST 2019 + +Kcov (36): + * Issue #253: Kcov has been ported to FreeBSD (Alan Somers) + + * Issue #243: ptrace build fixes (Leo Gaspard) + + * Issue #245: Major cmake build system fixes (Jamie Snape) + + * Issue #250: Improve checks for Python command + + * Issue #259: Use --include-pattern in merge mode + + * Issue #166: Fix make-based builds on OSX + + * Issue #157: OSX now supports covering shared libraries + + -- Simon Kagstrom , Thu Aug 23 12:46:49 CEST 2018 + +Kcov (35): + * Issue #240: Allow running on systems with > 32/64 CPUs + (Alexandra Ghecenco) + + * Issue #178: Fix build for Aarch64 (Dridi Boukelmoune) + + * Issue #223: Add --clean to make turn off accumulation + + * Issue #224: Show uncovered scripts in bash reports + + * Only build the system daemon if libelf isn't available + + * Issue #208: Allow covering multiple binaries with the same name + in the same report + + -- Simon Kagstrom , Thu Apr 19 20:22:30 CEST 2018 + +Kcov (34): + * Issue #215: Correct build with binutils >= 2.29 + + * Issue #216: Don't use SIGUNUSED (Dridi Boukelmoune) + + * Issue #211: Avoid blocking bash write (Mike Bland) + + * Issue #198: Correct skipped breakpoint count + + * Issue #92: kcov can now perform full-system instrumentation via a + daemon and statically instrumented binaries + + * Issue #193: Handle all available bash output (Ashley Straw) + + * Issue #187: Fix crash regression due to address verifier changes + + * Issue #166, Issue #209: Describe workaround for OSX build problems + + * Issue #183: python: Quote argument strings to avoid argv issues (Bashkar Rana) + + * Unit tests build again + + * Issue #165: bash: Provide basic parser mode to workaround bugs in the + parser + + * Issue #178: Port to AArch64 (though untested!) + + * Issue #180: kcov now honors LCOV_EXCL_LINE/START/STOP, so that regions of + code can be excluded from the report. Command-line options can also set + custom patterns (Me, Keith Wansbrough) + + * Issue #175: kcov can now ignore unreachable lines (Thomas Neumann) + + -- Simon Kagstrom , Sun Sep 10 13:11:34 CEST 2017 + +Kcov (33): + * Issue #167: Writers: Add pure JSON writer for gitlabCI (http://gitlab.com) + integration (Bryce Fisher-Fleig) + + * Issue #162: Use Xcode build in addtion to Make for Travis + + * Issue #163: Correct attaching to processes which create threads (ptrace) + + -- Simon Kagstrom , Fri Jan 13 09:59:53 CET 2017 + +Kcov (32): + * Issue #135: Covering binaries on OSX is now possible as well! + + * Issue #114, Issue #150, Kcov also works with codecov without changes! + + * Issue #152, Issue #154: bash: Correct handling heredoc special cases + + * Re-enable coverity for Travis CI builds again + + * Issue #148: Correct handling of PTRACE events (Niklas Ögren) + + * Issue #139: Create kcov-solib.pipe in a tempdir if out-dir is unfifoable + + * Issue #141: Make [merged] name configurable via --configure + + * Issue #138: Allow setting a different css file via --configure + + * Issue #140: Allow specifying command name via --configure + + * Issue #144: Allow setting configuration options manually with --configure + + -- Simon Kagstrom , Tue Nov 22 12:32:41 CET 2016 + +Kcov (31): + * Exit with 0 when running --version (Pietro Monteiro) + + * travis: Run regression tests on OS X as well + + * Issue #130: bash: Correct handling of data accumulation with absolute paths + + * Issue #127: Add output support for the SonarQube coverage plugin + + * Refactor travis tests to use pyunit instead of Robot Framework + + * Allow --repace-src when running with --merge + + -- Simon Kagstrom , Sun Apr 17 09:42:12 CEST 2016 + +Kcov (30): + * Issue #121: Add --version to display the current kcov version + + * Issue #119: Allow merged output to serve as input to another merge + session + + * Issue #21: Allow builds on Mac OSX as well (Python and Bash only) + + * Issue #122: Fix memory leak when adding shared libraries (jba31) + + * Issue #118: Correct merging of reports collected on another machine + + * Issue #116/#117: bash: Correct corner-cases for herecdocs and arithmetic + (Phil Whineray) + + * Fix various spelling errors (Veres Lajos) + + * Issue #110: Correct handling of vfork() + + * --pid= requires an executable, actually say that as well (Vincent Gibert) + + * Issue #105: Warn about --verify without binutils + + * Issue #104: Correct handling of shared libraries with build-id debug + information + + * Fix --skip-solibs handling + + -- Simon Kagstrom , Fri Nov 27 06:51:40 CET 2015 + +kcov (29): + * Tagged v28 by mistake :-) + +Kcov (28): + * Don't report each invalid breakpoint on --verify (give a summary instead) + + * Issue #103: html: Display error message if JavaScript is disabled in + the browser + + * Issue #101: Fix regression which caused --collect-only to work only + if the source code was available. + + * Coveralls: Use source_digest instead of source (current API?) + + * Issue #99: Add support for looking up debug info from .gnu_debuglink + sections (Vincent Brillault) + + * Issue #98: Show execution order in the HTML output and add headings for + the source view + + * Issue #26: Don't warn for non-existing ELFs (typically linux-vdso.so.1) + + * Issue #91: Correctly generate [merged] output after running two programs + + -- Simon Kagstrom , Sat Jul 4 05:16:21 CEST 2015 + +Kcov (27): + * Issue #90: coveralls: Publish merged results if available + + * Issue #88: bash: Correct handling of ${var#} + + * Issue #87: Allow coveralls uploads when using --merge (Ricardo Martins) + + * Issue #86: Fix build on distros with Python 3 as default (David Barnett) + + * python: Improve handling of some corner-cases for '''-strings + + * Issue #76: bash: Handle multi-line quoted strings + + * Issue #60: Add --merge option to merge output of multiple runs (i.e., + what the kcov-merge script did, but now integrated) + + * Issue #81: Make --include-path= combined with --include-pattern= + coexist more naturally (i.e., consider both) + + * Lookup realpath of the paths passed to --include/exclude-path= + + * Issue #18: Add --verify option that checks that all breakpoints are + set on proper addresses (i.e., instruction boundaries) + + * Issue #80: Fix coverage accumulation for PIE executables + + -- Simon Kagstrom , Fri May 1 19:44:04 CEST 2015 + +Kcov (26): + * Issue #77: Collect coverage for Position-Independent Executables + (Kang Seonghoon) + + * Issue #72: Don't crash on filenames <3 characters long (Kang Seonghoon) + + * Issue #71: Don't skip instructions on SIGSTOP (unbreaks PowerPC) + + * Issue #70: bash: Handle $# ad ${#var ..} (not comments) + + * Issue #66: bash: Unbreak handling of arithmetic shifts (conflict with + heredocs) + + * Issue #65: merge-parser: Don't panic on non-existing files (e.g., if moved) + + * Issue #64: bash: Always parse the file given on the command line + + * Issue #63: bash: Correct check for empty braces + + * Issue #62: bash: Check for balenced parenthesis (e.g., in cases) + + * Issue #51: bash: Collect coverage for #!/bin/sh executables via preloading + (off by default) + + * bash: Add ability to use DEBUG trap instead of PS4 (off by default, not + stable) + + * Unbreak accumulation (for certain programs) + + * Fix hanging regression introduced in v23 (don't take solib semaphore + before open/read) + + * Report file-not-found or file-not-executable errors more clearly + + * Issue #61: bash-engine: Output trace data via BASH_XTRACEFD when possible + (bash >= 4.2) and filter stdout to catch redirections otherwise + + * Issue #58: Lookup program in $PATH if it's not given on the command line + + * Issue #57: bash-engine: Correct handling of quoted multiline variables + + -- Simon Kagstrom , Tue Mar 17 19:16:46 CET 2015 + +Kcov (25): + * Make database files smaller by storing only executed addresses + + * Issue #52: Don't include bash-helper.sh in the output + + * Issue #54: Implement handling of coverage accumulation for shared + libraries + + * Issue #50: Make sure that Bash "heredoc" markers are words + + * Fix some failure handling coverity errors + + * Issue #49 (WIP): Implement broken gcov engine (multiple issues still pending) + + * Refactor configuration handling to be more generic (avoid setters, + use key/value pairs via strings instead) + + * Add "capabilities" class to make parts of the implementation clearer + + * HTML-writer: Correct off-by-one access to static data + + -- Simon Kagstrom , Tue Feb 10 19:38:04 CET 2015 + +Kcov (24): + * Misc performance improvements here and there + + * Build: Use the travis-ci.org build service to make tests more + reliable. + + * Unbreak Python and Bash coverage collection on 32-bit builds + + * Correct clang build (well, in Fedora 20 it still fails) + + * Issue #43: Clarify elfutils dependency + + * Issue #46: Add support for uploading to coveralls.io via the + --coveralls-id= option + + * Issue #45: Bash: Fix coverage collection when executing sub-scripts as + programs. + + * Issue #31: Fix handling of attaching to pid in a multithreaded process. + Implementation taken from GDB: kcov now loops through all threads in + a process and attaches to each one. + + * Issue #44: Bash: Fix issues with <<< redirection, which were parsed + as here documents + + * Update the HTML/Cobertura output to display single-shot, limited and + unlimited output in a logical way + + * Allow three hit modes for parsers/engines: Single-shot (covered or not, + as in the merge parser), limited (as in ptrace) and unlimited (line + execution count used in Python/Bash) + + * Remove some ptrace-specific stuff from the Engine interface + + * Document classes better + + -- Simon Kagstrom , Mon Jan 5 09:46:29 CET 2015 + +Kcov (23): + * Correct use-after-free case when the solib thread is killed + + * Default to 5s output interval to avoid costly write-to-disk sessions + too often + + * Performance improvements for the Cobertura writer by reducing the amount + of string operations + + * Add a kcov-merge command which merges data from multiple kcov + directories into a single report (Chris Love) + + * Issue #39: Reduce the amount of extra output files by using filename + as a tie breaker instead of file data. + + * Issue #38: Fix several bugs which caused merged output to miss data + present in the regular output + + * Issue #37: Correct coverage accumulation for Python/bash + + * Issue #36: Collect coverage from dlopen:ed libraries (through unconditional + breakpoints in the dlopen call). Should also improve reliability of + general shared library coverage collection + + -- Simon Kagstrom , Tue Dec 2 20:42:04 CET 2014 + + +Kcov (22): + * Issue #35: Support installation RPATH for build (Chris Love) + + * Issue #32: Fix problems when running Python unittest modules + + * Various coverity resource leak fixes + + * Peek into files to improve performance for matching (also see Issue #33) + + * Break out solib handling from ptrace (not really related) + + * Improve ptrace performance a bit, while also simplifying code + + -- Simon Kagstrom , Wed Oct 29 12:58:18 CET 2014 + +Kcov (21): + * Fix regression for coverage-of-32-bit-binaries-on-64-bit-systems introduced + in kcov 20 + + * Slightly better file stat caching (slight performance improvement) + + * Avoid outputting merged cobertura output for single coverage runs + + -- Simon Kagstrom , Thu Aug 7 20:00:20 CEST 2014 + +Kcov (20): + * Issue #25: Fix starvation bug where long report generation time could starve + the actual application. The bug was caused by a timestamp issue. + + * Issue #18: Provide explanation and possible workaround for SIGILL problems + with GCC 4.1.2 + + * Issue #23: Warn if a binary has no debug symbols + + * Replace std::list/std::map with std::list/std::unordered_map where possible + (slight performance improvement) + + * Remove C++11 constructs (auto, nullptr, range-based for-loops) to allow + building with older compilers + + * Correct bug in --report-only (crash in ptrace upon termination) + + * Slight performance improvement and simplification in the lineid code + + -- Simon Kagstrom , Mon Aug 4 12:57:19 CEST 2014 + +Kcov (19): + * bash coverage: Implemented support for collecting shell script + (sh/bash) coverage! Loosely based on shcov, which is now deprecated + because of this + + * html-writer: Correct executable lines/covered lines in the summary + (was wrong in some cases) + + -- Simon Kagstrom , Mon Jun 30 18:30:37 CEST 2014 + +Kcov (18): + * Performance: Improve performance by cacheing realpath() + + * HTML: Always put merged results last and don't include them in sorting + + * HTML: Coloring improvements (?) of the HTML output + + * HTML: Refactor HTML output completely to use javascript-based pages. + This allows selecting how to sort directly from the web page, + and greatly simplifies the generating C++ code + + * Correct filtering bug in the merged output, where the last + run would filter out data from the previous runs + + * Issue #20: Fix hanging-on-killed-by-signal + + -- Simon Kagstrom , Mon Jun 9 19:12:38 CEST 2014 + +Kcov (17): + * Issue #19: Fix bug where kcov would let children which called + setpgid live even after terminating kcov itself (Oliver) + + * Issue #16: Output: Implement a merged mode, which shows a + combination of all covered programs under the [merged] link + + * Fix an HTML output bug introduced in kcov 14 where the summary + counts in the index page would be wrong. + + * Issue #15: Fix a crash when source lines are > ~2000 characters long + + * Issue #17: Fix parsing of multiple include/exclude patterns + (Jamie Kirkpatrick) + + * Split usage in common/uncommon options + + * Improve unit tests and robot framework tests + + * Various work on the kernel-engine and general refactoring + + -- Simon Kagstrom , Sun May 18 19:24:14 CEST 2014 + +Kcov (16): + * kernel-engine: Implement an engine to handle kernel code coverage + collection (not finished) + + * kprobe-coverage: Refactor the kernel module so that it basically + works now + + * Code refactoring and more C++11-izing + + * Python: Filter out some false negatives (i.e., non-executable + lines marked as red) + + * Python: Report absolute paths so that output filtering works + + * Python: Catch exceptions in the python helper to avoid EOF etc + being propagated upwards (and coverage collection to fail) + + * Python: Fix a case where the engine would simply hang on waiting + for more data + + -- Simon Kagstrom , Fri Mar 21 16:38:28 CET 2014 + + +Kcov (15): + * Workaround a shared-library issue where kcov would sometimes hang on + the malloc. The workaround uses a static memory buffer instead. + + * Implemented support for collecting Python code coverage! Usage is the + same as for compiled code. + + * Code-restructuring to allow multiple "engines", which makes it possible + to add the python support above. + + * More C++11-izing of the code + + -- Simon Kagstrom , Sun Mar 2 10:50:00 CET 2014 + + +Kcov (14): + * Add two options, --collect-only and --report-only to only collect + coverage and produce Cobertura/HTML output respectively. Can be + used for example on embedded systems where the source code isn't + available. + + * PowerPC support has been added (thanks to Aleksandr Vilchinskii and + Konstantin Polivtsev for testing this) + + -- Simon Kagstrom , Wed Feb 5 19:42:03 CET 2014 + + +Kcov (13): + * Don't hang the kcov main process if a breakpoint comes in + before the solib handler constructor has executed (depends on + the construction order) + + * Correct bug with realloc in solib handling (malloc all + data once only) + + -- Simon Kagstrom , Sun Dec 8 19:34:37 CET 2013 + +Kcov (12): + * Fix lockup bug in the solib code path (where processes with + many solibs would hang at startup) + + * Correct a crash in the reporter + + * Add test case for signals + + * Report from main thread to avoid threading issues + + * Fairly major refactoring of ptrace code to avoid an issue + where two PTRACE_CONTINUE calls could be done without + waitpid() in between. This would cause crashes in the + traced program. + + * Add support for looking for debug info in separate files + via build-id (Alexander Larsson) + + * Add --exit-first-process option to fork kcov when covering + daemons (otherwise kcov will wait for all children to finish) + + * Add --skip-solibs option to disable processing of shared + libraries, which also works around a bug which sometimes + triggers + + * Add --replace-source-path option for cases where the sources + have been moved (James Warner) + + * Fix linking (Igor Murzov) + + * Some build fixes to make it build with clang++ + + * Fix various warnings + + * Add experimental profiler based on kcov + + * Add sorting by reverse-percent (high -> low, -u option) + + * Cache non-existing files to avoid doing lstat calls all the + time (slight performance improvement) + + * closedir() was not called from the html-writer, which creates + a resource leak (Karl Vogel) + + -- Simon Kagstrom , Sat Oct 19 11:06:42 CEST 2013 + + +Kcov (11): + * Fix handling of common paths in HTML writer + + * Fix bug in shared library handling where repeated exec()s would + cause strange hangs. Fixed by unsetting the KCOV_SOLIB_PATH environment + variable after the first executable has been started. + Add test-popen test case to check for this. + + * Expand ~'s in the --include-path and --exclude-path options + + * Unbreak accumulating data from multiple runs again (introduced + sometime during refactoring), and add test case for this + + -- Simon Kagstrom , Sat Aug 18 08:45:03 CEST 2012 + +Kcov (10): + * Fix bug where multiple files with the same name would only be shown + once in the HTML output. + + * Fix icache conflict bug (present while instrumenting shared libraries) + on multi-CPU systems by forcing all traced processes to one CPU + + * Re-enable the --pid=PID argument to trace a running process again + + * Fix race condition in the reporter + + * Only set breakpoints in executable sections. This avoids problems where + the DWARF line information points to non-code sections (which can happen) + + * Fix coverage reporting of orphaned children (where the parent does not + wait(2) for the child + + * Use std::unordered_map for breakpoints (improves performance somewhat) + + * Improve unit tests + + * Add robot-framework testsuite that can be run from a Jenkins server + + -- Simon Kagstrom , Mon Jul 23 13:28:43 CEST 2012 + +Kcov (9): + * Completely refactor the source code (yes, everything!), and add + unit tests to verify kcov itself. The code is now in C++. + + * Implement transparent coverage instrumentation for shared libraries + (done automatically) + + * Implement a Cobertura-compatible XML backend. This allows integrating + kcov coverage information in Jenkins. + + * Improve performance a lot by filtering out files already at the + instrumentation step (and not only during HTML generation). This + means that --include-pattern/--include-path can improve kcov performance + by quite a bit. + + -- Simon Kagstrom , Fri Jun 15 17:39:17 CEST 2012 + +Kcov (8): + * Import the man-page from Debian and update it. + + * Simplify parts of the ptrace code + + * Correct the sorting of files-by-percentage when the difference + is less than 0.5% (thanks Martin!). + + * Correct the percentage-bar color according to the configured + limits in the report. + + -- Simon Kagstrom , Sun Dec 4 14:13:47 CET 2011 + +Kcov (7): + * Weed out common parts of source paths from the report, display + the full path as the HTML title= tag + + * Fix crash bug in argument passing + + * Handle hit count a bit better + + -- Simon Kagstrom , 2011-07-10 + +Kcov (6): + * Correct hit count. The hit count is no longer over the number of + possible hits + + * Better error reporting when stripped or otherwise broken binaries + are passed to kcov + + * Handle files with relative directory paths (lookup the absolute + path via DWARF source files). Otherwise, some files are not reported + in the output. + + * Add test program to detect regressions + + * Detect stripped binaries and report that you'll need to build + with -g + + * Correct --include/exclude-path behavior. The previous version + will match PATH*/* instead of just PATH/* (Igor Murzov) + + * Various small fixes + + -- Simon Kagstrom , Sat Apr 16 08:28:27 CEST 2011 + +Kcov (5): + * Switch from libdwarf to libdw (from elfutils) for building + kcov. libdw is a bit more logical than libdwarf. + + * Implement actual path matching (Igor Murzov) + + * Rename path-matching to pattern matching (which is what it does) + and set it up using long options. + + * Parse options with getopt + + * Don't escape all multibyte characters in the report. That will + break display of UTF-8 etc (Igor Murzov) + + * Improve cmake packaging support (Igor Murzov) + + -- Simon Kagstrom , Sat Feb 12 15:25:57 CET 2011 + +Kcov (4): + * Build system is now based on cmake (Igor Murzov) + + * Add MIPS32, ARM and PowerPC architecture support. This is untested though + and might very well not work at all. + + * Add -t option to set the title of the program to test (otherwise it + will be the filename) + + * Refactored the architecture support to allow running i386 programs + on x86_64 machines, and easier add other architectures + + * Make it possible to collect coverage from multiple programs in a + single directory, useful for example when running a test suite + + * Add coverage color to the header as well + + * Misc refactoring + + -- Simon Kagstrom , Tue Dec 7 18:20:28 CET 2010 + +Kcov (3): + * Various bug fixes + + * Add ability to trace running processes by PID + + * Fix copyright headers + + -- Simon Kagstrom , Sat Nov 13 08:13:03 CET 2010 + +Kcov (2): + * Misc fixes + + * Add ability to specify low/high limits + + * Add state saving between runs. Re-starting the same program + will then add to existing coverage instead of starting from + scratch. + + * Link to web page in the report + + * Add option to sort by percentage or file name + + -- Simon Kagstrom , Sun Oct 24 09:15:39 CEST 2010 + +Kcov (1): + * Initial release + + -- Simon Kagstrom diff --git a/kcov-38/Dockerfile b/kcov-38/Dockerfile new file mode 100644 index 000000000000..e7eeee550b35 --- /dev/null +++ b/kcov-38/Dockerfile @@ -0,0 +1,40 @@ +FROM debian:stable-slim AS builder + +RUN apt-get update && \ + apt-get install -y \ + binutils-dev \ + build-essential \ + cmake \ + git \ + libcurl4-openssl-dev \ + libdw-dev \ + libiberty-dev \ + ninja-build \ + python3 \ + zlib1g-dev \ + ; + +ADD . /src/ + +RUN mkdir /src/build && \ + cd /src/build && \ + cmake -G 'Ninja' .. && \ + cmake --build . && \ + cmake --build . --target install + +FROM debian:stable-slim + +RUN apt-get update && \ + apt-get install -y \ + binutils \ + libcurl4 \ + libdw1 \ + zlib1g \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=builder /usr/local/bin/kcov* /usr/local/bin/ +COPY --from=builder /usr/local/share/doc/kcov /usr/local/share/doc/kcov + +CMD ["/usr/local/bin/kcov"] diff --git a/kcov-38/INSTALL.md b/kcov-38/INSTALL.md new file mode 100644 index 000000000000..1de3f0f3f352 --- /dev/null +++ b/kcov-38/INSTALL.md @@ -0,0 +1,94 @@ + +## *Building Kcov* + +Installing dependencies +======================= +You need development headers and libraries for libstdc++, curl, elfutils +and (optional) binutils and libiberty to build kcov. Note that elfutils is +found in multiple variants, and at least in RH/Centos/Fedora you'll need +elfutils-devel and *not* elfutils-libelf-devel. + +FreeBSD +------- +pkg install binutils cmake elfutils python + +Ubuntu +------ +Install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev + + +Fedora / Centos / RHEL +---------------------- +Install elfutils-libelf-devel libcurl-devel binutils-devel elfutils-devel + +Mac OS X +-------- +brew install zlib bash cmake pkgconfig + +*Temporary* OSX build instructions due to Issue #166: + +Create an empty build dir and do the following steps: + +``` + cd + cmake -G Xcode + xcodebuild -target kcov -configuration Release +``` + +The binary will be `src/Release/kcov` + +Building +======== + +Create an empty build dir and do the following steps: + + cmake [options] + make + make install + +Useful options include -DCMAKE_INSTALL_PREFIX= (installation prefix), +-DCMAKE_BUILD_TYPE= and -DCMAKE_C_FLAGS=. + +Basic example: + +``` + cd /path/to/kcov/source/dir + mkdir build + cd build + cmake .. + make + make install +``` + +More advanced example: + +``` + cd /path/to/kcov/source/dir + mkdir build + cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="-O3 -march=i686" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + .. + make -j2 || exit 1 + make install DESTDIR=/tmp/kcov-build || exit 1 +``` + +For further information refer to cmake documentation: + http://www.cmake.org/cmake/help/cmake-2-8-docs.html. + + +Troubleshooting +=============== + +If you have elfutils installed, but cmake fails to find it, specify elfutils +install prefix explicitly to cmake. Here is an example: + +``` + cd kcov + CMAKE_PREFIX_PATH=/opt/elfutils-dir/ \ + cmake . + make + make install +``` diff --git a/kcov-38/README b/kcov-38/README new file mode 120000 index 000000000000..42061c01a1c7 --- /dev/null +++ b/kcov-38/README @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/kcov-38/README.md b/kcov-38/README.md new file mode 100644 index 000000000000..21e4a289818f --- /dev/null +++ b/kcov-38/README.md @@ -0,0 +1,96 @@ +[![Build Status](https://travis-ci.org/SimonKagstrom/kcov.svg?branch=master)](https://travis-ci.org/SimonKagstrom/kcov) +[![Coveralls coverage status](https://img.shields.io/coveralls/SimonKagstrom/kcov.svg)](https://coveralls.io/r/SimonKagstrom/kcov?branch=master) +[![Codecov coverage status](https://codecov.io/gh/SimonKagstrom/kcov/branch/master/graph/badge.svg)](https://codecov.io/gh/SimonKagstrom/kcov) +[![Coverity Scan Build Status](https://scan.coverity.com/projects/2844/badge.svg)](https://scan.coverity.com/projects/2844) +![Docker Build Status](https://img.shields.io/docker/build/kcov/kcov.svg) +![MicroBadger Size](https://img.shields.io/microbadger/image-size/kcov/kcov.svg) +![Docker Pulls](https://img.shields.io/docker/pulls/kcov/kcov.svg) + +[![PayPal Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=simon.kagstrom%40gmail%2ecom&lc=US&item_name=Simon%20Kagstrom&item_number=kcov¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) [![Github All Releases](https://img.shields.io/github/downloads/atom/atom/total.svg)](https://github.com/SimonKagstrom/kcov/) + +## *kcov* +Kcov is a FreeBSD/Linux/OSX code coverage tester for compiled languages, Python +and Bash. Kcov was originally a fork of [Bcov](http://bcov.sf.net), but has +since evolved to support a large feature set in addition to that of Bcov. + +Kcov, like Bcov, uses DWARF debugging information for compiled programs to +make it possible to collect coverage information without special compiler +switches. + +For a video introduction, [look at this presentation from SwedenCPP](https://www.youtube.com/watch?v=1QMHbp5LUKg) + +Installing +---------- +Refer to the [INSTALL](INSTALL.md) file for build instructions, or use our official Docker images: + +* [kcov/kcov](https://hub.docker.com/r/kcov/kcov/) for releases since v31. + +_Note:_ + +_Tags v31-v33 are re-tags of [ragnaroek/kcov](https://hub.docker.com/r/ragnaroek/kcov/) which were not automated builds._ + +_Tags v34-v35 are non automated builds using the Dockerfile in master with 1 minor [modification](https://github.com/SimonKagstrom/kcov/pull/274#issuecomment-432827976)._ + +_Tag v36 is a non automated build using the Dockerfile in master._ + + + + +How to use it +------------- +Basic usage is straight-forward: + +``` +kcov /path/to/outdir executable [args for the executable] +``` + +*/path/to/outdir* will contain lcov-style HTML output generated +continuously while the application runs. Kcov will also write cobertura- +compatible XML output and can upload coverage data directly to +http://coveralls.io for easy integration with travis-ci. A generic +coverage.json report is also generated which contains summaries for a given +binary and each source file. + +Filtering output +---------------- +It's often useful to filter output, since e.g., /usr/include is seldom of interest. +This can be done in two ways: + +``` +kcov --exclude-pattern=/usr/include --include-pattern=part/of/path,other/path \ + /path/to/outdir executable +``` + +which will do a string-comparison and include everything which contains +*part/of/path* or *other/path* but exclude everything that has the +*/usr/include* string in it. + +``` +kcov --include-path=/my/src/path /path/to/outdir executable +kcov --exclude-path=/usr/include /path/to/outdir executable +``` + +Does the same thing, but with proper path lookups. + +Use from continuous integration systems +--------------------------------------- +kcov is easy to integrate with [travis-ci](http://travis-ci.org) together with +[coveralls.io](http://coveralls.io) or [codecov.io](http://codecov.io). It can also +be used from Jenkins, [SonarQube](http://sonarqube.org) and [GitLab CI](http://gitlab.com). +Refer to + +* [coveralls](doc/coveralls.md) for details about travis-ci + coveralls, or +* [codecov](doc/codecov.md) for details about travis-ci + codecov +* [jenkins](doc/jenkins.md) for details about how to integrate in Jenkins +* [sonarqube](doc/sonarqube.md) for how to use kcov and sonarqube together +* [gitlab](doc/gitlab.md) for use with GitLab + +Full-system instrumentation +--------------------------- +Kcov can instrument all binaries with very low overhead for embedded systems. +Refer to the [full system instrumentation](doc/full-system-instrumentation.md) documentation for details. + +More information +---------------- +kcov is written by Simon Kagstrom and more +information can be found at [the web page](http://simonkagstrom.github.com/kcov/index.html) diff --git a/kcov-38/cmake/FindBfd.cmake b/kcov-38/cmake/FindBfd.cmake new file mode 100644 index 000000000000..7b588a8188d5 --- /dev/null +++ b/kcov-38/cmake/FindBfd.cmake @@ -0,0 +1,85 @@ +# - Try to find libbfd +# Once done this will define +# +# LIBBFD_FOUND - system has libbfd +# LIBBFD_INCLUDE_DIRS - the libbfd include directory +# LIBBFD_LIBRARIES - Link these to use libbfd +# LIBBFD_DEFINITIONS - Compiler switches required for using libbfd +# +# Based on: +# +# Copyright (c) 2008 Bernhard Walle +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS) + set (LIBBFD_FIND_QUIETLY ON) +endif (LIBBFD_LIBRARIES AND LIBBFD_INCLUDE_DIRS) + +find_path (LIBBFD_INCLUDE_DIRS + NAMES + bfd.h + dis-asm.h + PATHS + /usr/include + /usr/local/include + /opt/local/include + /opt/include + ENV CPATH) + +# Ugly, yes ugly... +find_library (LIBBFD_BFD_LIBRARY + NAMES + bfd + PATHS + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /opt/usr/lib64 + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + +find_library (LIBBFD_IBERTY_LIBRARY + NAMES + iberty + PATHS + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /opt/usr/lib64 + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + +find_library (LIBBFD_OPCODES_LIBRARY + NAMES + opcodes + PATHS + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /opt/usr/lib64 + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + + +include (FindPackageHandleStandardArgs) + + +# handle the QUIETLY and REQUIRED arguments and set LIBBFD_FOUND to TRUE if all listed variables are TRUE +find_package_handle_standard_args(LIBBFD DEFAULT_MSG + LIBBFD_BFD_LIBRARY + LIBBFD_IBERTY_LIBRARY + LIBBFD_OPCODES_LIBRARY + LIBBFD_INCLUDE_DIRS) + +mark_as_advanced(LIBBFD_INCLUDE_DIRS LIBBFD_LIBRARIES) diff --git a/kcov-38/cmake/FindElfutils.cmake b/kcov-38/cmake/FindElfutils.cmake new file mode 100644 index 000000000000..eefae5e3586a --- /dev/null +++ b/kcov-38/cmake/FindElfutils.cmake @@ -0,0 +1,77 @@ +# - Try to find libdwarf +# Once done this will define +# +# LIBDWARF_FOUND - system has libdwarf +# LIBDWARF_INCLUDE_DIRS - the libdwarf include directory +# LIBDWARF_LIBRARIES - Link these to use libdwarf +# LIBDWARF_DEFINITIONS - Compiler switches required for using libdwarf +# + +# Locate libelf library at first +if (NOT LIBELF_FOUND) + find_package (LibElf) +endif (NOT LIBELF_FOUND) + +if (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS) + set (LibDwarf_FIND_QUIETLY ON) +endif (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS) + +find_package(PkgConfig QUIET) + +if(PKG_CONFIG_FOUND) + set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) + pkg_check_modules(PC_LIBDW QUIET libdw) +endif() + +find_path (DWARF_INCLUDE_DIR + NAMES + dwarf.h + HINTS + ${PC_LIBDW_INCLUDE_DIRS} + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ENV CPATH) # PATH and INCLUDE will also work +find_path (LIBDW_INCLUDE_DIR + NAMES + elfutils/libdw.h + HINTS + ${PC_LIBDW_INCLUDE_DIRS} + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ENV CPATH) +if (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR) + set (LIBDWARF_INCLUDE_DIRS ${DWARF_INCLUDE_DIR} ${LIBDW_INCLUDE_DIR}) +endif (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR) + +find_library (LIBDW_LIBRARY + NAMES + dw + HINTS + ${PC_LIBDW_LIBRARY_DIRS} + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ENV LIBRARY_PATH # PATH and LIB will also work + ENV LD_LIBRARY_PATH) + +include (FindPackageHandleStandardArgs) + + +# handle the QUIETLY and REQUIRED arguments and set LIBDWARF_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(ElfUtils DEFAULT_MSG + LIBDW_LIBRARY + LIBDW_INCLUDE_DIR) + +mark_as_advanced(LIBDW_INCLUDE_DIR LIBDW_LIBRARY) + +set(LIBDW_LIBRARIES ${LIBDW_LIBRARY} ) +set(LIBDW_INCLUDE_DIRS ${LIBDW_INCLUDE_DIR} ) diff --git a/kcov-38/cmake/FindLibCRPCUT.cmake b/kcov-38/cmake/FindLibCRPCUT.cmake new file mode 100644 index 000000000000..0cddba98953c --- /dev/null +++ b/kcov-38/cmake/FindLibCRPCUT.cmake @@ -0,0 +1,59 @@ +# - Try to find libcrpcut +# Once done this will define +# +# LIBCRPCUT_FOUND - system has libcrpcut +# LIBCRPCUT_INCLUDE_DIRS - the libcrpcut include directory +# LIBCRPCUT_LIBRARIES - Link these to use libcrpcut +# LIBCRPCUT_DEFINITIONS - Compiler switches required for using libcrpcut +# +# Based on: +# +# Copyright (c) 2008 Bernhard Walle +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +if (LIBCRPCUT_LIBRARIES AND LIBCRPCUT_INCLUDE_DIRS) + set (LibCRPCUT_FIND_QUIETLY ON) +endif (LIBCRPCUT_LIBRARIES AND LIBCRPCUT_INCLUDE_DIRS) + +find_path (LIBCRPCUT_INCLUDE_DIRS + NAMES + crpcut.hpp + PATHS + /usr/include + /usr/include/crpcut + /usr/local/include + /usr/local/include/crpcut + /opt/local/include + /opt/local/include/crpcut + /home/ska/local/include + ENV CPATH) + +find_library (LIBCRPCUT_LIBRARIES + NAMES + crpcut + PATHS + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /opt/usr/lib64 + /home/ska/local/lib + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + +include (FindPackageHandleStandardArgs) + + +# handle the QUIETLY and REQUIRED arguments and set LIBCRPCUT_FOUND to TRUE if all listed variables are TRUE +find_package_handle_standard_args(LibCRPCUT DEFAULT_MSG + LIBCRPCUT_LIBRARIES + LIBCRPCUT_INCLUDE_DIRS) + + +mark_as_advanced(LIBCRPCUT_INCLUDE_DIRS LIBCRPCUT_LIBRARIES) diff --git a/kcov-38/cmake/FindLibElf.cmake b/kcov-38/cmake/FindLibElf.cmake new file mode 100644 index 000000000000..c1c1901d4dbc --- /dev/null +++ b/kcov-38/cmake/FindLibElf.cmake @@ -0,0 +1,68 @@ +# - Try to find libelf +# Once done this will define +# +# LIBELF_FOUND - system has libelf +# LIBELF_INCLUDE_DIRS - the libelf include directory +# LIBELF_LIBRARIES - Link these to use libelf +# LIBELF_DEFINITIONS - Compiler switches required for using libelf +# +# Copyright (c) 2008 Bernhard Walle +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +if (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS) + set (LibElf_FIND_QUIETLY ON) +endif (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS) + +find_package(PkgConfig QUIET) + +if(PKG_CONFIG_FOUND) + set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) + pkg_check_modules(PC_LIBELF QUIET libelf) +endif() + +find_path (LIBELF_INCLUDE_DIR + NAMES + libelf.h + HINTS + ${PC_LIBELF_INCLUDE_DIRS} + PATHS + /usr/include + /usr/include/libelf + /usr/local/include + /usr/local/include/libelf + /opt/local/include + /opt/local/include/libelf + /sw/include + /sw/include/libelf + ENV CPATH) + +find_library (LIBELF_LIBRARY + NAMES + elf + HINTS + ${PC_LIBELF_LIBRARY_DIRS} + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ENV LIBRARY_PATH + ENV LD_LIBRARY_PATH) + +include (FindPackageHandleStandardArgs) + + +# handle the QUIETLY and REQUIRED arguments and set LIBELF_FOUND to TRUE if all listed variables are TRUE +find_package_handle_standard_args(LibElf DEFAULT_MSG + LIBELF_LIBRARY + LIBELF_INCLUDE_DIR) + + +mark_as_advanced(LIBELF_INCLUDE_DIR LIBELF_LIBRARY) + +set(LIBELF_LIBRARIES ${LIBELF_LIBRARY} ) +set(LIBELF_INCLUDE_DIRS ${LIBELF_INCLUDE_DIR} ) diff --git a/kcov-38/cmake/TargetArch.cmake b/kcov-38/cmake/TargetArch.cmake new file mode 100644 index 000000000000..46e17557be33 --- /dev/null +++ b/kcov-38/cmake/TargetArch.cmake @@ -0,0 +1,134 @@ +# Based on the Qt 5 processor detection code, so should be very accurate +# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h +# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64) + +# Regarding POWER/PowerPC, just as is noted in the Qt source, +# "There are many more known variants/revisions that we do not handle/detect." + +set(archdetect_c_code " +#if defined(__arm__) || defined(__TARGET_ARCH_ARM) + #if defined(__ARM_ARCH_7__) \\ + || defined(__ARM_ARCH_7A__) \\ + || defined(__ARM_ARCH_7R__) \\ + || defined(__ARM_ARCH_7M__) \\ + || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) + #error cmake_ARCH armv7 + #elif defined(__ARM_ARCH_6__) \\ + || defined(__ARM_ARCH_6J__) \\ + || defined(__ARM_ARCH_6T2__) \\ + || defined(__ARM_ARCH_6Z__) \\ + || defined(__ARM_ARCH_6K__) \\ + || defined(__ARM_ARCH_6ZK__) \\ + || defined(__ARM_ARCH_6M__) \\ + || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) + #error cmake_ARCH armv6 + #elif defined(__ARM_ARCH_5TEJ__) \\ + || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) + #error cmake_ARCH armv5 + #else + #error cmake_ARCH arm + #endif +#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) + #error cmake_ARCH i386 +#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) + #error cmake_ARCH x86_64 +#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) + #error cmake_ARCH ia64 +#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\ + || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\ + || defined(_M_MPPC) || defined(_M_PPC) + #if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__) + #error cmake_ARCH ppc64 + #else + #error cmake_ARCH ppc + #endif +#endif + +#error cmake_ARCH unknown +") + +# Set ppc_support to TRUE before including this file or ppc and ppc64 +# will be treated as invalid architectures since they are no longer supported by Apple + +function(target_architecture output_var) + if(APPLE AND CMAKE_OSX_ARCHITECTURES) + # On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set + # First let's normalize the order of the values + + # Note that it's not possible to compile PowerPC applications if you are using + # the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we + # disable it by default + # See this page for more information: + # http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 + + # Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime. + # On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise. + + foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES}) + if("${osx_arch}" STREQUAL "ppc" AND ppc_support) + set(osx_arch_ppc ON) + elseif("${osx_arch}" STREQUAL "i386") + set(osx_arch_i386 ON) + elseif("${osx_arch}" STREQUAL "x86_64") + set(osx_arch_x86_64 ON) + elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support) + set(osx_arch_ppc64 ON) + else() + message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") + endif() + endforeach() + + # Now add all the architectures in our normalized order + if(osx_arch_ppc) + list(APPEND ARCH ppc) + endif() + + if(osx_arch_i386) + list(APPEND ARCH i386) + endif() + + if(osx_arch_x86_64) + list(APPEND ARCH x86_64) + endif() + + if(osx_arch_ppc64) + list(APPEND ARCH ppc64) + endif() + else() + file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") + + enable_language(C) + + # Detect the architecture in a rather creative way... + # This compiles a small C program which is a series of ifdefs that selects a + # particular #error preprocessor directive whose message string contains the + # target architecture. The program will always fail to compile (both because + # file is not a valid C program, and obviously because of the presence of the + # #error preprocessor directives... but by exploiting the preprocessor in this + # way, we can detect the correct target architecture even when cross-compiling, + # since the program itself never needs to be run (only the compiler/preprocessor) + try_run( + run_result_unused + compile_result_unused + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}/arch.c" + COMPILE_OUTPUT_VARIABLE ARCH + CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} + ) + + # Parse the architecture name from the compiler output + string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") + + # Get rid of the value marker leaving just the architecture name + string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") + + # If we are compiling with an unknown architecture this variable should + # already be set to "unknown" but in the case that it's empty (i.e. due + # to a typo in the code), then set it to unknown + if (NOT ARCH) + set(ARCH unknown) + endif() + endif() + + set(${output_var} "${ARCH}" PARENT_SCOPE) +endfunction() diff --git a/kcov-38/data/amber.png b/kcov-38/data/amber.png new file mode 100644 index 0000000000000000000000000000000000000000..2cab170d8359081983a4e343848dfe06bc490f12 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^G2tW}LqE04T&+ z;1OBOz`!j8!i<;h*8KqrvZOouIx;Y9?C1WI$O`1M1^9%x{(levWG!lvI6;R0X`wF z|Ns97GD8ntt^-nxB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gf+eGhVt|_XjA* zUgGKN%6^Gmn4d%Ph(nkFP>9RZ#WAE}PI3Z}&BVayv3^M*kj3EX>gTe~DWM4f=_Dpv literal 0 HcmV?d00001 diff --git a/kcov-38/data/index.html b/kcov-38/data/index.html new file mode 100644 index 000000000000..9611abb0ad7a --- /dev/null +++ b/kcov-38/data/index.html @@ -0,0 +1,97 @@ + + + + ??? + + + + + + + + + + + + + + + + + + + + + +
Coverage Report
+ + + + + + + + + + + + + + + + + + + +
Command:???
Date: Instrumented lines:???
Code covered:???Executed lines:???
+
+ + + +
+ +
+ + + +
Generated by: Kcov
+ + diff --git a/kcov-38/data/js/handlebars.js b/kcov-38/data/js/handlebars.js new file mode 100644 index 000000000000..1f7d2654a724 --- /dev/null +++ b/kcov-38/data/js/handlebars.js @@ -0,0 +1,3079 @@ +/*! + + handlebars v2.0.0 + +Copyright (C) 2011-2014 by Yehuda Katz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +@license +*/ +/* exported Handlebars */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + define([], factory); + } else if (typeof exports === 'object') { + module.exports = factory(); + } else { + root.Handlebars = root.Handlebars || factory(); + } +}(this, function () { +// handlebars/safe-string.js +var __module4__ = (function() { + "use strict"; + var __exports__; + // Build out our basic SafeString type + function SafeString(string) { + this.string = string; + } + + SafeString.prototype.toString = function() { + return "" + this.string; + }; + + __exports__ = SafeString; + return __exports__; +})(); + +// handlebars/utils.js +var __module3__ = (function(__dependency1__) { + "use strict"; + var __exports__ = {}; + /*jshint -W004 */ + var SafeString = __dependency1__; + + var escape = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'", + "`": "`" + }; + + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + function escapeChar(chr) { + return escape[chr]; + } + + function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } + } + } + + return obj; + } + + __exports__.extend = extend;var toString = Object.prototype.toString; + __exports__.toString = toString; + // Sourced from lodash + // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt + var isFunction = function(value) { + return typeof value === 'function'; + }; + // fallback for older versions of Chrome and Safari + /* istanbul ignore next */ + if (isFunction(/x/)) { + isFunction = function(value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; + } + var isFunction; + __exports__.isFunction = isFunction; + /* istanbul ignore next */ + var isArray = Array.isArray || function(value) { + return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; + }; + __exports__.isArray = isArray; + + function escapeExpression(string) { + // don't escape SafeStrings, since they're already safe + if (string instanceof SafeString) { + return string.toString(); + } else if (string == null) { + return ""; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = "" + string; + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); + } + + __exports__.escapeExpression = escapeExpression;function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; + } else { + return false; + } + } + + __exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; + } + + __exports__.appendContextPath = appendContextPath; + return __exports__; +})(__module4__); + +// handlebars/exception.js +var __module5__ = (function() { + "use strict"; + var __exports__; + + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + + function Exception(message, node) { + var line; + if (node && node.firstLine) { + line = node.firstLine; + + message += ' - ' + line + ':' + node.firstColumn; + } + + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } + + if (line) { + this.lineNumber = line; + this.column = node.firstColumn; + } + } + + Exception.prototype = new Error(); + + __exports__ = Exception; + return __exports__; +})(); + +// handlebars/base.js +var __module2__ = (function(__dependency1__, __dependency2__) { + "use strict"; + var __exports__ = {}; + var Utils = __dependency1__; + var Exception = __dependency2__; + + var VERSION = "2.0.0"; + __exports__.VERSION = VERSION;var COMPILER_REVISION = 6; + __exports__.COMPILER_REVISION = COMPILER_REVISION; + var REVISION_CHANGES = { + 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it + 2: '== 1.0.0-rc.3', + 3: '== 1.0.0-rc.4', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' + }; + __exports__.REVISION_CHANGES = REVISION_CHANGES; + var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; + + function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); + } + + __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { throw new Exception('Arg not supported with multiple helpers'); } + Utils.extend(this.helpers, name); + } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function(name) { + delete this.helpers[name]; + }, + + registerPartial: function(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + this.partials[name] = partial; + } + }, + unregisterPartial: function(name) { + delete this.partials[name]; + } + }; + + function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function(/* [args, ]options */) { + if(arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'"); + } + }); + + instance.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse, + fn = options.fn; + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if (isArray(context)) { + if(context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } + + return instance.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = {data: data}; + } + + return fn(context, options); + } + }); + + instance.registerHelper('each', function(context, options) { + if (!options) { + throw new Exception('Must pass iterator to #each'); + } + + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + var contextPath; + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { context = context.call(this); } + + if (options.data) { + data = createFrame(options.data); + } + + if(context && typeof context === 'object') { + if (isArray(context)) { + for(var j = context.length; i 0) { + throw new Exception("Invalid path: " + original, this); + } else if (part === "..") { + depth++; + depthString += '../'; + } else { + this.isScoped = true; + } + } else { + dig.push(part); + } + } + + this.original = original; + this.parts = dig; + this.string = dig.join('.'); + this.depth = depth; + this.idName = depthString + this.string; + + // an ID is simple if it only has one part, and that part is not + // `..` or `this`. + this.isSimple = parts.length === 1 && !this.isScoped && depth === 0; + + this.stringModeValue = this.string; + }, + + PartialNameNode: function(name, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "PARTIAL_NAME"; + this.name = name.original; + }, + + DataNode: function(id, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "DATA"; + this.id = id; + this.stringModeValue = id.stringModeValue; + this.idName = '@' + id.stringModeValue; + }, + + StringNode: function(string, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "STRING"; + this.original = + this.string = + this.stringModeValue = string; + }, + + NumberNode: function(number, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "NUMBER"; + this.original = + this.number = number; + this.stringModeValue = Number(number); + }, + + BooleanNode: function(bool, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "BOOLEAN"; + this.bool = bool; + this.stringModeValue = bool === "true"; + }, + + CommentNode: function(comment, locInfo) { + LocationInfo.call(this, locInfo); + this.type = "comment"; + this.comment = comment; + + this.strip = { + inlineStandalone: true + }; + } + }; + + + // Must be exported as an object rather than the root of the module as the jison lexer + // most modify the object to operate properly. + __exports__ = AST; + return __exports__; +})(__module5__); + +// handlebars/compiler/parser.js +var __module9__ = (function() { + "use strict"; + var __exports__; + /* jshint ignore:start */ + /* istanbul ignore next */ + /* Jison generated parser */ + var handlebars = (function(){ + var parser = {trace: function trace() { }, + yy: {}, + symbols_: {"error":2,"root":3,"program":4,"EOF":5,"program_repetition0":6,"statement":7,"mustache":8,"block":9,"rawBlock":10,"partial":11,"CONTENT":12,"COMMENT":13,"openRawBlock":14,"END_RAW_BLOCK":15,"OPEN_RAW_BLOCK":16,"sexpr":17,"CLOSE_RAW_BLOCK":18,"openBlock":19,"block_option0":20,"closeBlock":21,"openInverse":22,"block_option1":23,"OPEN_BLOCK":24,"CLOSE":25,"OPEN_INVERSE":26,"inverseAndProgram":27,"INVERSE":28,"OPEN_ENDBLOCK":29,"path":30,"OPEN":31,"OPEN_UNESCAPED":32,"CLOSE_UNESCAPED":33,"OPEN_PARTIAL":34,"partialName":35,"param":36,"partial_option0":37,"partial_option1":38,"sexpr_repetition0":39,"sexpr_option0":40,"dataName":41,"STRING":42,"NUMBER":43,"BOOLEAN":44,"OPEN_SEXPR":45,"CLOSE_SEXPR":46,"hash":47,"hash_repetition_plus0":48,"hashSegment":49,"ID":50,"EQUALS":51,"DATA":52,"pathSegments":53,"SEP":54,"$accept":0,"$end":1}, + terminals_: {2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"}, + productions_: [0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]], + performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { + + var $0 = $$.length - 1; + switch (yystate) { + case 1: yy.prepareProgram($$[$0-1].statements, true); return $$[$0-1]; + break; + case 2:this.$ = new yy.ProgramNode(yy.prepareProgram($$[$0]), {}, this._$); + break; + case 3:this.$ = $$[$0]; + break; + case 4:this.$ = $$[$0]; + break; + case 5:this.$ = $$[$0]; + break; + case 6:this.$ = $$[$0]; + break; + case 7:this.$ = new yy.ContentNode($$[$0], this._$); + break; + case 8:this.$ = new yy.CommentNode($$[$0], this._$); + break; + case 9:this.$ = new yy.RawBlockNode($$[$0-2], $$[$0-1], $$[$0], this._$); + break; + case 10:this.$ = new yy.MustacheNode($$[$0-1], null, '', '', this._$); + break; + case 11:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], false, this._$); + break; + case 12:this.$ = yy.prepareBlock($$[$0-3], $$[$0-2], $$[$0-1], $$[$0], true, this._$); + break; + case 13:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 14:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 15:this.$ = { strip: yy.stripFlags($$[$0-1], $$[$0-1]), program: $$[$0] }; + break; + case 16:this.$ = {path: $$[$0-1], strip: yy.stripFlags($$[$0-2], $$[$0])}; + break; + case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], yy.stripFlags($$[$0-2], $$[$0]), this._$); + break; + case 19:this.$ = new yy.PartialNode($$[$0-3], $$[$0-2], $$[$0-1], yy.stripFlags($$[$0-4], $$[$0]), this._$); + break; + case 20:this.$ = new yy.PartialNode($$[$0-2], undefined, $$[$0-1], yy.stripFlags($$[$0-3], $$[$0]), this._$); + break; + case 21:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$); + break; + case 22:this.$ = new yy.SexprNode([$$[$0]], null, this._$); + break; + case 23:this.$ = $$[$0]; + break; + case 24:this.$ = new yy.StringNode($$[$0], this._$); + break; + case 25:this.$ = new yy.NumberNode($$[$0], this._$); + break; + case 26:this.$ = new yy.BooleanNode($$[$0], this._$); + break; + case 27:this.$ = $$[$0]; + break; + case 28:$$[$0-1].isHelper = true; this.$ = $$[$0-1]; + break; + case 29:this.$ = new yy.HashNode($$[$0], this._$); + break; + case 30:this.$ = [$$[$0-2], $$[$0]]; + break; + case 31:this.$ = new yy.PartialNameNode($$[$0], this._$); + break; + case 32:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$); + break; + case 33:this.$ = new yy.PartialNameNode(new yy.NumberNode($$[$0], this._$)); + break; + case 34:this.$ = new yy.DataNode($$[$0], this._$); + break; + case 35:this.$ = new yy.IdNode($$[$0], this._$); + break; + case 36: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2]; + break; + case 37:this.$ = [{part: $$[$0]}]; + break; + case 38:this.$ = []; + break; + case 39:$$[$0-1].push($$[$0]); + break; + case 48:this.$ = []; + break; + case 49:$$[$0-1].push($$[$0]); + break; + case 52:this.$ = [$$[$0]]; + break; + case 53:$$[$0-1].push($$[$0]); + break; + } + }, + table: [{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}], + defaultActions: {4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]}, + parseError: function parseError(str, hash) { + throw new Error(str); + }, + parse: function parse(input) { + var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + this.lexer.setInput(input); + this.lexer.yy = this.yy; + this.yy.lexer = this.lexer; + this.yy.parser = this; + if (typeof this.lexer.yylloc == "undefined") + this.lexer.yylloc = {}; + var yyloc = this.lexer.yylloc; + lstack.push(yyloc); + var ranges = this.lexer.options && this.lexer.options.ranges; + if (typeof this.yy.parseError === "function") + this.parseError = this.yy.parseError; + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = self.lexer.lex() || 1; + if (typeof token !== "number") { + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == "undefined") { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === "undefined" || !action.length || !action[0]) { + var errStr = ""; + if (!recovering) { + expected = []; + for (p in table[state]) + if (this.terminals_[p] && p > 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; + } + }; + /* Jison generated lexer */ + var lexer = (function(){ + var lexer = ({EOF:1, + parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, + input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; + + this._input = this._input.slice(1); + return ch; + }, + unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); + + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; + + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, + more:function () { + this._more = true; + return this; + }, + less:function (n) { + this.unput(this.match.slice(n)); + }, + pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, + showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, + next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; + + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; + } + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, + lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, + begin:function begin(condition) { + this.conditionStack.push(condition); + }, + popState:function popState() { + return this.conditionStack.pop(); + }, + _currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, + topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, + pushState:function begin(condition) { + this.begin(condition); + }}); + lexer.options = {}; + lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + + + function strip(start, end) { + return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end); + } + + + var YYSTATE=YY_START + switch($avoiding_name_collisions) { + case 0: + if(yy_.yytext.slice(-2) === "\\\\") { + strip(0,1); + this.begin("mu"); + } else if(yy_.yytext.slice(-1) === "\\") { + strip(0,1); + this.begin("emu"); + } else { + this.begin("mu"); + } + if(yy_.yytext) return 12; + + break; + case 1:return 12; + break; + case 2: + this.popState(); + return 12; + + break; + case 3: + yy_.yytext = yy_.yytext.substr(5, yy_.yyleng-9); + this.popState(); + return 15; + + break; + case 4: return 12; + break; + case 5:strip(0,4); this.popState(); return 13; + break; + case 6:return 45; + break; + case 7:return 46; + break; + case 8: return 16; + break; + case 9: + this.popState(); + this.begin('raw'); + return 18; + + break; + case 10:return 34; + break; + case 11:return 24; + break; + case 12:return 29; + break; + case 13:this.popState(); return 28; + break; + case 14:this.popState(); return 28; + break; + case 15:return 26; + break; + case 16:return 26; + break; + case 17:return 32; + break; + case 18:return 31; + break; + case 19:this.popState(); this.begin('com'); + break; + case 20:strip(3,5); this.popState(); return 13; + break; + case 21:return 31; + break; + case 22:return 51; + break; + case 23:return 50; + break; + case 24:return 50; + break; + case 25:return 54; + break; + case 26:// ignore whitespace + break; + case 27:this.popState(); return 33; + break; + case 28:this.popState(); return 25; + break; + case 29:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 42; + break; + case 30:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 42; + break; + case 31:return 52; + break; + case 32:return 44; + break; + case 33:return 44; + break; + case 34:return 43; + break; + case 35:return 50; + break; + case 36:yy_.yytext = strip(1,2); return 50; + break; + case 37:return 'INVALID'; + break; + case 38:return 5; + break; + } + }; + lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/]; + lexer.conditions = {"mu":{"rules":[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[5],"inclusive":false},"raw":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,1,38],"inclusive":true}}; + return lexer;})() + parser.lexer = lexer; + function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; + return new Parser; + })();__exports__ = handlebars; + /* jshint ignore:end */ + return __exports__; +})(); + +// handlebars/compiler/helpers.js +var __module10__ = (function(__dependency1__) { + "use strict"; + var __exports__ = {}; + var Exception = __dependency1__; + + function stripFlags(open, close) { + return { + left: open.charAt(2) === '~', + right: close.charAt(close.length-3) === '~' + }; + } + + __exports__.stripFlags = stripFlags; + function prepareBlock(mustache, program, inverseAndProgram, close, inverted, locInfo) { + /*jshint -W040 */ + if (mustache.sexpr.id.original !== close.path.original) { + throw new Exception(mustache.sexpr.id.original + ' doesn\'t match ' + close.path.original, mustache); + } + + var inverse = inverseAndProgram && inverseAndProgram.program; + + var strip = { + left: mustache.strip.left, + right: close.strip.right, + + // Determine the standalone candiacy. Basically flag our content as being possibly standalone + // so our parent can determine if we actually are standalone + openStandalone: isNextWhitespace(program.statements), + closeStandalone: isPrevWhitespace((inverse || program).statements) + }; + + if (mustache.strip.right) { + omitRight(program.statements, null, true); + } + + if (inverse) { + var inverseStrip = inverseAndProgram.strip; + + if (inverseStrip.left) { + omitLeft(program.statements, null, true); + } + if (inverseStrip.right) { + omitRight(inverse.statements, null, true); + } + if (close.strip.left) { + omitLeft(inverse.statements, null, true); + } + + // Find standalone else statments + if (isPrevWhitespace(program.statements) + && isNextWhitespace(inverse.statements)) { + + omitLeft(program.statements); + omitRight(inverse.statements); + } + } else { + if (close.strip.left) { + omitLeft(program.statements, null, true); + } + } + + if (inverted) { + return new this.BlockNode(mustache, inverse, program, strip, locInfo); + } else { + return new this.BlockNode(mustache, program, inverse, strip, locInfo); + } + } + + __exports__.prepareBlock = prepareBlock; + function prepareProgram(statements, isRoot) { + for (var i = 0, l = statements.length; i < l; i++) { + var current = statements[i], + strip = current.strip; + + if (!strip) { + continue; + } + + var _isPrevWhitespace = isPrevWhitespace(statements, i, isRoot, current.type === 'partial'), + _isNextWhitespace = isNextWhitespace(statements, i, isRoot), + + openStandalone = strip.openStandalone && _isPrevWhitespace, + closeStandalone = strip.closeStandalone && _isNextWhitespace, + inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; + + if (strip.right) { + omitRight(statements, i, true); + } + if (strip.left) { + omitLeft(statements, i, true); + } + + if (inlineStandalone) { + omitRight(statements, i); + + if (omitLeft(statements, i)) { + // If we are on a standalone node, save the indent info for partials + if (current.type === 'partial') { + current.indent = (/([ \t]+$)/).exec(statements[i-1].original) ? RegExp.$1 : ''; + } + } + } + if (openStandalone) { + omitRight((current.program || current.inverse).statements); + + // Strip out the previous content node if it's whitespace only + omitLeft(statements, i); + } + if (closeStandalone) { + // Always strip the next node + omitRight(statements, i); + + omitLeft((current.inverse || current.program).statements); + } + } + + return statements; + } + + __exports__.prepareProgram = prepareProgram;function isPrevWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = statements.length; + } + + // Nodes that end with newlines are considered whitespace (but are special + // cased for strip operations) + var prev = statements[i-1], + sibling = statements[i-2]; + if (!prev) { + return isRoot; + } + + if (prev.type === 'content') { + return (sibling || !isRoot ? (/\r?\n\s*?$/) : (/(^|\r?\n)\s*?$/)).test(prev.original); + } + } + function isNextWhitespace(statements, i, isRoot) { + if (i === undefined) { + i = -1; + } + + var next = statements[i+1], + sibling = statements[i+2]; + if (!next) { + return isRoot; + } + + if (next.type === 'content') { + return (sibling || !isRoot ? (/^\s*?\r?\n/) : (/^\s*?(\r?\n|$)/)).test(next.original); + } + } + + // Marks the node to the right of the position as omitted. + // I.e. {{foo}}' ' will mark the ' ' node as omitted. + // + // If i is undefined, then the first child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitRight(statements, i, multiple) { + var current = statements[i == null ? 0 : i + 1]; + if (!current || current.type !== 'content' || (!multiple && current.rightStripped)) { + return; + } + + var original = current.string; + current.string = current.string.replace(multiple ? (/^\s+/) : (/^[ \t]*\r?\n?/), ''); + current.rightStripped = current.string !== original; + } + + // Marks the node to the left of the position as omitted. + // I.e. ' '{{foo}} will mark the ' ' node as omitted. + // + // If i is undefined then the last child will be marked as such. + // + // If mulitple is truthy then all whitespace will be stripped out until non-whitespace + // content is met. + function omitLeft(statements, i, multiple) { + var current = statements[i == null ? statements.length - 1 : i - 1]; + if (!current || current.type !== 'content' || (!multiple && current.leftStripped)) { + return; + } + + // We omit the last node if it's whitespace only and not preceded by a non-content node. + var original = current.string; + current.string = current.string.replace(multiple ? (/\s+$/) : (/[ \t]+$/), ''); + current.leftStripped = current.string !== original; + return current.leftStripped; + } + return __exports__; +})(__module5__); + +// handlebars/compiler/base.js +var __module8__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__) { + "use strict"; + var __exports__ = {}; + var parser = __dependency1__; + var AST = __dependency2__; + var Helpers = __dependency3__; + var extend = __dependency4__.extend; + + __exports__.parser = parser; + + var yy = {}; + extend(yy, Helpers, AST); + + function parse(input) { + // Just return if an already-compile AST was passed in. + if (input.constructor === AST.ProgramNode) { return input; } + + parser.yy = yy; + + return parser.parse(input); + } + + __exports__.parse = parse; + return __exports__; +})(__module9__, __module7__, __module10__, __module3__); + +// handlebars/compiler/compiler.js +var __module11__ = (function(__dependency1__, __dependency2__) { + "use strict"; + var __exports__ = {}; + var Exception = __dependency1__; + var isArray = __dependency2__.isArray; + + var slice = [].slice; + + function Compiler() {} + + __exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. + + Compiler.prototype = { + compiler: Compiler, + + equals: function(other) { + var len = this.opcodes.length; + if (other.opcodes.length !== len) { + return false; + } + + for (var i = 0; i < len; i++) { + var opcode = this.opcodes[i], + otherOpcode = other.opcodes[i]; + if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { + return false; + } + } + + // We know that length is the same between the two arrays because they are directly tied + // to the opcode behavior above. + len = this.children.length; + for (i = 0; i < len; i++) { + if (!this.children[i].equals(other.children[i])) { + return false; + } + } + + return true; + }, + + guid: 0, + + compile: function(program, options) { + this.opcodes = []; + this.children = []; + this.depths = {list: []}; + this.options = options; + this.stringParams = options.stringParams; + this.trackIds = options.trackIds; + + // These changes will propagate to the other compiler components + var knownHelpers = this.options.knownHelpers; + this.options.knownHelpers = { + 'helperMissing': true, + 'blockHelperMissing': true, + 'each': true, + 'if': true, + 'unless': true, + 'with': true, + 'log': true, + 'lookup': true + }; + if (knownHelpers) { + for (var name in knownHelpers) { + this.options.knownHelpers[name] = knownHelpers[name]; + } + } + + return this.accept(program); + }, + + accept: function(node) { + return this[node.type](node); + }, + + program: function(program) { + var statements = program.statements; + + for(var i=0, l=statements.length; i 0) { + varDeclarations += ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + for (var alias in this.aliases) { + if (this.aliases.hasOwnProperty(alias)) { + varDeclarations += ', ' + alias + '=' + this.aliases[alias]; + } + } + + var params = ["depth0", "helpers", "partials", "data"]; + + if (this.useDepths) { + params.push('depths'); + } + + // Perform a second pass over the output to merge content when possible + var source = this.mergeSource(varDeclarations); + + if (asObject) { + params.push(source); + + return Function.apply(this, params); + } else { + return 'function(' + params.join(',') + ') {\n ' + source + '}'; + } + }, + mergeSource: function(varDeclarations) { + var source = '', + buffer, + appendOnly = !this.forceBuffer, + appendFirst; + + for (var i = 0, len = this.source.length; i < len; i++) { + var line = this.source[i]; + if (line.appendToBuffer) { + if (buffer) { + buffer = buffer + '\n + ' + line.content; + } else { + buffer = line.content; + } + } else { + if (buffer) { + if (!source) { + appendFirst = true; + source = buffer + ';\n '; + } else { + source += 'buffer += ' + buffer + ';\n '; + } + buffer = undefined; + } + source += line + '\n '; + + if (!this.environment.isSimple) { + appendOnly = false; + } + } + } + + if (appendOnly) { + if (buffer || !source) { + source += 'return ' + (buffer || '""') + ';\n'; + } + } else { + varDeclarations += ", buffer = " + (appendFirst ? '' : this.initializeBuffer()); + if (buffer) { + source += 'return buffer + ' + buffer + ';\n'; + } else { + source += 'return buffer;\n'; + } + } + + if (varDeclarations) { + source = 'var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n ') + source; + } + + return source; + }, + + // [blockValue] + // + // On stack, before: hash, inverse, program, value + // On stack, after: return value of blockHelperMissing + // + // The purpose of this opcode is to take a block of the form + // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and + // replace it on the stack with the result of properly + // invoking blockHelperMissing. + blockValue: function(name) { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + + var params = [this.contextName(0)]; + this.setupParams(name, 0, params); + + var blockName = this.popStack(); + params.splice(1, 0, blockName); + + this.push('blockHelperMissing.call(' + params.join(', ') + ')'); + }, + + // [ambiguousBlockValue] + // + // On stack, before: hash, inverse, program, value + // Compiler value, before: lastHelper=value of last found helper, if any + // On stack, after, if no lastHelper: same as [blockValue] + // On stack, after, if lastHelper: value + ambiguousBlockValue: function() { + this.aliases.blockHelperMissing = 'helpers.blockHelperMissing'; + + // We're being a bit cheeky and reusing the options value from the prior exec + var params = [this.contextName(0)]; + this.setupParams('', 0, params, true); + + this.flushInline(); + + var current = this.topStack(); + params.splice(1, 0, current); + + this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }"); + }, + + // [appendContent] + // + // On stack, before: ... + // On stack, after: ... + // + // Appends the string value of `content` to the current buffer + appendContent: function(content) { + if (this.pendingContent) { + content = this.pendingContent + content; + } + + this.pendingContent = content; + }, + + // [append] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Coerces `value` to a String and appends it to the current buffer. + // + // If `value` is truthy, or 0, it is coerced into a string and appended + // Otherwise, the empty string is appended + append: function() { + // Force anything that is inlined onto the stack so we don't have duplication + // when we examine local + this.flushInline(); + var local = this.popStack(); + this.pushSource('if (' + local + ' != null) { ' + this.appendToBuffer(local) + ' }'); + if (this.environment.isSimple) { + this.pushSource("else { " + this.appendToBuffer("''") + " }"); + } + }, + + // [appendEscaped] + // + // On stack, before: value, ... + // On stack, after: ... + // + // Escape `value` and append it to the buffer + appendEscaped: function() { + this.aliases.escapeExpression = 'this.escapeExpression'; + + this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")")); + }, + + // [getContext] + // + // On stack, before: ... + // On stack, after: ... + // Compiler value, after: lastContext=depth + // + // Set the value of the `lastContext` compiler value to the depth + getContext: function(depth) { + this.lastContext = depth; + }, + + // [pushContext] + // + // On stack, before: ... + // On stack, after: currentContext, ... + // + // Pushes the value of the current context onto the stack. + pushContext: function() { + this.pushStackLiteral(this.contextName(this.lastContext)); + }, + + // [lookupOnContext] + // + // On stack, before: ... + // On stack, after: currentContext[name], ... + // + // Looks up the value of `name` on the current context and pushes + // it onto the stack. + lookupOnContext: function(parts, falsy, scoped) { + /*jshint -W083 */ + var i = 0, + len = parts.length; + + if (!scoped && this.options.compat && !this.lastContext) { + // The depthed query is expected to handle the undefined logic for the root level that + // is implemented below, so we evaluate that directly in compat mode + this.push(this.depthedLookup(parts[i++])); + } else { + this.pushContext(); + } + + for (; i < len; i++) { + this.replaceStack(function(current) { + var lookup = this.nameLookup(current, parts[i], 'context'); + // We want to ensure that zero and false are handled properly if the context (falsy flag) + // needs to have the special handling for these values. + if (!falsy) { + return ' != null ? ' + lookup + ' : ' + current; + } else { + // Otherwise we can use generic falsy handling + return ' && ' + lookup; + } + }); + } + }, + + // [lookupData] + // + // On stack, before: ... + // On stack, after: data, ... + // + // Push the data lookup operator + lookupData: function(depth, parts) { + /*jshint -W083 */ + if (!depth) { + this.pushStackLiteral('data'); + } else { + this.pushStackLiteral('this.data(data, ' + depth + ')'); + } + + var len = parts.length; + for (var i = 0; i < len; i++) { + this.replaceStack(function(current) { + return ' && ' + this.nameLookup(current, parts[i], 'data'); + }); + } + }, + + // [resolvePossibleLambda] + // + // On stack, before: value, ... + // On stack, after: resolved value, ... + // + // If the `value` is a lambda, replace it on the stack by + // the return value of the lambda + resolvePossibleLambda: function() { + this.aliases.lambda = 'this.lambda'; + + this.push('lambda(' + this.popStack() + ', ' + this.contextName(0) + ')'); + }, + + // [pushStringParam] + // + // On stack, before: ... + // On stack, after: string, currentContext, ... + // + // This opcode is designed for use in string mode, which + // provides the string value of a parameter along with its + // depth rather than resolving it immediately. + pushStringParam: function(string, type) { + this.pushContext(); + this.pushString(type); + + // If it's a subexpression, the string result + // will be pushed after this opcode. + if (type !== 'sexpr') { + if (typeof string === 'string') { + this.pushString(string); + } else { + this.pushStackLiteral(string); + } + } + }, + + emptyHash: function() { + this.pushStackLiteral('{}'); + + if (this.trackIds) { + this.push('{}'); // hashIds + } + if (this.stringParams) { + this.push('{}'); // hashContexts + this.push('{}'); // hashTypes + } + }, + pushHash: function() { + if (this.hash) { + this.hashes.push(this.hash); + } + this.hash = {values: [], types: [], contexts: [], ids: []}; + }, + popHash: function() { + var hash = this.hash; + this.hash = this.hashes.pop(); + + if (this.trackIds) { + this.push('{' + hash.ids.join(',') + '}'); + } + if (this.stringParams) { + this.push('{' + hash.contexts.join(',') + '}'); + this.push('{' + hash.types.join(',') + '}'); + } + + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); + }, + + // [pushString] + // + // On stack, before: ... + // On stack, after: quotedString(string), ... + // + // Push a quoted version of `string` onto the stack + pushString: function(string) { + this.pushStackLiteral(this.quotedString(string)); + }, + + // [push] + // + // On stack, before: ... + // On stack, after: expr, ... + // + // Push an expression onto the stack + push: function(expr) { + this.inlineStack.push(expr); + return expr; + }, + + // [pushLiteral] + // + // On stack, before: ... + // On stack, after: value, ... + // + // Pushes a value onto the stack. This operation prevents + // the compiler from creating a temporary variable to hold + // it. + pushLiteral: function(value) { + this.pushStackLiteral(value); + }, + + // [pushProgram] + // + // On stack, before: ... + // On stack, after: program(guid), ... + // + // Push a program expression onto the stack. This takes + // a compile-time guid and converts it into a runtime-accessible + // expression. + pushProgram: function(guid) { + if (guid != null) { + this.pushStackLiteral(this.programExpression(guid)); + } else { + this.pushStackLiteral(null); + } + }, + + // [invokeHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // Pops off the helper's parameters, invokes the helper, + // and pushes the helper's return value onto the stack. + // + // If the helper is not found, `helperMissing` is called. + invokeHelper: function(paramSize, name, isSimple) { + this.aliases.helperMissing = 'helpers.helperMissing'; + + var nonHelper = this.popStack(); + var helper = this.setupHelper(paramSize, name); + + var lookup = (isSimple ? helper.name + ' || ' : '') + nonHelper + ' || helperMissing'; + this.push('((' + lookup + ').call(' + helper.callParams + '))'); + }, + + // [invokeKnownHelper] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of helper invocation + // + // This operation is used when the helper is known to exist, + // so a `helperMissing` fallback is not required. + invokeKnownHelper: function(paramSize, name) { + var helper = this.setupHelper(paramSize, name); + this.push(helper.name + ".call(" + helper.callParams + ")"); + }, + + // [invokeAmbiguous] + // + // On stack, before: hash, inverse, program, params..., ... + // On stack, after: result of disambiguation + // + // This operation is used when an expression like `{{foo}}` + // is provided, but we don't know at compile-time whether it + // is a helper or a path. + // + // This operation emits more code than the other options, + // and can be avoided by passing the `knownHelpers` and + // `knownHelpersOnly` flags at compile-time. + invokeAmbiguous: function(name, helperCall) { + this.aliases.functionType = '"function"'; + this.aliases.helperMissing = 'helpers.helperMissing'; + this.useRegister('helper'); + + var nonHelper = this.popStack(); + + this.emptyHash(); + var helper = this.setupHelper(0, name, helperCall); + + var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); + + this.push( + '((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing' + + (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),' + + '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))'); + }, + + // [invokePartial] + // + // On stack, before: context, ... + // On stack after: result of partial invocation + // + // This operation pops off a context, invokes a partial with that context, + // and pushes the result of the invocation back. + invokePartial: function(name, indent) { + var params = [this.nameLookup('partials', name, 'partial'), "'" + indent + "'", "'" + name + "'", this.popStack(), this.popStack(), "helpers", "partials"]; + + if (this.options.data) { + params.push("data"); + } else if (this.options.compat) { + params.push('undefined'); + } + if (this.options.compat) { + params.push('depths'); + } + + this.push("this.invokePartial(" + params.join(", ") + ")"); + }, + + // [assignToHash] + // + // On stack, before: value, ..., hash, ... + // On stack, after: ..., hash, ... + // + // Pops a value off the stack and assigns it to the current hash + assignToHash: function(key) { + var value = this.popStack(), + context, + type, + id; + + if (this.trackIds) { + id = this.popStack(); + } + if (this.stringParams) { + type = this.popStack(); + context = this.popStack(); + } + + var hash = this.hash; + if (context) { + hash.contexts.push("'" + key + "': " + context); + } + if (type) { + hash.types.push("'" + key + "': " + type); + } + if (id) { + hash.ids.push("'" + key + "': " + id); + } + hash.values.push("'" + key + "': (" + value + ")"); + }, + + pushId: function(type, name) { + if (type === 'ID' || type === 'DATA') { + this.pushString(name); + } else if (type === 'sexpr') { + this.pushStackLiteral('true'); + } else { + this.pushStackLiteral('null'); + } + }, + + // HELPERS + + compiler: JavaScriptCompiler, + + compileChildren: function(environment, options) { + var children = environment.children, child, compiler; + + for(var i=0, l=children.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return this.topStackName(); + }, + topStackName: function() { + return "stack" + this.stackSlot; + }, + flushInline: function() { + var inlineStack = this.inlineStack; + if (inlineStack.length) { + this.inlineStack = []; + for (var i = 0, len = inlineStack.length; i < len; i++) { + var entry = inlineStack[i]; + if (entry instanceof Literal) { + this.compileStack.push(entry); + } else { + this.pushStack(entry); + } + } + } + }, + isInline: function() { + return this.inlineStack.length; + }, + + popStack: function(wrapped) { + var inline = this.isInline(), + item = (inline ? this.inlineStack : this.compileStack).pop(); + + if (!wrapped && (item instanceof Literal)) { + return item.value; + } else { + if (!inline) { + /* istanbul ignore next */ + if (!this.stackSlot) { + throw new Exception('Invalid stack pop'); + } + this.stackSlot--; + } + return item; + } + }, + + topStack: function() { + var stack = (this.isInline() ? this.inlineStack : this.compileStack), + item = stack[stack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + contextName: function(context) { + if (this.useDepths && context) { + return 'depths[' + context + ']'; + } else { + return 'depth' + context; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 + .replace(/\u2029/g, '\\u2029') + '"'; + }, + + objectLiteral: function(obj) { + var pairs = []; + + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + pairs.push(this.quotedString(key) + ':' + obj[key]); + } + } + + return '{' + pairs.join(',') + '}'; + }, + + setupHelper: function(paramSize, name, blockHelper) { + var params = [], + paramsInit = this.setupParams(name, paramSize, params, blockHelper); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + paramsInit: paramsInit, + name: foundHelper, + callParams: [this.contextName(0)].concat(params).join(", ") + }; + }, + + setupOptions: function(helper, paramSize, params) { + var options = {}, contexts = [], types = [], ids = [], param, inverse, program; + + options.name = this.quotedString(helper); + options.hash = this.popStack(); + + if (this.trackIds) { + options.hashIds = this.popStack(); + } + if (this.stringParams) { + options.hashTypes = this.popStack(); + options.hashContexts = this.popStack(); + } + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + program = 'this.noop'; + } + + if (!inverse) { + inverse = 'this.noop'; + } + + options.fn = program; + options.inverse = inverse; + } + + // The parameters go on to the stack in order (making sure that they are evaluated in order) + // so we need to pop them off the stack in reverse order + var i = paramSize; + while (i--) { + param = this.popStack(); + params[i] = param; + + if (this.trackIds) { + ids[i] = this.popStack(); + } + if (this.stringParams) { + types[i] = this.popStack(); + contexts[i] = this.popStack(); + } + } + + if (this.trackIds) { + options.ids = "[" + ids.join(",") + "]"; + } + if (this.stringParams) { + options.types = "[" + types.join(",") + "]"; + options.contexts = "[" + contexts.join(",") + "]"; + } + + if (this.options.data) { + options.data = "data"; + } + + return options; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(helperName, paramSize, params, useRegister) { + var options = this.objectLiteral(this.setupOptions(helperName, paramSize, params)); + + if (useRegister) { + this.useRegister('options'); + params.push('options'); + return 'options=' + options; + } else { + params.push(options); + return ''; + } + } + }; + + var reservedWords = ( + "break else new var" + + " case finally return void" + + " catch for switch while" + + " continue function this with" + + " default if throw" + + " delete in try" + + " do instanceof typeof" + + " abstract enum int short" + + " boolean export interface static" + + " byte extends long super" + + " char final native synchronized" + + " class float package throws" + + " const goto private transient" + + " debugger implements protected volatile" + + " double import public let yield" + ).split(" "); + + var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; + + for(var i=0, l=reservedWords.length; ia?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("