tau icon indicating copy to clipboard operation
tau copied to clipboard

Filtering by exact name doesn't work

Open GibbOne opened this issue 2 years ago • 5 comments

It's not possible to use entire test name (TESTSUITE.TESTNAME) to run a single test by mean of "--filter" option. Anyway if I remove just last char from the test name, it works.

GibbOne avatar Mar 02 '22 07:03 GibbOne

I guess it's enough to change return value at this point.

image

Should it return 0?

GibbOne avatar Mar 02 '22 07:03 GibbOne

Hello @GibbOne ! Sorry. Github Notifications are a pain. I believe so. Haven't really tested the filtering functionality myself. Would you like to contribute? Please open a PR in that case.

jasmcaus avatar Mar 24 '22 13:03 jasmcaus

@GibbOne Can you write a test case within tau to show the example to kickoff dog feeding?

matu3ba avatar Apr 10 '22 23:04 matu3ba

@jasmcaus I can' t fork this repo, so I'm not able to open a PR.

Anyway, @matu3ba, below a minimal test for this issue.

#include "stdbool.h"

TAU_NO_MAIN();

bool testExecuted = false;
TEST(TEST, NAME)
{
  testExecuted = true;
}

int main()
{
  char name[] = "main";
  char arg1[] = "--filter=TEST.NAME";
  char* argv[] = { name, arg1 };

  tau_main(2, argv);

  CHECK(testExecuted);
}

It works, maybe you can do better...

GibbOne avatar Apr 14 '22 12:04 GibbOne

@jasmcaus Can you comment the Makefile such that it becomes more obvious how things should be ordered?

cmake:
	cmake -S $(SOURCE_DIR) -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Debug -DTAU_BUILDINTERNALTESTS=On
	cmake --build $(BUILD_DIR) --config Debug
	echo ------------------ Running Target ------------------
	cd build/bin/ ; ./TauInternalTests
.PHONY: cmake

runs only TauInternalTests. Should other Cli tests also go there?

What is

script:
	python3 script.py
.PHONY: script

and

test:
	gcc test.c -o test.exe -I .
	./test.exe
.PHONY: test

used for? script.py does nothing, because everything is commented and gcc test.c fails, because the path is wrong.

matu3ba avatar Apr 21 '22 22:04 matu3ba