Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi committed Aug 21, 2024
1 parent efcc7ba commit 973e8b1
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
docker compose build --pull --no-cache --build-arg PLATFORM="linux/amd64" --build-arg IMAGE="php" --build-arg TAG="${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}"
- name: Test with gcov
run: |
docker compose run -v "$(pwd)/ext:/ext" --rm shell /bin/sh -c 'pskel test gcov && lcov --capture --directory "/ext" --output-file "/ext/lcov.info" --exclude "Zend/*" --exclude "third_party/*"'
docker compose run -v "$(pwd)/ext:/ext" --rm shell /bin/sh -c 'pskel test gcov && lcov --capture --directory "/ext" --output-file "/ext/lcov.info" --exclude "/usr/local/include/*" --exclude "third_party/*" && lcov --list "/ext/lcov.info"'
- name: Upload coverage to artifact
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 0 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
{
"files.associations": {
"*.phpt": "php",
"*.c": "c",
"*.h": "c"
}
}
68 changes: 67 additions & 1 deletion ext/bongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,79 @@ PHP_FUNCTION(test2)
}
/* }}}*/

PHP_FUNCTION(test3)
{
const char *var = "World";
zend_string *retval;

#if defined(ZTS)
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
retval = strpprintf(0, "Hello %s", var);
#endif

retval = strpprintf(0, "Hello %s", var);

RETURN_STR(retval);
}

/* {{{ PHP_RINIT_FUNCTION */
PHP_RINIT_FUNCTION(bongo)
{
#if defined(ZTS) && defined(COMPILE_DL_BONGO)
ZEND_TSRMLS_CACHE_UPDATE();
#endif

return SUCCESS;
}
/* }}} */
Expand Down
89 changes: 89 additions & 0 deletions ext/bongo.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
bongo.lo: /workspace/pskel/ext/bongo.c /workspace/pskel/ext/config.h \
/usr/local/include/gcc-gcov-php/php/main/php.h \
/usr/local/include/gcc-gcov-php/php/main/php_version.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_types.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_portability.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_config.h \
/usr/local/include/gcc-gcov-php/php/main/../main/php_config.h \
/usr/local/include/gcc-gcov-php/php/Zend/../TSRM/TSRM.h \
/usr/local/include/gcc-gcov-php/php/main/php_config.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_range_check.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_long.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_map_ptr.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_errors.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_alloc.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_alloc_sizes.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_llist.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_string.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_hash.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_sort.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_ast.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_gc.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_hrtime.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_variables.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_iterators.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_stream.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_smart_str_public.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_smart_string_public.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_signal.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_max_execution_timer.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_object_handlers.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_operators.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_strtod.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_multiply.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_sort.h \
/usr/local/include/gcc-gcov-php/php/main/php_compat.h \
/usr/local/include/gcc-gcov-php/php/main/php_config.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_API.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_modules.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_compile.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_globals.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_globals_macros.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_atomic.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_stack.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_ptr_stack.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_objects.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_objects_API.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_float.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_multibyte.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_arena.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_call_stack.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_vm_opcodes.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_build.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_list.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_execute.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_type_info.h \
/usr/local/include/gcc-gcov-php/php/main/build-defs.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_hash.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_alloc.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_stack.h \
/usr/local/include/gcc-gcov-php/php/main/snprintf.h \
/usr/local/include/gcc-gcov-php/php/main/spprintf.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_smart_str_public.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_smart_string_public.h \
/usr/local/include/gcc-gcov-php/php/main/php_syslog.h \
/usr/local/include/gcc-gcov-php/php/main/php.h \
/usr/local/include/gcc-gcov-php/php/main/php_output.h \
/usr/local/include/gcc-gcov-php/php/main/php_streams.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_stream.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_context.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_filter_api.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_transport.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_plain_wrapper.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_glob_wrapper.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_userspace.h \
/usr/local/include/gcc-gcov-php/php/main/streams/php_stream_mmap.h \
/usr/local/include/gcc-gcov-php/php/main/php_memory_streams.h \
/usr/local/include/gcc-gcov-php/php/main/fopen_wrappers.h \
/usr/local/include/gcc-gcov-php/php/main/php_globals.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_globals.h \
/usr/local/include/gcc-gcov-php/php/main/php_ini.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_ini.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_virtual_cwd.h \
/usr/local/include/gcc-gcov-php/php/TSRM/TSRM.h \
/usr/local/include/gcc-gcov-php/php/Zend/zend_constants.h \
/usr/local/include/gcc-gcov-php/php/main/php_reentrancy.h \
/usr/local/include/gcc-gcov-php/php/ext/standard/info.h \
/workspace/pskel/ext/php_bongo.h /workspace/pskel/ext/bongo_arginfo.h
2 changes: 2 additions & 0 deletions ext/bongo.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
function test1(): void {}

function test2(string $str = ""): string {}

function test3(): void {}
6 changes: 5 additions & 1 deletion ext/bongo_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 54b0ffc3af871b189435266df516f7575c1b9675 */
* Stub hash: e1e3b445b02ef570b100ef5feb7a7554c4e06940 */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test1, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
Expand All @@ -8,13 +8,17 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_test2, 0, 0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, str, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()

#define arginfo_test3 arginfo_test1


ZEND_FUNCTION(test1);
ZEND_FUNCTION(test2);
ZEND_FUNCTION(test3);


static const zend_function_entry ext_functions[] = {
ZEND_FE(test1, arginfo_test1)
ZEND_FE(test2, arginfo_test2)
ZEND_FE(test3, arginfo_test3)
ZEND_FE_END
};

0 comments on commit 973e8b1

Please sign in to comment.