Skip to content

Commit ce9f979

Browse files
committed
Disable unsupported doctest tests on Windows
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
1 parent c05686b commit ce9f979

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

docs/02.API-REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6425,7 +6425,7 @@ jerry_create_context (uint32_t heap_size,
64256425

64266426
**Example**
64276427

6428-
[doctest]: # (test="compile")
6428+
[doctest]: # (test="compile", name="02.API-REFERENCE-create-context.c")
64296429

64306430
```c
64316431
#include <stdlib.h>

docs/11.EXT-REFERENCE-AUTORELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using the `__cleanup__` variable attribute. For other compilers, no support has
1212

1313
**Example**
1414

15-
[doctest]: # (test="compile")
15+
[doctest]: # (test="compile", name="11.EXT-REFERENCE-AUTORELEASE.c")
1616

1717
```c
1818
#include "jerryscript.h"

tests/unit-doc/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ foreach(DOCTEST_ELEMENT IN LISTS DOCTEST_LIST)
5454
endif()
5555
endforeach()
5656

57+
# Disable 02.API-REFERENCE-create-context.c on Windows, because there is no pthread on it.
58+
if("${PLATFORM}" STREQUAL "WINDOWS")
59+
list(REMOVE_ITEM DOCTEST_COMPILE ${CMAKE_CURRENT_BINARY_DIR}/02.API-REFERENCE-create-context.c)
60+
endif()
61+
62+
# Disable 11.EXT-REFERENCE-AUTORELEASE.c if compiler is MSVC, because MSVC doesn't support cleanup attribute.
63+
if(USING_MSVC)
64+
list(REMOVE_ITEM DOCTEST_COMPILE ${CMAKE_CURRENT_BINARY_DIR}/11.EXT-REFERENCE-AUTORELEASE.c)
65+
endif()
66+
5767
# Add custom command to run doctest generator if any of the MarkDown sources
5868
# changes.
5969
add_custom_command(

tests/unit-ext/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ set(INCLUDE_UNIT_EXT ${CMAKE_CURRENT_SOURCE_DIR})
2020
# Unit tests main modules
2121
file(GLOB SOURCE_UNIT_TEST_EXT_MODULES *.c)
2222

23+
# Disable test-ext-autorelease.c if compiler is MSVC, because MSVC doesn't support cleanup attribute.
24+
if(USING_MSVC)
25+
list(REMOVE_ITEM SOURCE_UNIT_TEST_EXT_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/test-ext-autorelease.c)
26+
endif()
27+
2328
# Unit tests declaration
2429
add_custom_target(unittests-ext)
2530

0 commit comments

Comments
 (0)