Skip to content

Commit

Permalink
Merge pull request #178 from MikeMirzayanov/dev-mikemirzayanov
Browse files Browse the repository at this point in the history
Fixed BOM issues, fixed tests and CI
  • Loading branch information
MikeMirzayanov authored Sep 5, 2023
2 parents abd32a9 + 8884fb8 commit c3f7215
Show file tree
Hide file tree
Showing 49 changed files with 2,068 additions and 325 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:

jobs:
tests-ubuntu1804-gpp:
if: false # Disabled job
strategy:
matrix:
os: [ubuntu-18.04]
Expand All @@ -34,6 +35,7 @@ jobs:
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}
tests-ubuntu1804-clang:
if: false # Disabled job
strategy:
matrix:
os: [ubuntu-18.04]
Expand Down Expand Up @@ -79,6 +81,7 @@ jobs:
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}
tests-ubuntu1804-gpp-32:
if: false # Disabled job
strategy:
matrix:
os: [ubuntu-18.04]
Expand All @@ -95,6 +98,7 @@ jobs:
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32
tests-ubuntu1804-clang-32:
if: false # Disabled job
strategy:
matrix:
os: [ubuntu-18.04]
Expand Down Expand Up @@ -147,7 +151,7 @@ jobs:
matrix:
os: [macos-11]
compiler: [g++]
version: [9, 10]
version: [10, 11, 12]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -200,10 +204,10 @@ jobs:
cd tests
bash ./run.sh ${{ matrix.compiler }}
tests-windows:
tests-windows-2019:
strategy:
matrix:
os: [windows-2019, windows-2022]
os: [windows-2019]
compiler: [msvc, g++, clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -213,3 +217,17 @@ jobs:
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}
tests-windows-2022:
strategy:
matrix:
os: [windows-2022]
compiler: [msvc, g++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}
7 changes: 3 additions & 4 deletions testlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ class random_t {

/* Sets seed by given value. */
void setSeed(long long _seed) {
_seed = (_seed ^ multiplier) & mask;
seed = _seed;
seed = (unsigned long long) _seed;
seed = (seed ^ multiplier) & mask;
}

#ifndef __BORLANDC__
Expand Down Expand Up @@ -3121,7 +3121,6 @@ void InStream::init(std::string fileName, TMode mode) {
}

reset();
skipBom();
}

void InStream::init(std::FILE *f, TMode mode) {
Expand All @@ -3137,7 +3136,6 @@ void InStream::init(std::FILE *f, TMode mode) {
name = "stderr", stdfile = true;

reset(f);
skipBom();
}

void InStream::skipBom() {
Expand Down Expand Up @@ -4628,6 +4626,7 @@ void registerTestlibCmd(int argc, char *argv[]) {

inf.init(args[1], _input);
ouf.init(args[2], _output);
ouf.skipBom();
ans.init(args[3], _answer);
}

Expand Down
7 changes: 7 additions & 0 deletions tests/docker/clang-11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM silkeh/clang:11
RUN apt-get update
RUN apt-get install -y git default-jre
COPY startup.sh /
WORKDIR /
RUN chmod +x /startup.sh
CMD ["/bin/bash", "/startup.sh"]
4 changes: 4 additions & 0 deletions tests/docker/clang-11/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker build . -t test-testlib-clang-11

4 changes: 4 additions & 0 deletions tests/docker/clang-11/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker run -it test-testlib-clang-11

10 changes: 10 additions & 0 deletions tests/docker/clang-11/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e -o pipefail

git clone https://github.com/MikeMirzayanov/testlib.git
cd testlib
git checkout dev-mikemirzayanov
cd tests
./run.sh v0 11
cd /
rm -rf testlib
7 changes: 7 additions & 0 deletions tests/docker/clang-latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM silkeh/clang:latest
RUN apt-get update
RUN apt-get install -y git default-jre valgrind
COPY startup.sh /
WORKDIR /
RUN chmod +x /startup.sh
CMD ["/bin/bash", "/startup.sh"]
4 changes: 4 additions & 0 deletions tests/docker/clang-latest/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker build . -t test-testlib-clang-latest

4 changes: 4 additions & 0 deletions tests/docker/clang-latest/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker run -it test-testlib-clang-latest

10 changes: 10 additions & 0 deletions tests/docker/clang-latest/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e -o pipefail

git clone https://github.com/MikeMirzayanov/testlib.git
cd testlib
git checkout dev-mikemirzayanov
cd tests
./run.sh v0 23
cd /
rm -rf testlib
7 changes: 7 additions & 0 deletions tests/docker/gcc-7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcc:7
RUN apt-get update
RUN apt-get install -y git default-jre valgrind
COPY startup.sh /
WORKDIR /
RUN chmod +x /startup.sh
CMD ["/bin/bash", "/startup.sh"]
4 changes: 4 additions & 0 deletions tests/docker/gcc-7/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker build . -t test-testlib-gcc-7

4 changes: 4 additions & 0 deletions tests/docker/gcc-7/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker run -it test-testlib-gcc-7

10 changes: 10 additions & 0 deletions tests/docker/gcc-7/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e -o pipefail

git clone https://github.com/MikeMirzayanov/testlib.git
cd testlib
git checkout dev-mikemirzayanov
cd tests
./run.sh g++ v0 11
cd /
rm -rf testlib
7 changes: 7 additions & 0 deletions tests/docker/gcc-latest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcc:latest
RUN apt-get update
RUN apt-get install -y git default-jre valgrind
COPY startup.sh /
WORKDIR /
RUN chmod +x /startup.sh
CMD ["/bin/bash", "/startup.sh"]
4 changes: 4 additions & 0 deletions tests/docker/gcc-latest/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker build . -t test-testlib-gcc-latest

4 changes: 4 additions & 0 deletions tests/docker/gcc-latest/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"C:\Program Files\Docker\Docker"\DockerCli.exe -SwitchLinuxEngine

docker run -it test-testlib-gcc-latest

10 changes: 10 additions & 0 deletions tests/docker/gcc-latest/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e -o pipefail

git clone https://github.com/MikeMirzayanov/testlib.git
cd testlib
git checkout dev-mikemirzayanov
cd tests
./run.sh g++ v0 23
cd /
rm -rf testlib
9 changes: 9 additions & 0 deletions tests/file-runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import subprocess
import sys

if len(sys.argv) > 1:
file_path = sys.argv[1]
subprocess.run([file_path])
else:
print("Use python runner.py <file>")
sys.exit(1)
Binary file removed tests/lib/msvc-2022-include.7z
Binary file not shown.
Loading

0 comments on commit c3f7215

Please sign in to comment.