Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
a036c130
Unverified
Commit
a036c130
authored
Aug 19, 2021
by
Nikita Titov
Committed by
GitHub
Aug 19, 2021
Browse files
[ci] Add checks that MM_PREFETCH and MM_MALLOC are used in CRAN builds (#4536)
parent
c65a2e33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
.ci/test_r_package.sh
.ci/test_r_package.sh
+26
-0
.ci/test_r_package_windows.ps1
.ci/test_r_package_windows.ps1
+18
-0
No files found.
.ci/test_r_package.sh
View file @
a036c130
...
@@ -213,6 +213,32 @@ if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then
...
@@ -213,6 +213,32 @@ if [[ $OS_NAME == "macos" ]] && [[ $R_BUILD_TYPE == "cran" ]]; then
fi
fi
fi
fi
# this check makes sure that CI builds of the CRAN package
# actually use MM_PREFETCH preprocessor definition
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
mm_prefetch_working
=
$(
cat
$BUILD_LOG_FILE
\
|
grep
--count
-E
"checking whether MM_PREFETCH work.*yes"
)
if
[[
$mm_prefetch_working
-ne
1
]]
;
then
echo
"MM_PREFETCH test was not passed, and should be when testing the CRAN package"
exit
-1
fi
fi
# this check makes sure that CI builds of the CRAN package
# actually use MM_MALLOC preprocessor definition
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
mm_malloc_working
=
$(
cat
$BUILD_LOG_FILE
\
|
grep
--count
-E
"checking whether MM_MALLOC work.*yes"
)
if
[[
$mm_malloc_working
-ne
1
]]
;
then
echo
"MM_MALLOC test was not passed, and should be when testing the CRAN package"
exit
-1
fi
fi
# this check makes sure that no "warning: unknown pragma ignored" logs
# this check makes sure that no "warning: unknown pragma ignored" logs
# reach the user leading them to believe that something went wrong
# reach the user leading them to believe that something went wrong
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
if
[[
$R_BUILD_TYPE
==
"cran"
]]
;
then
...
...
.ci/test_r_package_windows.ps1
View file @
a036c130
...
@@ -232,6 +232,24 @@ if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) {
...
@@ -232,6 +232,24 @@ if (($env:COMPILER -eq "MINGW") -and ($env:R_BUILD_TYPE -eq "cmake")) {
}
}
}
}
# Checking that MM_PREFETCH preprocessor definition is actually used in CRAN builds.
if
(
$
env
:
R_BUILD_TYPE
-eq
"cran"
)
{
$checks
=
Select-String
-Path
"
${INSTALL_LOG_FILE_NAME}
"
-Pattern
"checking whether MM_PREFETCH work.*yes"
if
(
$checks
.
Matches
.
length
-eq
0
)
{
Write-Output
"MM_PREFETCH preprocessor definition wasn't used. Check the build logs."
Check-Output
$False
}
}
# Checking that MM_MALLOC preprocessor definition is actually used in CRAN builds.
if
(
$
env
:
R_BUILD_TYPE
-eq
"cran"
)
{
$checks
=
Select-String
-Path
"
${INSTALL_LOG_FILE_NAME}
"
-Pattern
"checking whether MM_MALLOC work.*yes"
if
(
$checks
.
Matches
.
length
-eq
0
)
{
Write-Output
"MM_MALLOC preprocessor definition wasn't used. Check the build logs."
Check-Output
$False
}
}
if
(
$
env
:
COMPILER
-eq
"MSVC"
)
{
if
(
$
env
:
COMPILER
-eq
"MSVC"
)
{
Write-Output
"Running tests with testthat.R"
Write-Output
"Running tests with testthat.R"
cd
R-package/tests
cd
R-package/tests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment