Skip to content

Commit 2b09a67

Browse files
Merge pull request #11957 from dotty-staging/add-packtest
Fix broken script on Windows
2 parents f01c14d + 9a22d77 commit 2b09a67

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

.github/workflows/ci.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ jobs:
149149
run: sbt ";scala3-bootstrapped/compile"
150150
shell: cmd
151151

152+
- name: build binary
153+
run: sbt "dist/pack" & bash -version
154+
shell: cmd
155+
156+
- name: cygwin tests
157+
run: '"C:\Program Files\cygwin64\bin\bash" ./project/scripts/winCmdTests'
158+
shell: cmd
159+
160+
- name: msys tests
161+
run: '"C:\Program Files\Git\bin\bash" ./project/scripts/winCmdTests'
162+
shell: cmd
163+
152164
- name: Scala.js Test
153165
run: sbt ";sjsJUnitTests/test ;sjsCompilerTests/test"
154166
shell: cmd

dist/bin/common

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# save terminal settings
88
saved_stty=$(stty -g 2>/dev/null)
99
# clear on error so we don't later try to restore them
10-
if [[ ! $? ]]; then
10+
if [[ ! $? ]]; then
1111
saved_stty=""
1212
fi
1313

@@ -135,7 +135,7 @@ fi
135135
find_lib () {
136136
local lib=$(find $PROG_HOME/lib/ -name "$1")
137137
if [ -n "$CYGPATHCMD" ]; then
138-
$CYGPATHCMD -am $lib
138+
"$CYGPATHCMD" -am $lib
139139
elif [[ $mingw || $msys ]]; then
140140
echo $lib | sed 's|/|\\\\|g'
141141
else

project/scripts/bootstrapCmdTests

+3
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ echo "testing i11644"
6464
cwd=$(pwd)
6565
clear_out "$OUT"
6666
(cd "$OUT" && "$cwd/bin/scalac" "$cwd/tests/pos/i11644.scala" && "$cwd/bin/scalac" "$cwd/tests/pos/i11644.scala")
67+
68+
# check options specified in files
69+
./bin/scalac @project/scripts/options "$SOURCE"

project/scripts/options

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-Xprint:frontend -Ylog:frontend
2+
-Ycheck:all

project/scripts/winCmdTests

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
PREFIX="dist/target/pack"
5+
SOURCE="tests/pos/HelloWorld.scala"
6+
$PREFIX/bin/scalac @project/scripts/options "$SOURCE"
7+
$PREFIX/bin/scalac -d out "$SOURCE"
8+
$PREFIX/bin/scala -classpath out HelloWorld
9+
$PREFIX/bin/scala -classpath out -J-Xmx512m HelloWorld
10+
mkdir -p _site && $PREFIX/bin/scaladoc -d _site -project Hello "$SOURCE"

0 commit comments

Comments
 (0)