Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests during package builds #127

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Priority: optional
Maintainer: Tim Theisen <[email protected]>
Build-Depends:
cmake (>=2.6),
debhelper (>=9),
debhelper (>=12),
libcurl4-openssl-dev | libcurl4-gnutls-dev,
libsqlite3-dev,
libssl-dev,
pkg-config,
uuid-dev
uuid-dev,
libgtest-dev
Standards-Version: 3.9.8
Homepage: https://github.com/scitokens/scitokens-cpp

Expand Down
248 changes: 5 additions & 243 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -7,254 +7,16 @@ Files: *
Copyright: NONE
License: Apache-2.0

Files: ./vendor/gtest/BUILD.bazel
./vendor/gtest/LICENSE
./vendor/gtest/ci/build-linux-bazel.sh
./vendor/gtest/ci/env-linux.sh
./vendor/gtest/ci/env-osx.sh
./vendor/gtest/ci/get-nprocessors.sh
./vendor/gtest/ci/install-linux.sh
./vendor/gtest/ci/install-osx.sh
./vendor/gtest/ci/log-config.sh
./vendor/gtest/googlemock/LICENSE
./vendor/gtest/googlemock/include/gmock/gmock-actions.h
./vendor/gtest/googlemock/include/gmock/gmock-cardinalities.h
./vendor/gtest/googlemock/include/gmock/gmock-function-mocker.h
./vendor/gtest/googlemock/include/gmock/gmock-generated-actions.h
./vendor/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump
./vendor/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h
./vendor/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump
./vendor/gtest/googlemock/include/gmock/gmock-generated-matchers.h
./vendor/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump
./vendor/gtest/googlemock/include/gmock/gmock-matchers.h
./vendor/gtest/googlemock/include/gmock/gmock-more-actions.h
./vendor/gtest/googlemock/include/gmock/gmock-more-matchers.h
./vendor/gtest/googlemock/include/gmock/gmock-nice-strict.h
./vendor/gtest/googlemock/include/gmock/gmock-spec-builders.h
./vendor/gtest/googlemock/include/gmock/gmock.h
./vendor/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h
./vendor/gtest/googlemock/include/gmock/internal/custom/gmock-port.h
./vendor/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h
./vendor/gtest/googlemock/include/gmock/internal/gmock-port.h
./vendor/gtest/googlemock/scripts/fuse_gmock_files.py
./vendor/gtest/googlemock/scripts/pump.py
./vendor/gtest/googlemock/src/gmock-all.cc
./vendor/gtest/googlemock/src/gmock-cardinalities.cc
./vendor/gtest/googlemock/src/gmock-internal-utils.cc
./vendor/gtest/googlemock/src/gmock-matchers.cc
./vendor/gtest/googlemock/src/gmock-spec-builders.cc
./vendor/gtest/googlemock/src/gmock.cc
./vendor/gtest/googlemock/src/gmock_main.cc
./vendor/gtest/googlemock/test/BUILD.bazel
./vendor/gtest/googlemock/test/gmock-actions_test.cc
./vendor/gtest/googlemock/test/gmock-cardinalities_test.cc
./vendor/gtest/googlemock/test/gmock-function-mocker_test.cc
./vendor/gtest/googlemock/test/gmock-generated-actions_test.cc
./vendor/gtest/googlemock/test/gmock-generated-function-mockers_test.cc
./vendor/gtest/googlemock/test/gmock-generated-matchers_test.cc
./vendor/gtest/googlemock/test/gmock-internal-utils_test.cc
./vendor/gtest/googlemock/test/gmock-matchers_test.cc
./vendor/gtest/googlemock/test/gmock-more-actions_test.cc
./vendor/gtest/googlemock/test/gmock-nice-strict_test.cc
./vendor/gtest/googlemock/test/gmock-port_test.cc
./vendor/gtest/googlemock/test/gmock-pp-string_test.cc
./vendor/gtest/googlemock/test/gmock-spec-builders_test.cc
./vendor/gtest/googlemock/test/gmock_all_test.cc
./vendor/gtest/googlemock/test/gmock_ex_test.cc
./vendor/gtest/googlemock/test/gmock_leak_test.py
./vendor/gtest/googlemock/test/gmock_leak_test_.cc
./vendor/gtest/googlemock/test/gmock_link2_test.cc
./vendor/gtest/googlemock/test/gmock_link_test.cc
./vendor/gtest/googlemock/test/gmock_link_test.h
./vendor/gtest/googlemock/test/gmock_output_test.py
./vendor/gtest/googlemock/test/gmock_output_test_.cc
./vendor/gtest/googlemock/test/gmock_stress_test.cc
./vendor/gtest/googlemock/test/gmock_test.cc
./vendor/gtest/googlemock/test/gmock_test_utils.py
./vendor/gtest/googlemock/test/pump_test.py
./vendor/gtest/googletest/LICENSE
./vendor/gtest/googletest/include/gtest/gtest-death-test.h
./vendor/gtest/googletest/include/gtest/gtest-matchers.h
./vendor/gtest/googletest/include/gtest/gtest-message.h
./vendor/gtest/googletest/include/gtest/gtest-param-test.h
./vendor/gtest/googletest/include/gtest/gtest-printers.h
./vendor/gtest/googletest/include/gtest/gtest-spi.h
./vendor/gtest/googletest/include/gtest/gtest-test-part.h
./vendor/gtest/googletest/include/gtest/gtest-typed-test.h
./vendor/gtest/googletest/include/gtest/gtest.h
./vendor/gtest/googletest/include/gtest/gtest_pred_impl.h
./vendor/gtest/googletest/include/gtest/gtest_prod.h
./vendor/gtest/googletest/include/gtest/internal/custom/gtest-port.h
./vendor/gtest/googletest/include/gtest/internal/custom/gtest-printers.h
./vendor/gtest/googletest/include/gtest/internal/custom/gtest.h
./vendor/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h
./vendor/gtest/googletest/include/gtest/internal/gtest-filepath.h
./vendor/gtest/googletest/include/gtest/internal/gtest-internal.h
./vendor/gtest/googletest/include/gtest/internal/gtest-param-util.h
./vendor/gtest/googletest/include/gtest/internal/gtest-port-arch.h
./vendor/gtest/googletest/include/gtest/internal/gtest-port.h
./vendor/gtest/googletest/include/gtest/internal/gtest-string.h
./vendor/gtest/googletest/include/gtest/internal/gtest-type-util.h
./vendor/gtest/googletest/samples/prime_tables.h
./vendor/gtest/googletest/samples/sample1.cc
./vendor/gtest/googletest/samples/sample1.h
./vendor/gtest/googletest/samples/sample10_unittest.cc
./vendor/gtest/googletest/samples/sample1_unittest.cc
./vendor/gtest/googletest/samples/sample2.cc
./vendor/gtest/googletest/samples/sample2.h
./vendor/gtest/googletest/samples/sample2_unittest.cc
./vendor/gtest/googletest/samples/sample3-inl.h
./vendor/gtest/googletest/samples/sample3_unittest.cc
./vendor/gtest/googletest/samples/sample4.cc
./vendor/gtest/googletest/samples/sample4.h
./vendor/gtest/googletest/samples/sample4_unittest.cc
./vendor/gtest/googletest/samples/sample5_unittest.cc
./vendor/gtest/googletest/samples/sample6_unittest.cc
./vendor/gtest/googletest/samples/sample7_unittest.cc
./vendor/gtest/googletest/samples/sample8_unittest.cc
./vendor/gtest/googletest/samples/sample9_unittest.cc
./vendor/gtest/googletest/scripts/common.py
./vendor/gtest/googletest/scripts/fuse_gtest_files.py
./vendor/gtest/googletest/scripts/gen_gtest_pred_impl.py
./vendor/gtest/googletest/scripts/release_docs.py
./vendor/gtest/googletest/scripts/run_with_path.py
./vendor/gtest/googletest/scripts/upload.py
./vendor/gtest/googletest/scripts/upload_gtest.py
./vendor/gtest/googletest/src/gtest-all.cc
./vendor/gtest/googletest/src/gtest-death-test.cc
./vendor/gtest/googletest/src/gtest-filepath.cc
./vendor/gtest/googletest/src/gtest-internal-inl.h
./vendor/gtest/googletest/src/gtest-matchers.cc
./vendor/gtest/googletest/src/gtest-port.cc
./vendor/gtest/googletest/src/gtest-printers.cc
./vendor/gtest/googletest/src/gtest-test-part.cc
./vendor/gtest/googletest/src/gtest-typed-test.cc
./vendor/gtest/googletest/src/gtest.cc
./vendor/gtest/googletest/src/gtest_main.cc
./vendor/gtest/googletest/test/BUILD.bazel
./vendor/gtest/googletest/test/googletest-break-on-failure-unittest.py
./vendor/gtest/googletest/test/googletest-break-on-failure-unittest_.cc
./vendor/gtest/googletest/test/googletest-catch-exceptions-test.py
./vendor/gtest/googletest/test/googletest-catch-exceptions-test_.cc
./vendor/gtest/googletest/test/googletest-color-test.py
./vendor/gtest/googletest/test/googletest-color-test_.cc
./vendor/gtest/googletest/test/googletest-death-test-test.cc
./vendor/gtest/googletest/test/googletest-death-test_ex_test.cc
./vendor/gtest/googletest/test/googletest-env-var-test.py
./vendor/gtest/googletest/test/googletest-env-var-test_.cc
./vendor/gtest/googletest/test/googletest-filepath-test.cc
./vendor/gtest/googletest/test/googletest-filter-unittest.py
./vendor/gtest/googletest/test/googletest-filter-unittest_.cc
./vendor/gtest/googletest/test/googletest-json-outfiles-test.py
./vendor/gtest/googletest/test/googletest-json-output-unittest.py
./vendor/gtest/googletest/test/googletest-list-tests-unittest.py
./vendor/gtest/googletest/test/googletest-list-tests-unittest_.cc
./vendor/gtest/googletest/test/googletest-listener-test.cc
./vendor/gtest/googletest/test/googletest-message-test.cc
./vendor/gtest/googletest/test/googletest-options-test.cc
./vendor/gtest/googletest/test/googletest-output-test.py
./vendor/gtest/googletest/test/googletest-output-test_.cc
./vendor/gtest/googletest/test/googletest-param-test-invalid-name1-test.py
./vendor/gtest/googletest/test/googletest-param-test-invalid-name1-test_.cc
./vendor/gtest/googletest/test/googletest-param-test-invalid-name2-test.py
./vendor/gtest/googletest/test/googletest-param-test-invalid-name2-test_.cc
./vendor/gtest/googletest/test/googletest-param-test-test.cc
./vendor/gtest/googletest/test/googletest-param-test-test.h
./vendor/gtest/googletest/test/googletest-param-test2-test.cc
./vendor/gtest/googletest/test/googletest-port-test.cc
./vendor/gtest/googletest/test/googletest-printers-test.cc
./vendor/gtest/googletest/test/googletest-shuffle-test.py
./vendor/gtest/googletest/test/googletest-shuffle-test_.cc
./vendor/gtest/googletest/test/googletest-test-part-test.cc
./vendor/gtest/googletest/test/googletest-test2_test.cc
./vendor/gtest/googletest/test/googletest-throw-on-failure-test.py
./vendor/gtest/googletest/test/googletest-throw-on-failure-test_.cc
./vendor/gtest/googletest/test/googletest-uninitialized-test.py
./vendor/gtest/googletest/test/googletest-uninitialized-test_.cc
./vendor/gtest/googletest/test/gtest-typed-test2_test.cc
./vendor/gtest/googletest/test/gtest-typed-test_test.cc
./vendor/gtest/googletest/test/gtest-typed-test_test.h
./vendor/gtest/googletest/test/gtest-unittest-api_test.cc
./vendor/gtest/googletest/test/gtest_all_test.cc
./vendor/gtest/googletest/test/gtest_assert_by_exception_test.cc
./vendor/gtest/googletest/test/gtest_environment_test.cc
./vendor/gtest/googletest/test/gtest_help_test.py
./vendor/gtest/googletest/test/gtest_help_test_.cc
./vendor/gtest/googletest/test/gtest_json_test_utils.py
./vendor/gtest/googletest/test/gtest_list_output_unittest.py
./vendor/gtest/googletest/test/gtest_list_output_unittest_.cc
./vendor/gtest/googletest/test/gtest_main_unittest.cc
./vendor/gtest/googletest/test/gtest_no_test_unittest.cc
./vendor/gtest/googletest/test/gtest_pred_impl_unittest.cc
./vendor/gtest/googletest/test/gtest_premature_exit_test.cc
./vendor/gtest/googletest/test/gtest_prod_test.cc
./vendor/gtest/googletest/test/gtest_repeat_test.cc
./vendor/gtest/googletest/test/gtest_skip_test.cc
./vendor/gtest/googletest/test/gtest_sole_header_test.cc
./vendor/gtest/googletest/test/gtest_stress_test.cc
./vendor/gtest/googletest/test/gtest_test_macro_stack_footprint_test.cc
./vendor/gtest/googletest/test/gtest_test_utils.py
./vendor/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc
./vendor/gtest/googletest/test/gtest_unittest.cc
./vendor/gtest/googletest/test/gtest_xml_outfile1_test_.cc
./vendor/gtest/googletest/test/gtest_xml_outfile2_test_.cc
./vendor/gtest/googletest/test/gtest_xml_outfiles_test.py
./vendor/gtest/googletest/test/gtest_xml_output_unittest.py
./vendor/gtest/googletest/test/gtest_xml_output_unittest_.cc
./vendor/gtest/googletest/test/gtest_xml_test_utils.py
./vendor/gtest/googletest/test/production.cc
./vendor/gtest/googletest/test/production.h
Copyright: 2005, Google Inc.
2006, Google Inc.
2007, Google Inc.
2008, Google Inc.
2009, Google Inc.
2010, Google Inc.
2013, Google Inc.
2015, Google Inc.
2017, Google Inc.
2018, Google Inc.
License: BSD-3-clause

