2

我正在尝试使用 nmake 调用 MSTest

TEST="%VS90COMNTOOLS%..\IDE\MSTest.exe"
test:
  $(TEST) /testcontainer:Test.dll

当我运行 nmake 时,我得到了:

$ nmake test
'C:\Program' is not recognized as an internal or external command,

双引号不能正常工作

编辑:

谢谢“埃里克梅尔斯基”。我创建了类似的东西:

TEST_="%VS90COMNTOOLS%..\IDE\MSTest.exe" 
TEST="$(TEST_)" /nologo /noresults

test: 
  $(TEST) /testcontainer:Test.dll
4

2 回答 2

2

还要在以下用法周围加上双引号$(TEST)

TEST="%VS90COMNTOOLS%..\IDE\MSTest.exe"
test:
  "$(TEST)" /testcontainer:Test.dll

适用于 nmake 7 和 8。

于 2011-07-08T07:43:52.877 回答
-1

我以前也遇到过同样的问题。好吧,您可以在手动键入时使用“\”转义 CMD 中的空格,而在这种情况下命令是自动生成的。所以我的方法是使用另一条没有空格的路径。如果您找到更好的方法,请确保分享您的方法。

于 2011-07-01T18:02:16.917 回答