Skip to content

Commit 8110746

Browse files
Merge pull request #59 from Neko-Box-Coder/CITestFix
Adding missing config parsing test
2 parents 379ada7 + a01983e commit 8110746

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

Include/Tests/ConfigParsing/MockComponents.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ namespace ghc
1919
CO_INSERT_METHOD( OverrideInstance,
2020
bool,
2121
Mock_exists,
22-
(const std::string&, std::error_code&),
22+
(const ghc::filesystem::path&, std::error_code&),
2323
/* no prepend */,
2424
noexcept)
2525

2626
CO_INSERT_METHOD( OverrideInstance,
2727
bool,
2828
Mock_is_directory,
29-
(const std::string&, std::error_code&),
29+
(const ghc::filesystem::path&, std::error_code&),
3030
/* no prepend */,
3131
noexcept)
3232
}

Src/Tests/ConfigParsingTest.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,19 @@ int main(int argc, char** argv)
6060
*/
6161

6262
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
63-
.WhenCalledWith<const std::string&, CO_ANY_TYPE>(configPath, CO_ANY)
63+
.WhenCalledWith<const ghc::filesystem::path&, CO_ANY_TYPE>(configPath, CO_ANY)
6464
.Times(1)
6565
.Returns<bool>(true)
6666
.Expected();
6767
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
68-
.WhenCalledWith<const std::string&, CO_ANY_TYPE>(versionPath, CO_ANY)
68+
.WhenCalledWith<const ghc::filesystem::path&, CO_ANY_TYPE>( versionPath,
69+
CO_ANY)
6970
.Times(1)
7071
.Returns<bool>(true)
7172
.Expected();
7273
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_is_directory)
73-
.WhenCalledWith<const std::string&, CO_ANY_TYPE>(configPath, CO_ANY)
74+
.WhenCalledWith<const ghc::filesystem::path&, CO_ANY_TYPE>( configPath,
75+
CO_ANY)
7476
.Times(1)
7577
.Returns<bool>(false)
7678
.Expected();
@@ -292,12 +294,14 @@ int main(int argc, char** argv)
292294
(
293295
ssTEST_CALL_COMMON_CLEANUP();
294296
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
295-
.WhenCalledWith<const std::string&, CO_ANY_TYPE>(configPath, CO_ANY)
297+
.WhenCalledWith<const ghc::filesystem::path&, CO_ANY_TYPE>( configPath,
298+
CO_ANY)
296299
.Times(1)
297300
.Returns<bool>(true)
298301
.Expected();
299302
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
300-
.WhenCalledWith<const std::string&, CO_ANY_TYPE>(versionPath, CO_ANY)
303+
.WhenCalledWith<const ghc::filesystem::path&, CO_ANY_TYPE>( versionPath,
304+
CO_ANY)
301305
.Times(1)
302306
.Returns<bool>(false)
303307
.Expected();
@@ -660,14 +664,14 @@ int main(int argc, char** argv)
660664
"some/config/dir/Default/gccCompilerLinker.yaml";
661665

662666
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
663-
.WhenCalledWith<const std::string&,
667+
.WhenCalledWith<const ghc::filesystem::path&,
664668
CO_ANY_TYPE>( gccExpectedImportPath,
665669
CO_ANY)
666670
.Returns<bool>(true)
667671
.Times(1)
668672
.Expected();
669673
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
670-
.WhenCalledWith<const std::string&,
674+
.WhenCalledWith<const ghc::filesystem::path&,
671675
CO_ANY_TYPE>( filetypesExpectedImportPath,
672676
CO_ANY)
673677
.Returns<bool>(true)
@@ -676,7 +680,7 @@ int main(int argc, char** argv)
676680
CO_INSTRUCT_REF (OverrideInstance, ghc::filesystem, Mock_exists)
677681
.WhenCalledWith
678682
<
679-
const std::string&,
683+
const ghc::filesystem::path&,
680684
CO_ANY_TYPE
681685
>
682686
(

Src/Tests/RunAllTests.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ GOTO :FINAL
2222
:RUN_TEST <testFile>
2323
@REM Setlocal EnableDelayedExpansion
2424
IF NOT EXIST "%~1" (
25-
ECHO "[Auto Test Warning] %~1 doesn't exist, skipping"
25+
ECHO "%~1 doesn't exist"
2626
ECHO ""
27-
EXIT /b
27+
GOTO :FAILED
2828
)
2929
PUSHD "%~dp1"
3030
CALL "%~1"
@@ -54,6 +54,7 @@ CALL :RUN_TEST "%~dp0\%MODE%DependencyInfoTest.exe"
5454
CALL :RUN_TEST "%~dp0\%MODE%ScriptInfoTest.exe"
5555
CALL :RUN_TEST "%~dp0\%MODE%ProfileTest.exe"
5656
CALL :RUN_TEST "%~dp0\%MODE%BuildTypeTest.exe"
57+
CALL :RUN_TEST "%~dp0\%MODE%ConfigParsingTest.exe"
5758

5859
EXIT 0
5960

Src/Tests/RunAllTests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function runTest()
99
$1
1010
else
1111
echo "[Auto Test Warning] $1 doesn't exist, skipping"
12-
echo ""
12+
exit 1
1313
fi
1414
}
1515

@@ -30,3 +30,4 @@ runTest ./DependencyInfoTest
3030
runTest ./ScriptInfoTest
3131
runTest ./ProfileTest
3232
runTest ./BuildTypeTest
33+
runTest ./ConfigParsingTest

0 commit comments

Comments
 (0)