diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-27 14:59:20 +0000 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-27 14:59:20 +0000 |
| commit | 5b4aca6e3c936bca2657d1ad1a8f336838fda4bb (patch) | |
| tree | 2a5ba8dfc9bdb61c58633373be122ae2f83df1e7 /spec/integration/c | |
| parent | bff873a938de126d2b79e799df325f3d5c31295b (diff) | |
| parent | 80fa34dd2bd72af88efcb85844302d04450a0e1e (diff) | |
Merge branch '212919-conan-integration-tests' into 'master'v3.10.0
Scan conan projects
See merge request gitlab-org/security-products/license-management!156
Diffstat (limited to 'spec/integration/c')
| -rw-r--r-- | spec/integration/c/conan_spec.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/spec/integration/c/conan_spec.rb b/spec/integration/c/conan_spec.rb new file mode 100644 index 0000000..b8375e0 --- /dev/null +++ b/spec/integration/c/conan_spec.rb @@ -0,0 +1,62 @@ +require 'spec_helper' + +RSpec.describe "conan" do + context "when scanning a C++ project" do + subject { runner.scan(env: env) } + + let(:env) { { 'LICENSE_FINDER_CLI_OPTS' => '--project-path=libraries/poco/md5' } } + + before do + runner.clone('https://github.com/conan-io/examples.git') + end + + specify { expect(subject).to match_schema } + specify { expect(subject.dependency_names).to match_array(%w[openssl poco]) } + specify { expect(subject.licenses_for('openssl')).to match_array(['OpenSSL']) } + specify { expect(subject.licenses_for('poco')).to match_array(['BSL-1.0']) } + end + + context "when scanning a folly project" do + subject { runner.scan(env: env) } + + let(:env) { { 'LICENSE_FINDER_CLI_OPTS' => '--project-path=libraries/folly/basic' } } + + before do + runner.clone('https://github.com/conan-io/examples.git') + end + + specify { expect(subject).to match_schema } + specify { expect(subject.licenses_for('boost')).to match_array(['BSL-1.0']) } + specify { expect(subject.licenses_for('bzip2')).to match_array(['bzip2-1.0.8']) } + specify { expect(subject.licenses_for('double-conversion')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('folly')).to match_array(['Apache-2.0']) } + specify { expect(subject.licenses_for('gflags')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('glog')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('libdwarf')).to match_array(['LGPL-2.1']) } + specify { expect(subject.licenses_for('libelf')).to match_array(['LGPL-2.0']) } + specify { expect(subject.licenses_for('libevent')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('libiberty')).to match_array(['LGPL-2.1']) } + specify { expect(subject.licenses_for('libsodium')).to match_array(['ISC']) } + specify { expect(subject.licenses_for('libunwind')).to match_array(['MIT']) } + specify { expect(subject.licenses_for('lz4')).to match_array(['BSD-2-Clause', 'BSD-3-Clause']) } + specify { expect(subject.licenses_for('openssl')).to match_array(['OpenSSL']) } + specify { expect(subject.licenses_for('snappy')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('zlib')).to match_array(['Zlib']) } + specify { expect(subject.licenses_for('zstd')).to match_array(['BSD-3-Clause']) } + end + + context "when scanning a project with cmake" do + subject { runner.scan(env: env) } + + let(:env) { { 'LICENSE_FINDER_CLI_OPTS' => '--project-path=libraries/protobuf/serialization' } } + + before do + runner.clone('https://github.com/conan-io/examples.git') + end + + specify { expect(subject).to match_schema } + specify { expect(subject.dependency_names).to match_array(%w[protobuf protoc_installer]) } + specify { expect(subject.licenses_for('protobuf')).to match_array(['BSD-3-Clause']) } + specify { expect(subject.licenses_for('protoc_installer')).to match_array(['BSD-3-Clause']) } + end +end |
