Adrian Taylor
f2d9d86c3d
Simplify test suite.
2020-10-29 21:21:30 -07:00
Adrian Taylor
3e5cff4a3d
Switch to #[namespace = A::B] syntax.
...
Thanks to sbrocket for this parsing code.
2020-10-29 19:48:45 -07:00
Adrian Taylor
c871343ac2
Allow namespace override.
...
This change allows a
#[namespace (namespace = A::B)]
attribute for each item in a cxx::bridge.
We now have a fair number of different types of name floating
around:
* C++ identifiers
* C++ fully-qualified names
* Rust identifiers
* Rust fully-qualified names (future, when we support sub-modules)
* Items with both a Rust and C++ name (a 'Pair')
* Types with only a known Rust name, which can be resolved to a
C++ name.
This change attempts to put some sensible names for all these
things in syntax/mod.rs, and so that would be a good place to start
review.
At the moment, the Namespace (included in each CppName)
is ruthlessly cloned all over the place. As a given namespace is
likely to be applicable to many types and functions, it may
save significant memory in future to use Rc<> here. But let's not
optimise too early.
2020-10-26 15:23:34 -07:00
Adrian Taylor
0fac321939
Adding tests for method calls in foreign namespaces
2020-10-26 15:17:02 -07:00
Adrian Taylor
ddc146ef9f
Adding tests for functions in other namespaces.
2020-10-26 15:17:02 -07:00
Adrian Taylor
d47af7a9d3
Tests for opaque C types in namepsaces
2020-10-26 15:17:02 -07:00
Adrian Taylor
585bb0bc56
Tests for namespaced extern trivial types
2020-10-26 15:17:02 -07:00
Adrian Taylor
5e79c64769
Tests for namespaced opaque extern types.
2020-10-26 15:17:02 -07:00
Adrian Taylor
9a158e408f
Adding tests for types in namespaces.
2020-10-26 15:17:02 -07:00
David Tolnay
743caa283c
Remove duplicated UniquePtr<C> impl in ui test
2020-10-16 13:22:47 -07:00
David Tolnay
441956e803
Match layout of C++ tests::E and struct E in Rust
2020-10-16 13:21:51 -07:00
David Tolnay
ca0f9da832
Format PR 361 with rustfmt
2020-10-16 13:18:54 -07:00
Adrian Taylor
9f7ff2e3a6
Switch to build-time squashing of 'new' method.
2020-10-12 20:14:17 -07:00
Adrian Taylor
117d3baac7
Bazel/Buck test build fixups.
...
Sacrifices to satisfy the PR builder guardians.
2020-10-12 16:33:30 -07:00
Adrian Taylor
d75f7e2911
Allow creation of UniquePtrs to trivial aliased types.
2020-10-12 16:16:19 -07:00
David Tolnay
362c9f92b0
Touch up PR 356
2020-10-10 16:30:04 -07:00
Adrian Taylor
1931ccf65e
Attempt at BUCK and BUILD files.
2020-10-10 16:19:20 -07:00
Adrian Taylor
121cca4a06
Add tests for ExternType.
2020-10-10 16:01:26 -07:00
David Tolnay
3bbcdbbbf6
Add test of cxx_/rust_name attributes
2020-10-09 20:22:23 -07:00
David Tolnay
8f16ae75f3
Bump namespace to 05
2020-10-08 19:34:50 -07:00
David Tolnay
d41eef59c9
Change test suite's include_prefix to match workspace path
2020-10-08 16:57:55 -07:00
David Tolnay
1f7a7e5bca
Touch up cxx_gen test
2020-10-04 19:50:35 -07:00
David Tolnay
821402b2a6
Move C++ generated code test to cxx's integration test
2020-10-04 19:50:35 -07:00
David Tolnay
0531f43ce9
Improve error message on a conflicting explicit impl
2020-10-04 00:36:56 -07:00
David Tolnay
64cab48688
Add ui test of explicit impl trait for type
2020-10-04 00:20:22 -07:00
David Tolnay
2b3c2b2fa4
Add ui test of invalid nonempty impl block
2020-10-04 00:20:22 -07:00
David Tolnay
50b7563de4
Add ui test of explicit impl with unsupported Self
2020-10-04 00:20:22 -07:00
David Tolnay
ac8394bd18
Add test of UniquePtrTarget impl conflict
2020-10-04 00:20:21 -07:00
David Tolnay
3208fd7a58
Provide more helpful error when opaque C++ type used by value
2020-10-03 21:10:05 -07:00
David Tolnay
9f69230783
Merge pull request #325 from adetaylor/with-trivial-2
...
Allow type aliases to be marked as Trivial.
2020-10-03 20:53:30 -07:00
Adrian Taylor
feb0dc104c
Fix expected error messages.
2020-09-30 16:51:31 -07:00
David Tolnay
e53ec04397
Bypass compiletest on Windows push and pull_request builds
2020-09-24 23:36:00 -04:00
David Tolnay
80631e93ef
Add test involving empty vector
2020-09-24 16:07:30 -04:00
David Tolnay
5df0a71dcf
Add test for CxxVector::as_slice
2020-09-24 15:58:58 -04:00
David Tolnay
717c7e6aa8
Factor out genrules to rust_cxx_bridge.bzl
2020-09-24 10:08:10 -04:00
David Tolnay
dc57990e22
Use more systematic naming for generated code targets
2020-09-24 10:00:50 -04:00
David Tolnay
0cd342913a
Make buck/bazel generated filepaths match source path with extension
2020-09-24 09:40:27 -04:00
David Tolnay
55151b4575
Match bazel's semantics for genrule cmd
2020-09-24 09:40:27 -04:00
David Tolnay
e02c8b3b98
Load cc_library from @rules_cc
...
Buildifier warns about this now.
Function "cc_library" is not global anymore and needs to be loaded
from "@rules_cc//cc:defs.bzl".buildifier(native-cc)
2020-09-24 08:58:09 -04:00
David Tolnay
e4d30f2257
Set test size of //tests:test Bazel test
...
Without this:
INFO: Analyzed 33 targets (1 packages loaded, 12 targets configured).
INFO: Found 32 targets and 1 test target...
INFO: Elapsed time: 0.905s, Critical Path: 0.66s
INFO: 3 processes: 3 linux-sandbox.
INFO: Build completed successfully, 3 total actions
//tests:test PASSED in 0.1s
WARNING: //tests:test: Test execution time (0.1s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
2020-09-24 08:57:22 -04:00
David Tolnay
22602b43a8
Fix return Result<Box<T>> from Rust to C++
2020-09-21 18:22:37 -04:00
David Tolnay
d7fef0a162
Update ui tests to nightly-2020-09-05
2020-09-04 23:28:56 -07:00
David Tolnay
25db1555f5
Update import path scheme for tests
2020-09-01 22:41:15 -07:00
David Tolnay
7273963a61
Sort buck genrule args the way buildifier wants
...
https://github.com/bazelbuild/buildtools/tree/master/buildifier
2020-09-01 20:48:11 -07:00
David Tolnay
5e668bce9b
Format ui test files using rustfmt
2020-08-29 11:36:22 -07:00
David Tolnay
de1cb777b2
Specify consistent c++ standard between cxx and cxx-test-suite
2020-08-28 17:36:33 -07:00
David Tolnay
47e239df11
Implement CxxVector<CxxString>
2020-08-28 00:43:10 -07:00
David Tolnay
33f56ad8d5
Implement Vec<String>
2020-08-28 00:25:41 -07:00
David Tolnay
18d93b6d58
Add &mut tests
2020-08-27 01:00:18 -07:00
David Tolnay
a7ba6a629c
Format with rustfmt 1.4.20
2020-08-27 00:15:55 -07:00