22
22
#include " cppcheckexecutor.h"
23
23
#include " errortypes.h"
24
24
#include " helpers.h"
25
+ #include " path.h"
25
26
#include " platform.h"
26
27
#include " redirect.h"
27
28
#include " settings.h"
@@ -417,7 +418,7 @@ class TestCmdlineParser : public TestFixture {
417
418
418
419
void versionWithCfg () {
419
420
REDIRECT;
420
- ScopedFile file (" cppcheck.cfg" ,
421
+ ScopedFile file (Path::join ( Path::getPathFromFilename ( Path::getCurrentExecutablePath ( " " )), " cppcheck.cfg" ) ,
421
422
" {\n "
422
423
" \" productName\" : \" The Product\" "
423
424
" }\n " );
@@ -440,7 +441,7 @@ class TestCmdlineParser : public TestFixture {
440
441
441
442
void versionWithInvalidCfg () {
442
443
REDIRECT;
443
- ScopedFile file (" cppcheck.cfg" ,
444
+ ScopedFile file (Path::join ( Path::getPathFromFilename ( Path::getCurrentExecutablePath ( " " )), " cppcheck.cfg" ) ,
444
445
" {\n " );
445
446
const char * const argv[] = {" cppcheck" , " --version" };
446
447
ASSERT_EQUALS (CmdLineParser::Result::Fail, parser->parseFromArgs (2 , argv));
@@ -1711,7 +1712,7 @@ class TestCmdlineParser : public TestFixture {
1711
1712
1712
1713
void errorlistWithCfg () {
1713
1714
REDIRECT;
1714
- ScopedFile file (" cppcheck.cfg" ,
1715
+ ScopedFile file (Path::join ( Path::getPathFromFilename ( Path::getCurrentExecutablePath ( " " )), " cppcheck.cfg" ) ,
1715
1716
R"( {"productName": "The Product"}\n)" );
1716
1717
const char * const argv[] = {" cppcheck" , " --errorlist" };
1717
1718
ASSERT_EQUALS (CmdLineParser::Result::Exit, parser->parseFromArgs (2 , argv));
@@ -1730,7 +1731,7 @@ class TestCmdlineParser : public TestFixture {
1730
1731
1731
1732
void errorlistWithInvalidCfg () {
1732
1733
REDIRECT;
1733
- ScopedFile file (" cppcheck.cfg" ,
1734
+ ScopedFile file (Path::join ( Path::getPathFromFilename ( Path::getCurrentExecutablePath ( " " )), " cppcheck.cfg" ) ,
1734
1735
" {\n " );
1735
1736
const char * const argv[] = {" cppcheck" , " --errorlist" };
1736
1737
ASSERT_EQUALS (CmdLineParser::Result::Fail, parser->parseFromArgs (2 , argv));
@@ -2345,7 +2346,7 @@ class TestCmdlineParser : public TestFixture {
2345
2346
2346
2347
void invalidCppcheckCfg () {
2347
2348
REDIRECT;
2348
- ScopedFile file (" cppcheck.cfg" ,
2349
+ ScopedFile file (Path::join ( Path::getPathFromFilename ( Path::getCurrentExecutablePath ( " " )), " cppcheck.cfg" ) ,
2349
2350
" {\n " );
2350
2351
const char * const argv[] = {" cppcheck" , " test.cpp" };
2351
2352
ASSERT_EQUALS (CmdLineParser::Result::Fail, parser->parseFromArgs (2 , argv));
0 commit comments