Skip to content

Commit 7ffed6e

Browse files
committed
Run embedded test on both dart and node
1 parent 54fabf3 commit 7ffed6e

19 files changed

+231
-33
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
10+
import '../shared/file_importer.dart';
11+
import '../dart_test.dart';
12+
13+
void main() {
14+
setUpAll(ensureSnapshotUpToDate);
15+
sharedTests(runSassEmbedded);
16+
}

test/embedded/dart/function_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
10+
import '../shared/function.dart';
11+
import '../dart_test.dart';
12+
13+
void main() {
14+
setUpAll(ensureSnapshotUpToDate);
15+
sharedTests(runSassEmbedded);
16+
}

test/embedded/dart/importer_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
10+
import '../shared/importer.dart';
11+
import '../dart_test.dart';
12+
13+
void main() {
14+
setUpAll(ensureSnapshotUpToDate);
15+
sharedTests(runSassEmbedded);
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
10+
import '../shared/length_delimited.dart';
11+
import '../dart_test.dart';
12+
13+
void main() {
14+
setUpAll(ensureSnapshotUpToDate);
15+
sharedTests();
16+
}

test/embedded/dart/protocol_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:test/test.dart';
9+
10+
import '../shared/protocol.dart';
11+
import '../dart_test.dart';
12+
13+
void main() {
14+
setUpAll(ensureSnapshotUpToDate);
15+
sharedTests(runSassEmbedded);
16+
}

test/embedded/dart_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
library;
7+
8+
import 'package:cli_pkg/testing.dart' as pkg;
9+
import 'package:test/test.dart';
10+
11+
import 'shared/embedded_process.dart';
12+
13+
void main() {}
14+
15+
/// Ensures that the snapshot of the Dart executable used by [runSassEmbedded] is
16+
/// up-to-date, if one has been generated.
17+
void ensureSnapshotUpToDate() => pkg.ensureExecutableUpToDate("sass");
18+
19+
Future<EmbeddedProcess> runSassEmbedded(
20+
[Iterable<String> args = const Iterable.empty()]) =>
21+
EmbeddedProcess.start(pkg.executableRunner("sass"),
22+
[...pkg.executableArgs("sass"), "--embedded", ...args]);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
@Tags(['node'])
7+
library;
8+
9+
import 'package:test/test.dart';
10+
11+
import '../shared/file_importer.dart';
12+
import '../node_test.dart';
13+
14+
void main() {
15+
setUpAll(ensureSnapshotUpToDate);
16+
sharedTests(runSassEmbedded);
17+
}

test/embedded/node/function_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
@Tags(['node'])
7+
library;
8+
9+
import 'package:test/test.dart';
10+
11+
import '../shared/function.dart';
12+
import '../node_test.dart';
13+
14+
void main() {
15+
setUpAll(ensureSnapshotUpToDate);
16+
sharedTests(runSassEmbedded);
17+
}

test/embedded/node/importer_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
@Tags(['node'])
7+
library;
8+
9+
import 'package:test/test.dart';
10+
11+
import '../shared/importer.dart';
12+
import '../node_test.dart';
13+
14+
void main() {
15+
setUpAll(ensureSnapshotUpToDate);
16+
sharedTests(runSassEmbedded);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2024 Google LLC. Use of this source code is governed by an
2+
// MIT-style license that can be found in the LICENSE file or at
3+
// https://opensource.org/licenses/MIT.
4+
5+
@TestOn('vm')
6+
@Tags(['node'])
7+
library;
8+
9+
import 'package:test/test.dart';
10+
11+
import '../shared/length_delimited.dart';
12+
import '../node_test.dart';
13+
14+
void main() {
15+
setUpAll(ensureSnapshotUpToDate);
16+
sharedTests();
17+
}

0 commit comments

Comments
 (0)