Files: ./vendor/gtest/googlemock/scripts/generator/cpp/ast.py
./vendor/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py
./vendor/gtest/googlemock/scripts/generator/cpp/keywords.py
./vendor/gtest/googlemock/scripts/generator/cpp/tokenize.py
./vendor/gtest/googlemock/scripts/generator/cpp/utils.py
Copyright: 2007, Google Inc.
2007, Neal Norwitz
2009, Google Inc.
2009, Neal Norwitz
License: Apache-2.0

Files: ./vendor/gtest/googletest/test/gtest_skip_check_output_test.py
./vendor/gtest/googletest/test/gtest_skip_environment_check_output_test.py
./vendor/gtest/googletest/test/gtest_skip_in_environment_setup_test.cc
./vendor/gtest/googletest/test/gtest_testbridge_test.py
./vendor/gtest/googletest/test/gtest_testbridge_test_.cc
Copyright: 2018, Google LLC.
2019, Google LLC.
License: BSD-3-clause

Files: ./vendor/gtest/googlemock/scripts/generator/cpp/gmock_class.py
./vendor/gtest/googlemock/scripts/generator/gmock_gen.py
Copyright: 2008, Google Inc.
License: Apache-2.0
Files: vendor/jwt-cpp/*
Copyright: 2018, Dominik Thalhammer
License: Expat

Files: ./vendor/jwt-cpp/include/jwt-cpp/picojson.h
Files: vendor/jwt-cpp/include/picojson/picojson.h
Copyright: 2009-2010, Cybozu Labs, Inc.
2011-2014, Kazuho Oku
License: BSD-2-clause

Files: ./vendor/gtest/library.json
Copyright: NONE
License: BSD-3-clause

Files: ./vendor/jwt-cpp/*
Copyright: 2018, Dominik Thalhammer
License: Expat

Files: ./cmake/FindUUID.cmake
Files: cmake/FindUUID.cmake
Copyright: 2006, Andreas Schneider <[email protected]>
License: BSD-3-clause

Expand Down
36 changes: 0 additions & 36 deletions debian/get-orig-source.sh

This file was deleted.

4 changes: 2 additions & 2 deletions debian/libscitokens-dev.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
debian/tmp/usr/include/scitokens usr/include/
debian/tmp/usr/lib/*/libSciTokens.so
/usr/include/scitokens/scitokens.h
/usr/lib/*/libSciTokens.so
4 changes: 2 additions & 2 deletions debian/libscitokens0.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
debian/tmp/usr/lib/*/libSciTokens.so.*
debian/tmp/usr/bin/scitokens-*
/usr/lib/*/libSciTokens.so.*
/usr/bin/scitokens-*
Empty file removed debian/patches/series
Empty file.
20 changes: 16 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
dh $@
dh $@

override_dh_auto_configure:
dh_auto_configure -- -DLIB_INSTALL_DIR=lib/$(DEB_HOST_MULTIARCH)
dh_auto_configure -- \
-DSCITOKENS_BUILD_UNITTESTS:BOOL=ON \
-DSCITOKENS_EXTERNAL_GTEST:BOOL=ON

override_dh_auto_test:
# Filter out tests that require network connection
# Use a key cache directory outside HOME since HOME might not exit
cd obj-$(DEB_HOST_GNU_TYPE) && \
GTEST_FILTER=-KeycacheTest.RefreshTest:KeycacheTest.RefreshExpiredTest \
XDG_CACHE_HOME=$(CURDIR)/.cache \
ctest --output-on-failure

override_dh_auto_clean:
dh_auto_clean
rm -rf .cache
19 changes: 12 additions & 7 deletions rpm/scitokens-cpp.spec
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
%undefine __cmake_in_source_build
%undefine __cmake3_in_source_build

Name: scitokens-cpp
Version: 1.0.2
Release: 1%{?dist}
Summary: C++ Implementation of the SciTokens Library
License: ASL 2.0
URL: https://github.com/scitokens/scitokens-cpp

# Directions to generate a proper release:
# VER=0.3.3 # for example
# git archive --prefix "scitokens-cpp-$VER/" -o "scitokens-cpp-$VER.tar" v$VER
# git submodule update --init
# git submodule foreach --recursive "git archive --prefix=scitokens-cpp-$VER/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/scitokens-cpp-$VER.tar \$sha1.tar && rm \$sha1.tar"
# gzip "scitokens-cpp-$VER.tar"
Source0: https://github.com/scitokens/scitokens-cpp/releases/download/v%{version}/%{name}-%{version}.tar.gz

# Scitokens-cpp bundles jwt-cpp, a header only dependency
Expand All @@ -25,6 +22,8 @@ BuildRequires: sqlite-devel
BuildRequires: openssl-devel
BuildRequires: libcurl-devel
BuildRequires: libuuid-devel
BuildRequires: gtest-devel

%if 0%{?el7}
# needed for ldconfig_scriptlets
BuildRequires: epel-rpm-macros
Expand All @@ -45,12 +44,18 @@ Requires: %{name}%{?_isa} = %{version}
%setup -q

%build
%cmake3
%cmake3 -DSCITOKENS_BUILD_UNITTESTS:BOOL=ON \
-DSCITOKENS_EXTERNAL_GTEST:BOOL=ON
%cmake3_build

%install
%cmake3_install

%check
# Filter out tests that require network connection
export GTEST_FILTER=-KeycacheTest.RefreshTest:KeycacheTest.RefreshExpiredTest
%ctest3

# Run the ldconfig
%ldconfig_scriptlets

Expand Down