lundi 20 avril 2020

Premake5 compiling additional executables

I am a bit stuck with premake atm. I want to add multiple test files, that, well, run tests. These executables are completely independent from each other and from the main.cpp file that actually generates the final executable.

I am not 100% sure how to indicate to premake to assemble build commands for the tests. I have read on modules and actions but I am not entirely sure they do what I need.

The documentation on modules doesn't seem to imply that this is their intended purpose.

Assume this is the test I want to run:

#include "gtest/gtest.h"

TEST(DummyTest, Negative) {

  EXPECT_EQ(1, 0);
  EXPECT_EQ(1, 1);
  EXPECT_GT(93, 0);
}

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}

How can I tell premake to compile and link this file independently to create a stand alone executable?

Aucun commentaire:

Enregistrer un commentaire