cppunittest.h no such file or directory












0















I try build an unit test C++ project on a CI server. On my PC no problem, but on the CI server, I have the message: "'CppUnitTest.h' : No such file or directory".



On both computer (mine and server), there is VS enterprise 2017, the only thing different it's on my PC, I build on VS, and on the CI server, I use MSBuild by command line.



I tried to include additional directories in the project as:



AdditionalIncludeDirectories: $(VCInstallDir)AuxiliaryVSUnitTestinclude;$(VCInstallDir)UnitTestinclude;%(AdditionalIncludeDirectories)



AdditionalLibraryDirectories - $(VCInstallDir)UnitTestlib;$(VCInstallDir)AuxiliaryVSUnitTestlib;%(AdditionalLibraryDirectories)



But it doesn't work.
Is there another directory to include ?










share|improve this question























  • Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

    – Leo Liu-MSFT
    Nov 26 '18 at 9:12











  • I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

    – P. Paul-Alexandre
    Nov 26 '18 at 10:09
















0















I try build an unit test C++ project on a CI server. On my PC no problem, but on the CI server, I have the message: "'CppUnitTest.h' : No such file or directory".



On both computer (mine and server), there is VS enterprise 2017, the only thing different it's on my PC, I build on VS, and on the CI server, I use MSBuild by command line.



I tried to include additional directories in the project as:



AdditionalIncludeDirectories: $(VCInstallDir)AuxiliaryVSUnitTestinclude;$(VCInstallDir)UnitTestinclude;%(AdditionalIncludeDirectories)



AdditionalLibraryDirectories - $(VCInstallDir)UnitTestlib;$(VCInstallDir)AuxiliaryVSUnitTestlib;%(AdditionalLibraryDirectories)



But it doesn't work.
Is there another directory to include ?










share|improve this question























  • Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

    – Leo Liu-MSFT
    Nov 26 '18 at 9:12











  • I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

    – P. Paul-Alexandre
    Nov 26 '18 at 10:09














0












0








0








I try build an unit test C++ project on a CI server. On my PC no problem, but on the CI server, I have the message: "'CppUnitTest.h' : No such file or directory".



On both computer (mine and server), there is VS enterprise 2017, the only thing different it's on my PC, I build on VS, and on the CI server, I use MSBuild by command line.



I tried to include additional directories in the project as:



AdditionalIncludeDirectories: $(VCInstallDir)AuxiliaryVSUnitTestinclude;$(VCInstallDir)UnitTestinclude;%(AdditionalIncludeDirectories)



AdditionalLibraryDirectories - $(VCInstallDir)UnitTestlib;$(VCInstallDir)AuxiliaryVSUnitTestlib;%(AdditionalLibraryDirectories)



But it doesn't work.
Is there another directory to include ?










share|improve this question














I try build an unit test C++ project on a CI server. On my PC no problem, but on the CI server, I have the message: "'CppUnitTest.h' : No such file or directory".



On both computer (mine and server), there is VS enterprise 2017, the only thing different it's on my PC, I build on VS, and on the CI server, I use MSBuild by command line.



I tried to include additional directories in the project as:



AdditionalIncludeDirectories: $(VCInstallDir)AuxiliaryVSUnitTestinclude;$(VCInstallDir)UnitTestinclude;%(AdditionalIncludeDirectories)



AdditionalLibraryDirectories - $(VCInstallDir)UnitTestlib;$(VCInstallDir)AuxiliaryVSUnitTestlib;%(AdditionalLibraryDirectories)



But it doesn't work.
Is there another directory to include ?







c++ visual-studio unit-testing msbuild






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 '18 at 8:23









P. Paul-AlexandreP. Paul-Alexandre

478




478













  • Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

    – Leo Liu-MSFT
    Nov 26 '18 at 9:12











  • I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

    – P. Paul-Alexandre
    Nov 26 '18 at 10:09



















  • Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

    – Leo Liu-MSFT
    Nov 26 '18 at 9:12











  • I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

    – P. Paul-Alexandre
    Nov 26 '18 at 10:09

















Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

