Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
João Magalhães
boytacean
Commits
decc7341
Verified
Commit
decc7341
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
fix: build.rs mocking support
Should fix automation of format.
parent
c9c06a4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2165
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
build.rs
+2
-2
2 additions, 2 deletions
build.rs
src/gen/mock.rs
+11
-0
11 additions, 0 deletions
src/gen/mock.rs
src/gen/mod.rs
+12
-0
12 additions, 0 deletions
src/gen/mod.rs
with
26 additions
and
3 deletions
.gitignore
+
1
−
1
View file @
decc7341
...
@@ -8,4 +8,4 @@ Cargo.lock
...
@@ -8,4 +8,4 @@ Cargo.lock
/res/roms.prop
/res/roms.prop
/frontends/*/target
/frontends/*/target
/src/gen.rs
/src/gen
/build
.rs
This diff is collapsed.
Click to expand it.
build.rs
+
2
−
2
View file @
decc7341
...
@@ -29,8 +29,8 @@ use std::path::Path;
...
@@ -29,8 +29,8 @@ use std::path::Path;
use
std
::
process
::
Command
;
use
std
::
process
::
Command
;
use
std
::
str
;
use
std
::
str
;
const
BUILD_OUT_FILE
:
&
str
=
"
gen
.rs"
;
const
BUILD_OUT_FILE
:
&
str
=
"
build
.rs"
;
const
SOURCE_DIR
:
&
str
=
"./src"
;
const
SOURCE_DIR
:
&
str
=
"./src
/gen
"
;
fn
main
()
{
fn
main
()
{
// in case we're running under docs.rs then we must return the control
// in case we're running under docs.rs then we must return the control
...
...
This diff is collapsed.
Click to expand it.
src/gen/mock.rs
0 → 100644
+
11
−
0
View file @
decc7341
//! Global constants, such as compiler version used, algorithms, compression and filters supported and others
pub
const
COMPILATION_DATE
:
&
str
=
"-"
;
pub
const
COMPILATION_TIME
:
&
str
=
"-"
;
pub
const
VERSION
:
&
str
=
"x.x.x"
;
pub
const
COMPILER
:
&
str
=
"rustc"
;
pub
const
COMPILER_VERSION
:
&
str
=
"x.x.x"
;
pub
const
FEATURES
:
[
&
str
;
1
]
=
[
"cpu"
];
pub
const
PLATFORM_CPU_BITS
:
&
str
=
"64"
;
pub
const
DEFAULT_THREAD_POOL_SIZE
:
usize
=
1
;
pub
const
MAX_THREAD_POOL_SIZE
:
usize
=
1
;
This diff is collapsed.
Click to expand it.
src/gen/mod.rs
0 → 100644
+
12
−
0
View file @
decc7341
//! Constants that define the current build and execution environment.
#[cfg(feature
=
"readonly"
)]
pub
mod
mock
;
#[cfg(feature
=
"readonly"
)]
pub
use
self
::
mock
::
*
;
#[rustfmt::skip]
#[cfg(not(feature
=
"readonly"
))]
pub
mod
build
;
#[cfg(not(feature
=
"readonly"
))]
pub
use
self
::
build
::
*
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment