summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rwxr-xr-xtesting/gen-languages-all6
-rwxr-xr-xtesting/get-coursier.sh4
-rwxr-xr-xtesting/get-dart.sh17
-rwxr-xr-xtesting/get-swift.sh4
-rw-r--r--testing/resources/dart_repo/.pre-commit-hooks.yaml4
-rw-r--r--testing/resources/dart_repo/bin/hello-world-dart.dart6
-rw-r--r--testing/resources/dart_repo/pubspec.yaml10
-rw-r--r--testing/resources/dotnet_hooks_csproj_repo/.pre-commit-hooks.yaml2
-rw-r--r--testing/resources/dotnet_hooks_sln_repo/.pre-commit-hooks.yaml2
-rw-r--r--testing/util.py2
10 files changed, 50 insertions, 7 deletions
diff --git a/testing/gen-languages-all b/testing/gen-languages-all
index eb7cd70..51e4bce 100755
--- a/testing/gen-languages-all
+++ b/testing/gen-languages-all
@@ -2,9 +2,9 @@
import sys
LANGUAGES = [
- 'conda', 'coursier', 'docker', 'docker_image', 'dotnet', 'fail', 'golang',
- 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust', 'script',
- 'swift', 'system',
+ 'conda', 'coursier', 'dart', 'docker', 'docker_image', 'dotnet', 'fail',
+ 'golang', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust',
+ 'script', 'swift', 'system',
]
FIELDS = [
'ENVIRONMENT_DIR', 'get_default_version', 'healthy', 'install_environment',
diff --git a/testing/get-coursier.sh b/testing/get-coursier.sh
index 760c6c1..4c5e955 100755
--- a/testing/get-coursier.sh
+++ b/testing/get-coursier.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This is a script used in CI to install coursier
-set -euxo pipefail
+set -euo pipefail
COURSIER_URL="https://github.com/coursier/coursier/releases/download/v2.0.0/cs-x86_64-pc-linux"
COURSIER_HASH="e2e838b75bc71b16bcb77ce951ad65660c89bda7957c79a0628ec7146d35122f"
@@ -11,3 +11,5 @@ rm -f "$ARTIFACT"
curl --location --silent --output "$ARTIFACT" "$COURSIER_URL"
echo "$COURSIER_HASH $ARTIFACT" | sha256sum --check
chmod ugo+x /tmp/coursier/cs
+
+echo '##vso[task.prependpath]/tmp/coursier'
diff --git a/testing/get-dart.sh b/testing/get-dart.sh
new file mode 100755
index 0000000..b655e1a
--- /dev/null
+++ b/testing/get-dart.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+VERSION=2.13.4
+
+if [ "$OSTYPE" = msys ]; then
+ URL="https://storage.googleapis.com/dart-archive/channels/stable/release/${VERSION}/sdk/dartsdk-windows-x64-release.zip"
+ echo "##vso[task.prependpath]$(cygpath -w /tmp/dart-sdk/bin)"
+else
+ URL="https://storage.googleapis.com/dart-archive/channels/stable/release/${VERSION}/sdk/dartsdk-linux-x64-release.zip"
+ echo '##vso[task.prependpath]/tmp/dart-sdk/bin'
+fi
+
+curl --silent --location --output /tmp/dart.zip "$URL"
+
+unzip -q -d /tmp /tmp/dart.zip
+rm /tmp/dart.zip
diff --git a/testing/get-swift.sh b/testing/get-swift.sh
index e205d44..a05b7b9 100755
--- a/testing/get-swift.sh
+++ b/testing/get-swift.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This is a script used in CI to install swift
-set -euxo pipefail
+set -euo pipefail
. /etc/lsb-release
if [ "$DISTRIB_CODENAME" = "bionic" ]; then
@@ -25,3 +25,5 @@ fi
mkdir -p /tmp/swift
tar -xf "$TGZ" --strip 1 --directory /tmp/swift
+
+echo '##vso[task.prependpath]/tmp/swift/usr/bin'
diff --git a/testing/resources/dart_repo/.pre-commit-hooks.yaml b/testing/resources/dart_repo/.pre-commit-hooks.yaml
new file mode 100644
index 0000000..e0dc5a2
--- /dev/null
+++ b/testing/resources/dart_repo/.pre-commit-hooks.yaml
@@ -0,0 +1,4 @@
+- id: hello-world-dart
+ name: hello world dart
+ entry: hello-world-dart
+ language: dart
diff --git a/testing/resources/dart_repo/bin/hello-world-dart.dart b/testing/resources/dart_repo/bin/hello-world-dart.dart
new file mode 100644
index 0000000..5d8d6a6
--- /dev/null
+++ b/testing/resources/dart_repo/bin/hello-world-dart.dart
@@ -0,0 +1,6 @@
+import 'package:ansicolor/ansicolor.dart';
+
+void main() {
+ AnsiPen pen = new AnsiPen()..red();
+ print("hello hello " + pen("world"));
+}
diff --git a/testing/resources/dart_repo/pubspec.yaml b/testing/resources/dart_repo/pubspec.yaml
new file mode 100644
index 0000000..bc719d0
--- /dev/null
+++ b/testing/resources/dart_repo/pubspec.yaml
@@ -0,0 +1,10 @@
+environment:
+ sdk: '>=2.10.0 <3.0.0'
+
+name: hello_world_dart
+
+executables:
+ hello-world-dart:
+
+dependencies:
+ ansicolor: ^2.0.1
diff --git a/testing/resources/dotnet_hooks_csproj_repo/.pre-commit-hooks.yaml b/testing/resources/dotnet_hooks_csproj_repo/.pre-commit-hooks.yaml
index d005a74..0f514c1 100644
--- a/testing/resources/dotnet_hooks_csproj_repo/.pre-commit-hooks.yaml
+++ b/testing/resources/dotnet_hooks_csproj_repo/.pre-commit-hooks.yaml
@@ -1,4 +1,4 @@
-- id: dotnet example hook
+- id: dotnet-example-hook
name: dotnet example hook
entry: testeroni
language: dotnet
diff --git a/testing/resources/dotnet_hooks_sln_repo/.pre-commit-hooks.yaml b/testing/resources/dotnet_hooks_sln_repo/.pre-commit-hooks.yaml
index d005a74..0f514c1 100644
--- a/testing/resources/dotnet_hooks_sln_repo/.pre-commit-hooks.yaml
+++ b/testing/resources/dotnet_hooks_sln_repo/.pre-commit-hooks.yaml
@@ -1,4 +1,4 @@
-- id: dotnet example hook
+- id: dotnet-example-hook
name: dotnet example hook
entry: testeroni
language: dotnet
diff --git a/testing/util.py b/testing/util.py
index 12f22b5..791a2b9 100644
--- a/testing/util.py
+++ b/testing/util.py
@@ -72,6 +72,7 @@ def run_opts(
commit_msg_filename='',
checkout_type='',
is_squash_merge='',
+ rewrite_command='',
):
# These are mutually exclusive
assert not (all_files and files)
@@ -92,6 +93,7 @@ def run_opts(
commit_msg_filename=commit_msg_filename,
checkout_type=checkout_type,
is_squash_merge=is_squash_merge,
+ rewrite_command=rewrite_command,
)