– Leo Liu-MSFT
Nov 26 '18 at 9:12





Since you have install the VS enterprise 2017 on the CI server, have you tired to build the project with Visual Studio 2017 directly on the CI server? Check if you still have this issue, if not, please share the command line and the parameters when you build via msbuild.

– Leo Liu-MSFT
Nov 26 '18 at 9:12













I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

– P. Paul-Alexandre
Nov 26 '18 at 10:09





I tried on the CI server with VS enterprise, it works. There is the command line: "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild.exe" /p:RunCodeAnalysis=true;CodeAnalysisRuleSet=C:/projectcoding_rule_cpp.ruleset /maxcpucount:4 C:/projectUnitTestsUnitTests.vcxproj "

– P. Paul-Alexandre
Nov 26 '18 at 10:09












1 Answer
1






active

oldest

votes


















0















cppunittest.h no such file or directory




Since you have installed the Visual Studio 2017 on your build server and build the project successfully, you should use the MSBuild from the Visual Studio instead of the build tool.



You can try to call the MSBuild from following path:



C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMSBuild.exe


I have create a unit test C++ project sample to test, and it works fine, if I call the MSBuild from above folder.



Hope this helps.






share|improve this answer
























  • To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

    – P. Paul-Alexandre
    Nov 27 '18 at 8:36











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53477120%2fcppunittest-h-no-such-file-or-directory%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0















cppunittest.h no such file or directory




Since you have installed the Visual Studio 2017 on your build server and build the project successfully, you should use the MSBuild from the Visual Studio instead of the build tool.



You can try to call the MSBuild from following path:



C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMSBuild.exe


I have create a unit test C++ project sample to test, and it works fine, if I call the MSBuild from above folder.



Hope this helps.






share|improve this answer
























  • To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

    – P. Paul-Alexandre
    Nov 27 '18 at 8:36
















0















cppunittest.h no such file or directory




Since you have installed the Visual Studio 2017 on your build server and build the project successfully, you should use the MSBuild from the Visual Studio instead of the build tool.



You can try to call the MSBuild from following path:



C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMSBuild.exe


I have create a unit test C++ project sample to test, and it works fine, if I call the MSBuild from above folder.



Hope this helps.






share|improve this answer
























  • To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

    – P. Paul-Alexandre
    Nov 27 '18 at 8:36














0












0








0








cppunittest.h no such file or directory




Since you have installed the Visual Studio 2017 on your build server and build the project successfully, you should use the MSBuild from the Visual Studio instead of the build tool.



You can try to call the MSBuild from following path:



C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMSBuild.exe


I have create a unit test C++ project sample to test, and it works fine, if I call the MSBuild from above folder.



Hope this helps.






share|improve this answer














cppunittest.h no such file or directory




Since you have installed the Visual Studio 2017 on your build server and build the project successfully, you should use the MSBuild from the Visual Studio instead of the build tool.



You can try to call the MSBuild from following path:



C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuild15.0BinMSBuild.exe


I have create a unit test C++ project sample to test, and it works fine, if I call the MSBuild from above folder.



Hope this helps.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 '18 at 2:48









Leo Liu-MSFTLeo Liu-MSFT

19.1k22333




19.1k22333













  • To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

    – P. Paul-Alexandre
    Nov 27 '18 at 8:36



















  • To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

    – P. Paul-Alexandre
    Nov 27 '18 at 8:36

















To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

– P. Paul-Alexandre
Nov 27 '18 at 8:36





To conclude, MSBuild from the build tool doesn't compile C++ unit test (but it does with C# unit test, I do this on another project)... I hope MStest works too. thanks for the helps.

– P. Paul-Alexandre
Nov 27 '18 at 8:36




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53477120%2fcppunittest-h-no-such-file-or-directory%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks