szaszm commented on code in PR #1448:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1448#discussion_r1016820040


##########
extensions/standard-processors/tests/CMakeLists.txt:
##########
@@ -48,14 +48,16 @@ FOREACH(testfile ${PROCESSOR_UNIT_TESTS})
 
     MATH(EXPR PROCESSOR_INT_TEST_COUNT "${PROCESSOR_INT_TEST_COUNT}+1")
 
-    # Copy test resources
-    add_custom_command(
-        TARGET "${testfilename}"
-        POST_BUILD
-        COMMAND ${CMAKE_COMMAND} -E copy_directory
-                
"${CMAKE_SOURCE_DIR}/extensions/standard-processors/tests/unit/resources"
-                "$<TARGET_FILE_DIR:${testfilename}>/resources"
-        )
+    if(PROCESSOR_INT_TEST_COUNT EQUAL 1)

Review Comment:
   same here



##########
extensions/script/tests/CMakeLists.txt:
##########
@@ -49,6 +45,17 @@ FOREACH(testfile ${EXECUTESCRIPT_PYTHON_TESTS})
     createTests("${testfilename}")
     MATH(EXPR EXTENSIONS_TEST_COUNT "${EXTENSIONS_TEST_COUNT}+1")
     add_test(NAME "${testfilename}" COMMAND "${testfilename}" 
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
+    if(EXTENSIONS_TEST_COUNT EQUAL 1)
+        # Copy test resources
+        add_custom_command(

Review Comment:
   I think it would be helpful to explain why exactly this happens only on the 
first test, and not the others. Would you mind adding a comment about that?
   
   Correct me if I'm wrong, but if I understand correctly, the build step of 
the first test target will copy all of the test resources to the build 
directory, where it will be accessible to all of the tests.



##########
extensions/script/tests/CMakeLists.txt:
##########
@@ -73,6 +80,17 @@ FOREACH(testfile ${EXECUTEPYTHONPROCESSOR_UNIT_TESTS})
     createTests("${testfilename}")
     add_test(NAME "${testfilename}" COMMAND "${testfilename}"  
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
     MATH(EXPR EXTENSIONS_TEST_COUNT "${EXTENSIONS_TEST_COUNT}+1")
+
+    if(EXTENSIONS_TEST_COUNT EQUAL 1)

Review Comment:
   same here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to