Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perlalien/test-alien-cpp
Testing tools for Alien modules for projects that use C++
https://github.com/perlalien/test-alien-cpp
alien perl test test2
Last synced: 15 days ago
JSON representation
Testing tools for Alien modules for projects that use C++
- Host: GitHub
- URL: https://github.com/perlalien/test-alien-cpp
- Owner: PerlAlien
- Created: 2017-08-16T14:43:28.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T18:52:56.000Z (about 1 month ago)
- Last Synced: 2025-01-04T19:29:09.665Z (about 1 month ago)
- Topics: alien, perl, test, test2
- Language: Perl
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
# Test::Alien::CPP ![linux](https://github.com/PerlAlien/Test-Alien-CPP/workflows/linux/badge.svg)
Testing tools for Alien modules for projects that use C++
# SYNOPSIS
```perl
use Test2::V0;
use Test::Alien::CPP;
use Alien::libmycpplib;alien_ok 'ALien::libmycpplib';
my $xs = do { local $/; };
xs_ok $xs, with_subtest {
my($module) = @_;
ok $module->version;
};done_testing;
__DATA__
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#includeMODULE = TA_MODULE PACKAGE = TA_MODULE
const char *
version(klass)
const char *klass
CODE:
RETVAL = MyCppLib->version;
OUTPUT:
RETVAL
```# DESCRIPTION
This module works exactly like [Test::Alien](https://metacpan.org/pod/Test::Alien) except that it supports C++. All
functions like `alien_ok`, etc that are exported by [Test::Alien](https://metacpan.org/pod/Test::Alien) are exported
by this module. The only difference is that `xs_ok` injects C++ support before
delegating to [Test::Alien](https://metacpan.org/pod/Test::Alien).# FUNCTIONS
## xs\_ok
```
xs_ok $xs;
xs_ok $xs, $message;
```Compiles, links the given `XS` / C++ code and attaches to Perl.
See [Test::Alien](https://metacpan.org/pod/Test::Alien) for further details on how this test works.# SEE ALSO
- [Test::Alien](https://metacpan.org/pod/Test::Alien)
- [Test::Alien::CanCompileCpp](https://metacpan.org/pod/Test::Alien::CanCompileCpp)# AUTHOR
Author: Graham Ollis
Contributors:
Roy Storey (KIWIROY)
Diab Jerius (DJERIUS)
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017-2024 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.