27 lines
1.3 KiB
CMake
27 lines
1.3 KiB
CMake
# P4-37:vde_plugin_tool lint <dir> smoke:官方构建产物 PASS,坏 manifest FAIL。
|
||
if(NOT DEFINED VDE_TOOL OR NOT EXISTS "${VDE_TOOL}")
|
||
message(FATAL_ERROR "lint_smoke: VDE_TOOL not set or missing: ${VDE_TOOL}")
|
||
endif()
|
||
if(NOT DEFINED VDE_BINARY_DIR OR "${VDE_BINARY_DIR}" STREQUAL "")
|
||
message(FATAL_ERROR "lint_smoke: VDE_BINARY_DIR not set")
|
||
endif()
|
||
set(_official "${VDE_BINARY_DIR}/plugins/official")
|
||
execute_process(COMMAND "${VDE_TOOL}" lint "${_official}"
|
||
OUTPUT_VARIABLE _out ERROR_VARIABLE _err RESULT_VARIABLE _rc)
|
||
if(NOT _rc EQUAL 0)
|
||
message(FATAL_ERROR "lint official dir FAILED (rc=${_rc}):\n${_out}\n${_err}")
|
||
endif()
|
||
if(NOT _out MATCHES "passed")
|
||
message(FATAL_ERROR "lint official output missing summary:\n${_out}")
|
||
endif()
|
||
set(_bad "${VDE_BINARY_DIR}/lint_smoke/bad")
|
||
file(REMOVE_RECURSE "${_bad}")
|
||
file(MAKE_DIRECTORY "${_bad}")
|
||
file(WRITE "${_bad}/vde-plugin.json" "{\n \"id\": \"com.vde.test.bad\"\n}\n")
|
||
execute_process(COMMAND "${VDE_TOOL}" lint "${_bad}"
|
||
OUTPUT_VARIABLE _out2 ERROR_VARIABLE _err2 RESULT_VARIABLE _rc2)
|
||
if(_rc2 EQUAL 0)
|
||
message(FATAL_ERROR "lint bad manifest unexpectedly PASSED:\n${_out2}")
|
||
endif()
|
||
message(STATUS "lint_smoke: PASS (official PASS, bad manifest FAIL rc=${_rc2})")
|