Skip to content

Commit

Permalink
[metrics] Fix line count metric
Browse files Browse the repository at this point in the history
Also need to switch machines for release - lenny is machine1, with
bloaty.
  • Loading branch information
Andy C committed Mar 13, 2024
1 parent c265df5 commit cc2f683
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions devtools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ build-and-test() {
# App bundle
_release-build

# TODO: test oils-for-unix in Alpine chroot too.
# NOTE: Need test/alpine.sh download;extract;setup-dns,add-oil-build-deps,
# etc.
if test -n "$HAVE_ROOT"; then
Expand Down
22 changes: 21 additions & 1 deletion metrics/tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,29 @@ linecount-pydeps() {
}

_oils-cpp() {
find _tmp/native-tar-test -name '*.cc' -o -name '*.h'
# The CI runs devtools/release-native.sh test-tar
find . \( -name '*.cc' -o -name '*.h' \) -a -printf '%P\n'
}

linecount-oils-cpp() {
local first=_tmp/native-tar-test

# The release runs extract-for-benchmarks
local version
version=$(head -n 1 oil-version.txt)
local second="../benchmark-data/src/oils-for-unix-$version"

local dir
if test -d "$first"; then
dir=$first
elif test -d "$second"; then
dir=$second
else
die "Couldn't find $first or $second"
fi

pushd $dir > /dev/null

if command -v cloc; then # CI might not have it
_cloc-header
_oils-cpp | xargs cloc
Expand All @@ -70,6 +89,7 @@ linecount-oils-cpp() {
_wc-header
_oils-cpp | sort | uniq | xargs wc -l | sort -n

popd > /dev/null
}

# Without generated code. This is a fair comparison against bash, because
Expand Down

0 comments on commit cc2f683

Please sign in to comment.