添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have a test ( add_test(NAME MyTest COMMAND MyExecutable ) that I would like to run only have some "preparation" tasks have been done. When I have one test that depends on another test, I will use SET_TESTS_PROPERTIES(TestA PROPERTIES DEPENDS AnotherTest) , but is there a way I can do something like SET_TESTS_PROPERTIES(TestA PROPERTIES DEPENDS file(REMOVE /path/to/file)) ?

The one way I can think of is using some Python or other scripts as test driver in following way as per documentation :

add_test(NAME test_req_some_ops_before
        COMMAND testDriver.py --config $<CONFIGURATION>
                              --exe $<TARGET_FILE:myexe>
                              --path <here path to delete>)

which should do whatever you want

I see what you mean. We don't actually need the --config and --exe here, right? Just add_test(NAME test_req_some_ops_before COMMAND DeletePath.py --path-to-delete <here path to delete>) would work, right? – David Doria Jun 10, 2016 at 17:34 If you don't need generic script - yes. --config and --exe will be used if you'll make some generic test runner. – Sergei Nikulov Jun 11, 2016 at 2:13

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.