From 1acbf83d1a31addd3f154c64ffec7435378a54e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Osztrogon=C3=A1c?= Date: Fri, 20 Sep 2019 11:07:06 +0200 Subject: [PATCH] Disable unsupported doctest tests on Windows (#3135) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable 02.API-REFERENCE-create-context.c, because it is based on pthread, and there is no pthread on Windows. Disable 11.EXT-REFERENCE-AUTORELEASE.c and test-ext-autorelease.c if compiler is MSVC, because MSVC doesn't support cleanup attribute. JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu --- docs/02.API-REFERENCE.md | 2 +- docs/11.EXT-REFERENCE-AUTORELEASE.md | 2 +- tests/unit-doc/CMakeLists.txt | 10 ++++++++++ tests/unit-ext/CMakeLists.txt | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/02.API-REFERENCE.md b/docs/02.API-REFERENCE.md index 07244288d..8020a2cbc 100644 --- a/docs/02.API-REFERENCE.md +++ b/docs/02.API-REFERENCE.md @@ -6425,7 +6425,7 @@ jerry_create_context (uint32_t heap_size, **Example** -[doctest]: # (test="compile") +[doctest]: # (test="compile", name="02.API-REFERENCE-create-context.c") ```c #include diff --git a/docs/11.EXT-REFERENCE-AUTORELEASE.md b/docs/11.EXT-REFERENCE-AUTORELEASE.md index b2cc6b662..65d548c8f 100644 --- a/docs/11.EXT-REFERENCE-AUTORELEASE.md +++ b/docs/11.EXT-REFERENCE-AUTORELEASE.md @@ -12,7 +12,7 @@ using the `__cleanup__` variable attribute. For other compilers, no support has **Example** -[doctest]: # (test="compile") +[doctest]: # (test="compile", name="11.EXT-REFERENCE-AUTORELEASE.c") ```c #include "jerryscript.h" diff --git a/tests/unit-doc/CMakeLists.txt b/tests/unit-doc/CMakeLists.txt index 152ef1356..3123c9f4a 100644 --- a/tests/unit-doc/CMakeLists.txt +++ b/tests/unit-doc/CMakeLists.txt @@ -54,6 +54,16 @@ foreach(DOCTEST_ELEMENT IN LISTS DOCTEST_LIST) endif() endforeach() +# Disable 02.API-REFERENCE-create-context.c on Windows, because there is no pthread on it. +if("${PLATFORM}" STREQUAL "WINDOWS") + list(REMOVE_ITEM DOCTEST_COMPILE ${CMAKE_CURRENT_BINARY_DIR}/02.API-REFERENCE-create-context.c) +endif() + +# Disable 11.EXT-REFERENCE-AUTORELEASE.c if compiler is MSVC, because MSVC doesn't support cleanup attribute. +if(USING_MSVC) + list(REMOVE_ITEM DOCTEST_COMPILE ${CMAKE_CURRENT_BINARY_DIR}/11.EXT-REFERENCE-AUTORELEASE.c) +endif() + # Add custom command to run doctest generator if any of the MarkDown sources # changes. add_custom_command( diff --git a/tests/unit-ext/CMakeLists.txt b/tests/unit-ext/CMakeLists.txt index bb211ac7e..da412d9eb 100644 --- a/tests/unit-ext/CMakeLists.txt +++ b/tests/unit-ext/CMakeLists.txt @@ -20,6 +20,11 @@ set(INCLUDE_UNIT_EXT ${CMAKE_CURRENT_SOURCE_DIR}) # Unit tests main modules file(GLOB SOURCE_UNIT_TEST_EXT_MODULES *.c) +# Disable test-ext-autorelease.c if compiler is MSVC, because MSVC doesn't support cleanup attribute. +if(USING_MSVC) + list(REMOVE_ITEM SOURCE_UNIT_TEST_EXT_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/test-ext-autorelease.c) +endif() + # Unit tests declaration add_custom_target(unittests-ext)