Browse Source

Use unique filename for unit tests to avoid filesystem race conditions + update github actions for nightly job.

Jérémie Dumas 4 years ago
parent
commit
7a3af9c851
3 changed files with 19 additions and 15 deletions
  1. 5 4
      .github/workflows/nightly.yml
  2. 9 6
      tests/include/igl/readMESH.cpp
  3. 5 5
      tests/include/igl/writePLY.cpp

+ 5 - 4
.github/workflows/nightly.yml

@@ -178,12 +178,13 @@ jobs:
             -DLIBIGL_BUILD_TUTORIALS=${{ matrix.tutorials }} ^
             -DLIBIGL_WITH_CGAL=ON ^
             -DLIBIGL_WITH_COMISO=OFF ^
-            -DCMAKE_JOB_POOLS=pool-linking=1;pool-compilation=1 ^
-            -DCMAKE_JOB_POOL_COMPILE:STRING=pool-compilation ^
-            -DCMAKE_JOB_POOL_LINK:STRING=pool-linking ^
+            -DCMAKE_JOB_POOLS=job-pool=1 ^
+            -DCMAKE_JOB_POOL_COMPILE:STRING=job-pool ^
+            -DCMAKE_JOB_POOL_LINK:STRING=job-pool ^
             -B build ^
             -S .
-          cmake --build build -j 1
+          cd build
+          ninja -j 1 -k 10
 
       - name: Tests
         run: cd build; ctest --verbose

+ 9 - 6
tests/include/igl/readMESH.cpp

@@ -7,7 +7,8 @@
 
 TEST_CASE("readMESH: single-tet","[igl]")
 {
-  std::ofstream("test.mesh")<< R"(MeshVersionFormatted 1
+  const std::string filename = "readMESH_single-tet.mesh";
+  std::ofstream(filename)<< R"(MeshVersionFormatted 1
 Dimension 3
 Vertices
 4
@@ -25,7 +26,7 @@ End
 
   Eigen::MatrixXd V;
   Eigen::MatrixXi T,F;
-  igl::readMESH("test.mesh",V,T,F);
+  igl::readMESH(filename,V,T,F);
   REQUIRE(V.rows() == 4);
   REQUIRE(T.rows() == 1);
   REQUIRE(T(0,0) == 0);
@@ -36,7 +37,8 @@ End
 
 TEST_CASE("readMESH: no-triangles-line","[igl]")
 {
-  std::ofstream("test.mesh")<< R"(MeshVersionFormatted 1
+  const std::string filename = "readMESH_no-triangles-line.mesh";
+  std::ofstream(filename)<< R"(MeshVersionFormatted 1
 Dimension 3
 Vertices
 4
@@ -51,7 +53,7 @@ Tetrahedra
 
   Eigen::MatrixXd V;
   Eigen::MatrixXi T,F;
-  igl::readMESH("test.mesh",V,T,F);
+  igl::readMESH(filename,V,T,F);
   REQUIRE(V.rows() == 4);
   REQUIRE(T.rows() == 1);
   REQUIRE(T(0,0) == 0);
@@ -62,7 +64,8 @@ Tetrahedra
 
 TEST_CASE("readMESH: mesh-version-formatted-2","[igl]")
 {
-  std::ofstream("test.mesh")<< R"(MeshVersionFormatted 2
+  const std::string filename = "readMESH_mesh-version-formatted-2.mesh";
+  std::ofstream(filename)<< R"(MeshVersionFormatted 2
 Dimension 3
 Vertices
 4
@@ -80,7 +83,7 @@ End
 
   Eigen::MatrixXd V;
   Eigen::MatrixXi T,F;
-  igl::readMESH("test.mesh",V,T,F);
+  igl::readMESH(filename,V,T,F);
   REQUIRE(V.rows() == 4);
   REQUIRE(T.rows() == 1);
   REQUIRE(T(0,0) == 0);

+ 5 - 5
tests/include/igl/writePLY.cpp

@@ -36,14 +36,14 @@ TEST_CASE("writePLY: bunny.ply", "[igl]")
     FD2<<face_data;
 
     // test that saving preserves all the data, including new data column
-    REQUIRE (igl::writePLY("test_bunny.ply", V1, F1, E1, N1, UV1, VD2, Vheader1, FD2,Fheader1, ED1, Eheader1, comments1, igl::FileEncoding::Binary));
+    REQUIRE (igl::writePLY("writePLY_test_bunny.ply", V1, F1, E1, N1, UV1, VD2, Vheader1, FD2,Fheader1, ED1, Eheader1, comments1, igl::FileEncoding::Binary));
 
     Eigen::MatrixXd V,N,UV,VD,FD,ED;
     Eigen::MatrixXi F,E;
     std::vector<std::string> Vheader,Fheader,Eheader,comments;
 
     // test that saving preserves all the data
-    REQUIRE (igl::readPLY("test_bunny.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments));
+    REQUIRE (igl::readPLY("writePLY_test_bunny.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments));
 
     REQUIRE (V.rows() == 35947);
     REQUIRE (V.cols() == 3);
@@ -59,7 +59,7 @@ TEST_CASE("writePLY: bunny.ply", "[igl]")
     REQUIRE (UV.rows() == 0);
     REQUIRE (UV.cols() == 0);
 
-    // this bunny have additonal data
+    // this bunny have additional data
     REQUIRE (VD.rows() == 35947);
     REQUIRE (VD.cols() == 3);
 
@@ -116,14 +116,14 @@ TEST_CASE("writePLY: bunny.ply float", "[igl]")
 
 
     // test that saving preserves all the data, including new data column
-    REQUIRE (igl::writePLY("test_bunny.ply", V1, F1, E1, N1, UV1, VD2, Vheader1, FD1,Fheader1, ED1, Eheader1, comments1, igl::FileEncoding::Binary));
+    REQUIRE (igl::writePLY("writePLY_test_bunny_float.ply", V1, F1, E1, N1, UV1, VD2, Vheader1, FD1,Fheader1, ED1, Eheader1, comments1, igl::FileEncoding::Binary));
 
     Eigen::MatrixXf V,N,UV,VD,FD,ED;
     Eigen::MatrixXi F,E;
     std::vector<std::string> Vheader,Fheader,Eheader,comments;
 
     // test that saving preserves all the data
-    REQUIRE (igl::readPLY("test_bunny.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments));
+    REQUIRE (igl::readPLY("writePLY_test_bunny_float.ply", V, F, E, N, UV, VD,Vheader, FD,Fheader, ED,Eheader, comments));
 
     REQUIRE (V.rows() == 35947);
     REQUIRE (V.cols() == 3);