[build] Debian package test.
Compared to the old testing, this adds coverage for Debian 12, Ubuntu Jammy, Ubuntu Noble and `dart compile exe`.
Bug: https://github.com/dart-lang/sdk/issues/26953
Change-Id: I0201b206086007d6b975f4b12234bdb9dd162d5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431363
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/tools/debian_package/test_debian_package.sh b/tools/debian_package/test_debian_package.sh
new file mode 100755
index 0000000..a770137
--- /dev/null
+++ b/tools/debian_package/test_debian_package.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+set -ex
+
+debfile="$1"
+checkout=$(pwd)
+
+function test_image() {
+ image="$1"
+ docker run -v $checkout:$checkout -w $checkout -i --rm $image tools/debian_package/test_debian_package_inside_docker.sh $debfile
+}
+
+test_image ubuntu:latest
+test_image ubuntu:devel
+test_image debian:stable
+test_image debian:oldstable
diff --git a/tools/debian_package/test_debian_package_inside_docker.sh b/tools/debian_package/test_debian_package_inside_docker.sh
new file mode 100755
index 0000000..28e7aec
--- /dev/null
+++ b/tools/debian_package/test_debian_package_inside_docker.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+# Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+set -ex
+
+# 'dart' starts absent
+! dart
+
+# Install package
+dpkg -i "$1"
+
+# Write test program
+echo 'main() { print("Hello, world!"); }' > /tmp/hello.dart
+
+# Test dart2js
+dart compile js /tmp/hello.dart
+
+# Test analyzer
+dart analyze /tmp/hello.dart
+
+# Test VM JIT
+dart /tmp/hello.dart
+
+# Test VM AOT
+dart compile exe -o /tmp/hello.exe /tmp/hello.dart
+/tmp/hello.exe
+
+# Uninstall package
+dpkg -r dart
+
+# 'dart' was removed
+! dart