-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(bazel): Add a missing test for when there is no lockfile
This is a test for 1045f89. Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
- Loading branch information
Showing
10 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
...nagers/bazel/src/funTest/assets/projects/synthetic/bazel-expected-output-no-lock-file.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
project: | ||
id: "Bazel::plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/MODULE.bazel:" | ||
definition_file_path: "<REPLACE_DEFINITION_FILE_PATH>" | ||
declared_licenses: [] | ||
declared_licenses_processed: {} | ||
vcs: | ||
type: "Git" | ||
url: "<REPLACE_URL_PROCESSED>" | ||
revision: "<REPLACE_REVISION>" | ||
path: "<REPLACE_PATH>" | ||
vcs_processed: | ||
type: "Git" | ||
url: "<REPLACE_URL_PROCESSED>" | ||
revision: "<REPLACE_REVISION>" | ||
path: "<REPLACE_PATH>" | ||
homepage_url: "" | ||
scopes: | ||
- name: "dev" | ||
dependencies: [] | ||
- name: "main" | ||
dependencies: | ||
- id: "Bazel::glog:0.5.0" | ||
linkage: "STATIC" | ||
dependencies: | ||
- id: "Bazel::gflags:2.2.2" | ||
linkage: "STATIC" | ||
packages: | ||
- id: "Bazel::gflags:2.2.2" | ||
purl: "pkg:generic/gflags@2.2.2" | ||
declared_licenses: [] | ||
declared_licenses_processed: {} | ||
description: "" | ||
homepage_url: "https://gflags.github.io/gflags/" | ||
binary_artifact: | ||
url: "" | ||
hash: | ||
value: "" | ||
algorithm: "" | ||
source_artifact: | ||
url: "https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz" | ||
hash: | ||
value: "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf" | ||
algorithm: "SHA-256" | ||
vcs: | ||
type: "Git" | ||
url: "https://github.com/gflags/gflags" | ||
revision: "" | ||
path: "" | ||
vcs_processed: | ||
type: "Git" | ||
url: "https://github.com/gflags/gflags.git" | ||
revision: "" | ||
path: "" | ||
- id: "Bazel::glog:0.5.0" | ||
purl: "pkg:generic/glog@0.5.0" | ||
declared_licenses: [] | ||
declared_licenses_processed: {} | ||
description: "" | ||
homepage_url: "https://github.com/google/glog" | ||
binary_artifact: | ||
url: "" | ||
hash: | ||
value: "" | ||
algorithm: "" | ||
source_artifact: | ||
url: "https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz" | ||
hash: | ||
value: "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5" | ||
algorithm: "SHA-256" | ||
vcs: | ||
type: "Git" | ||
url: "https://github.com/google/glog" | ||
revision: "" | ||
path: "" | ||
vcs_processed: | ||
type: "Git" | ||
url: "https://github.com/google/glog.git" | ||
revision: "" | ||
path: "" |
2 changes: 2 additions & 0 deletions
2
.../package-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/.bazelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
common --lockfile_mode=off | ||
|
1 change: 1 addition & 0 deletions
1
...age-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/.bazelversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.0.1 |
1 change: 1 addition & 0 deletions
1
...kage-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/MODULE.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bazel_dep(name = "glog", version = "0.5.0", repo_name = "com_github_google_glog") |
7 changes: 7 additions & 0 deletions
7
...package-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/lib/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cc_library( | ||
name = "cookie-jar", | ||
srcs = ["cookie-jar.cc"], | ||
hdrs = ["cookie-jar.h"], | ||
visibility = ["//main:__pkg__", "//test:__pkg__"], | ||
) | ||
|
5 changes: 5 additions & 0 deletions
5
...managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/lib/cookie-jar.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "lib/cookie-jar.h" | ||
|
||
int grab_cookies() { | ||
return 42; | ||
} |
6 changes: 6 additions & 0 deletions
6
...-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/lib/cookie-jar.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef LIB_COOKIE_JAR_H_ | ||
#define LIB_COOKIE_JAR_H_ | ||
|
||
int grab_cookies(); | ||
|
||
#endif |
11 changes: 11 additions & 0 deletions
11
...ackage-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/main/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cc_binary( | ||
name = "main", | ||
srcs = [ | ||
"main.cc", | ||
], | ||
deps = [ | ||
"//lib:cookie-jar", | ||
"@com_github_google_glog//:glog", | ||
], | ||
) | ||
|
10 changes: 10 additions & 0 deletions
10
...kage-managers/bazel/src/funTest/assets/projects/synthetic/bazel-no-lock-file/main/main.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "lib/cookie-jar.h" | ||
#include <glog/logging.h> | ||
|
||
int main(int argc, char* argv[]) { | ||
google::InitGoogleLogging(argv[0]); | ||
|
||
int num_cookies = grab_cookies(); | ||
LOG(INFO) << "Found " << num_cookies << " cookies"; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters