Home > User Support > QTE

FAQ / QTE (Quality Town for Embedded Grade)

【QTE21】Test Creation Issues

QTE21_03 : CSV, external files

【question】
How do I test if I want to input an external file when I run the test?

【Answer】
If you use an external file, specify the path to the external file in the "build-env-executable-path-list" option in project.json.
The specified external file will be copied to the same directory as the test run binary when the run-test command is executed.
Test driver functions should be implemented to read external files in the current directory.

Example) To read the image file (test_case.img) from the test driver

#include
#include "gtest/gtest.h"
・・・

TEST(AddCase, func1)
{
  ifstream ifs("test_case.img");
・・・
}

上In the case of a test driver code like the following, set the file path of test_case.img to the "build-env-executable-path-list" option in build.json.

Search for related support information.

【Google Search in Support Information Site】

search keyword: 

Other Keyword Search




Reference information and links