Kaynağa Gözat

Add unit test for path_to_executable()

BruegelN 6 yıl önce
ebeveyn
işleme
49f4b7cfc8
1 değiştirilmiş dosya ile 15 ekleme ve 0 silme
  1. 15 0
      tests/include/igl/path_to_executable.cpp

+ 15 - 0
tests/include/igl/path_to_executable.cpp

@@ -0,0 +1,15 @@
+#include <test_common.h>
+#include <igl/path_to_executable.h>
+
+#include <iostream>
+
+
+TEST_CASE("path_to_executable: example", "[igl]")
+{
+  std::string path_to_executable = igl::path_to_executable();
+  REQUIRE(0 < path_to_executable.size());
+  // check if path_to_executable ends with correct file name
+  std::string ending = "libigl_tests";
+  REQUIRE(ending.size() < path_to_executable.size());
+  REQUIRE(std::equal(ending.rbegin(), ending.rend(), path_to_executable.rbegin()));
+}