Skip to content

Commit a4490c2

Browse files
committed
Adding support for integration tests #41
Update shipped RLS
1 parent e14f6a0 commit a4490c2

24 files changed

Lines changed: 174 additions & 100 deletions

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_library.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
3+
"Item1": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
66
"Manifest": "<TestRoot>\\hello_library\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_library\\target",
88
"AdditionalTestDiscoveryArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_workspace.approved.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\main_main.rusttests",
3+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\main.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\main_main.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\main.rusttests",
66
"Manifest": "<TestRoot>\\hello_workspace\\main\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_workspace\\target",
88
"AdditionalTestDiscoveryArguments": "",
@@ -13,10 +13,10 @@
1313
}
1414
},
1515
{
16-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared2_libshared2.rusttests",
16+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared.rusttests",
1717
"Item2": {
18-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared2_libshared2.rusttests",
19-
"Manifest": "<TestRoot>\\hello_workspace\\subfolder\\shared2\\Cargo.toml",
18+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared.rusttests",
19+
"Manifest": "<TestRoot>\\hello_workspace\\shared\\Cargo.toml",
2020
"TargetDir": "<TestRoot>\\hello_workspace\\target",
2121
"AdditionalTestDiscoveryArguments": "",
2222
"AdditionalTestExecutionArguments": "",
@@ -26,10 +26,10 @@
2626
}
2727
},
2828
{
29-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared_libshared.rusttests",
29+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared2.rusttests",
3030
"Item2": {
31-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared_libshared.rusttests",
32-
"Manifest": "<TestRoot>\\hello_workspace\\shared\\Cargo.toml",
31+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared2.rusttests",
32+
"Manifest": "<TestRoot>\\hello_workspace\\subfolder\\shared2\\Cargo.toml",
3333
"TargetDir": "<TestRoot>\\hello_workspace\\target",
3434
"AdditionalTestDiscoveryArguments": "",
3535
"AdditionalTestExecutionArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_world.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_world\\target\\debug\\hello_world_hello_world.rusttests",
3+
"Item1": "<TestRoot>\\hello_world\\target\\debug\\hello_world.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_world\\target\\debug\\hello_world_hello_world.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_world\\target\\debug\\hello_world.rusttests",
66
"Manifest": "<TestRoot>\\hello_world\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_world\\target",
88
"AdditionalTestDiscoveryArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.workspace_mixed.approved.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin1.rusttests",
3+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\bin1.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin1.rusttests",
5+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\bin1.rusttests",
66
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
88
"AdditionalTestDiscoveryArguments": "",
@@ -13,9 +13,9 @@
1313
}
1414
},
1515
{
16-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin2.rusttests",
16+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\bin2.rusttests",
1717
"Item2": {
18-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin2.rusttests",
18+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\bin2.rusttests",
1919
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
2020
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
2121
"AdditionalTestDiscoveryArguments": "",
@@ -26,9 +26,9 @@
2626
}
2727
},
2828
{
29-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_libmain.rusttests",
29+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main.rusttests",
3030
"Item2": {
31-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_libmain.rusttests",
31+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main.rusttests",
3232
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
3333
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
3434
"AdditionalTestDiscoveryArguments": "",
@@ -39,10 +39,10 @@
3939
}
4040
},
4141
{
42-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_test1.rusttests",
42+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\shared.rusttests",
4343
"Item2": {
44-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_test1.rusttests",
45-
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
44+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\shared.rusttests",
45+
"Manifest": "<TestRoot>\\workspace_mixed\\shared\\Cargo.toml",
4646
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
4747
"AdditionalTestDiscoveryArguments": "",
4848
"AdditionalTestExecutionArguments": "",
@@ -52,9 +52,9 @@
5252
}
5353
},
5454
{
55-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_test2.rusttests",
55+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\test1.rusttests",
5656
"Item2": {
57-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_test2.rusttests",
57+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\test1.rusttests",
5858
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
5959
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
6060
"AdditionalTestDiscoveryArguments": "",
@@ -65,10 +65,10 @@
6565
}
6666
},
6767
{
68-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\shared_libshared.rusttests",
68+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\test2.rusttests",
6969
"Item2": {
70-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\shared_libshared.rusttests",
71-
"Manifest": "<TestRoot>\\workspace_mixed\\shared\\Cargo.toml",
70+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\test2.rusttests",
71+
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
7272
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
7373
"AdditionalTestDiscoveryArguments": "",
7474
"AdditionalTestExecutionArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.GetTestSuiteTestsAsync.hello_library.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"container": "<TestRoot>\\hello_library\\target\\release\\hello_lib_libhello_lib.rusttests",
2+
"container": "<TestRoot>\\hello_library\\target\\release\\hello_lib.rusttests",
33
"tests": [
44
{
55
"type": "test",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"container": "<TestRoot>\\hello_world\\target\\release\\hello_world_hello_world.rusttests",
2+
"container": "<TestRoot>\\hello_world\\target\\release\\hello_world.rusttests",
33
"tests": []
44
}

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public async Task AdditionalBuildArgsTestsAsync(string workspaceRelRoot, string
115115
}
116116

117117
[Theory]
118-
[InlineData(@"hello_world", "hello_world_hello_world.rusttests", "release")] // No tests.
119-
[InlineData(@"hello_library", "hello_lib_libhello_lib.rusttests", "release")] // Has tests.
118+
[InlineData(@"hello_world", "hello_world.rusttests", "release")] // No tests.
119+
[InlineData(@"hello_library", "hello_lib.rusttests", "release")] // Has tests.
120120
[UseReporter(typeof(XUnit2Reporter))]
121121
public async Task GetTestSuiteTestsAsync(string workspaceRelRoot, string containerName, string profile)
122122
{

src/RustAnalyzer.TestAdapter.UnitTests/TestDiscovererTests.AdditionalBuildArgsTestsAsync.bin_with_example.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"Id": "3c9d5449-c265-52a4-8227-4c3045207429",
3+
"Id": "6de5d90f-34c6-8672-e85b-9897a7a73cad",
44
"FullyQualifiedName": "tests.test_requires_foo",
55
"DisplayName": "test_requires_foo",
66
"ExecutorUri": "executor://RustTestExecutor/v1",
7-
"Source": "<TestRoot>\\bin_with_example\\target\\debug\\hello_world_hello_world.rusttests",
7+
"Source": "<TestRoot>\\bin_with_example\\target\\debug\\hello_world.rusttests",
88
"CodeFilePath": "<TestRoot>\\bin_with_example\\src\\main.rs",
99
"LineNumber": 34,
1010
"Properties": []

src/RustAnalyzer.TestAdapter.UnitTests/TestDiscovererTests.DiscoverTestsTestsAsync.hello_library.approved.txt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,120 @@
11
[
22
{
3-
"Id": "9cdd003c-30d9-0b2e-7a1f-6ff5883001b3",
3+
"Id": "5ff35ccc-88d6-2d0a-a511-5ff4cad606f4",
44
"FullyQualifiedName": "tests.fibonacci_test.case_1",
55
"DisplayName": "case_1",
66
"ExecutorUri": "executor://RustTestExecutor/v1",
7-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
7+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
88
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
99
"LineNumber": 32,
1010
"Properties": []
1111
},
1212
{
13-
"Id": "be520c15-de75-8385-7805-3f45967d2e25",
13+
"Id": "33b4ed33-6522-4c62-e0d0-4a135cf7ffd1",
1414
"FullyQualifiedName": "tests.fibonacci_test.case_2",
1515
"DisplayName": "case_2",
1616
"ExecutorUri": "executor://RustTestExecutor/v1",
17-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
17+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
1818
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
1919
"LineNumber": 32,
2020
"Properties": []
2121
},
2222
{
23-
"Id": "d4c0ed85-7658-8909-f7c5-c7969544bfa2",
23+
"Id": "52260409-60fb-d367-3be1-06ed749b9c81",
2424
"FullyQualifiedName": "tests.fibonacci_test.case_3",
2525
"DisplayName": "case_3",
2626
"ExecutorUri": "executor://RustTestExecutor/v1",
27-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
27+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
2828
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
2929
"LineNumber": 32,
3030
"Properties": []
3131
},
3232
{
33-
"Id": "9d2fbab2-5a6a-bfae-6dfb-49f2b2f8eeb3",
33+
"Id": "893af7cf-18ba-06bc-0644-d46082cf62c4",
3434
"FullyQualifiedName": "tests.it_works",
3535
"DisplayName": "it_works",
3636
"ExecutorUri": "executor://RustTestExecutor/v1",
37-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
37+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
3838
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
3939
"LineNumber": 17,
4040
"Properties": []
4141
},
4242
{
43-
"Id": "794e5b7c-add1-83c5-37ea-e4158a439e05",
43+
"Id": "2866716a-87e0-b3c1-a667-d198fdbf2b7e",
4444
"FullyQualifiedName": "tests.it_works245_ignored",
4545
"DisplayName": "it_works245_ignored",
4646
"ExecutorUri": "executor://RustTestExecutor/v1",
47-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
47+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
4848
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
4949
"LineNumber": 24,
5050
"Properties": []
5151
},
5252
{
53-
"Id": "45f11fdd-c68c-e4ce-c89f-6373c6846704",
53+
"Id": "a041eafa-ebc7-a3b6-b070-d7604d2b9e23",
5454
"FullyQualifiedName": "tests.long_running_test",
5555
"DisplayName": "long_running_test",
5656
"ExecutorUri": "executor://RustTestExecutor/v1",
57-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
57+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
5858
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
5959
"LineNumber": 66,
6060
"Properties": []
6161
},
6262
{
63-
"Id": "513d6fec-4dfa-140a-4e41-8cea20164157",
63+
"Id": "4e27de77-3d2e-8d6e-9f6e-31626a359225",
6464
"FullyQualifiedName": "tests.multiplication_tests.when_both_operands_are_negative",
6565
"DisplayName": "when_both_operands_are_negative",
6666
"ExecutorUri": "executor://RustTestExecutor/v1",
67-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
67+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
6868
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
6969
"LineNumber": 51,
7070
"Properties": []
7171
},
7272
{
73-
"Id": "7252ac24-86aa-ad90-9abf-5f14d4702319",
73+
"Id": "c117cd66-c6a0-9734-b22b-23bdbb21c8d9",
7474
"FullyQualifiedName": "tests.multiplication_tests.when_both_operands_are_positive",
7575
"DisplayName": "when_both_operands_are_positive",
7676
"ExecutorUri": "executor://RustTestExecutor/v1",
77-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
77+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
7878
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
7979
"LineNumber": 51,
8080
"Properties": []
8181
},
8282
{
83-
"Id": "d5f95417-2284-8c80-5c2a-6ba057ad0b95",
83+
"Id": "cb9c6934-db4b-5d22-5be7-0946c04f5fcd",
8484
"FullyQualifiedName": "tests.multiplication_tests.when_operands_are_swapped",
8585
"DisplayName": "when_operands_are_swapped",
8686
"ExecutorUri": "executor://RustTestExecutor/v1",
87-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
87+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
8888
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
8989
"LineNumber": 51,
9090
"Properties": []
9191
},
9292
{
93-
"Id": "42ba209f-75a0-2107-2b27-a52756b8439c",
93+
"Id": "f7831d9b-fcf2-d955-c15e-409a6ae16aaa",
9494
"FullyQualifiedName": "tests.mytest",
9595
"DisplayName": "mytest",
9696
"ExecutorUri": "executor://RustTestExecutor/v1",
97-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
97+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
9898
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
9999
"LineNumber": 61,
100100
"Properties": []
101101
},
102102
{
103-
"Id": "6ecf7022-b9df-b85f-668b-a145eb01a5f0",
103+
"Id": "020c70a3-bb8b-eff2-45c3-0c017d4c69a5",
104104
"FullyQualifiedName": "tests.should_fail",
105105
"DisplayName": "should_fail",
106106
"ExecutorUri": "executor://RustTestExecutor/v1",
107-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
107+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
108108
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
109109
"LineNumber": 47,
110110
"Properties": []
111111
},
112112
{
113-
"Id": "ce619d2c-ff75-4bc5-b42c-f40eeaee2f82",
113+
"Id": "2459e866-6faf-59e0-6d59-8a7861f30696",
114114
"FullyQualifiedName": "tests.should_success",
115115
"DisplayName": "should_success",
116116
"ExecutorUri": "executor://RustTestExecutor/v1",
117-
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
117+
"Source": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
118118
"CodeFilePath": "<TestRoot>\\hello_library\\src\\lib.rs",
119119
"LineNumber": 42,
120120
"Properties": []

src/RustAnalyzer.TestAdapter.UnitTests/TestDiscovererTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public class TestDiscovererTests
1919
private readonly IToolChainService _tcs = new ToolChainService(TestHelpers.TL.T, TestHelpers.TL.L);
2020

2121
[Theory]
22-
[InlineData(@"hello_world", "hello_world_hello_world.rusttests", "dev")] // No tests.
23-
[InlineData(@"hello_library", "hello_lib_libhello_lib.rusttests", "dev")] // Has tests.
22+
[InlineData(@"hello_world", "hello_world.rusttests", "dev")] // No tests.
23+
[InlineData(@"hello_library", "hello_lib.rusttests", "dev")] // Has tests.
2424
[UseReporter(typeof(XUnit2Reporter))]
2525
public async Task DiscoverTestsTestsAsync(string workspaceRelRoot, string containerName, string profile)
2626
{
@@ -40,7 +40,7 @@ public async Task DiscoverTestsTestsAsync(string workspaceRelRoot, string contai
4040
}
4141

4242
[Theory]
43-
[InlineData(@"bin_with_example", "hello_world_hello_world.rusttests", "dev")]
43+
[InlineData(@"bin_with_example", "hello_world.rusttests", "dev")]
4444
[UseReporter(typeof(XUnit2Reporter))]
4545
public async Task AdditionalBuildArgsTestsAsync(string workspaceRelRoot, string containerName, string profile)
4646
{

0 commit comments

Comments
 (0)