Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.ports linguist-language=Scheme
*.rosetta linguist-language=Scheme
6 changes: 3 additions & 3 deletions .github/workflows/interpreter-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:

- name: Run Python Interpreter Tests
run: |
python3 ports-py/interpreter-tests.py
python3 rosetta-test-py/interpreter-tests.py
- name: Run JavaScript Interpreter Tests
run: |
node ports-js/interpreter-tests.js
node rosetta-test-js/interpreter-tests.js
- name: Run Ruby Interpreter Tests
run: |
ruby ports-rb/interpreter-tests.rb
ruby rosetta-test-rb/interpreter-tests.rb


4 changes: 2 additions & 2 deletions .github/workflows/javascript-suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
node-version: "lts/Hydrogen"
- name: Run JSON RFC Tests
run: |
node ports-js/json-rfc.js
node rosetta-test-js/json-rfc.js
- name: Run URL Tests
run: |
node ports-js/url-parsing.js
node rosetta-test-js/url-parsing.js
12 changes: 6 additions & 6 deletions .github/workflows/python-suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run SMTP Tests
run: |
python3 ports-py/smtp.py
python3 rosetta-test-py/smtp.py
- name: Run Sendmail Tests for RedMail
run: |
pip install -r ports-py/sendmail-redmail.requirements.txt
python3 ports-py/sendmail-redmail.py
pip install -r rosetta-test-py/sendmail-redmail.requirements.txt
python3 rosetta-test-py/sendmail-redmail.py
- name: Run Sendmail Tests for Python Emails
run: |
pip install -r ports-py/sendmail-python-emails.requirements.txt
python3 ports-py/sendmail-python-emails.py
pip install -r rosetta-test-py/sendmail-python-emails.requirements.txt
python3 rosetta-test-py/sendmail-python-emails.py
- name: Run JSON RFC Tests
run: |
python3 ports-py/json-rfc.py
python3 rosetta-test-py/json-rfc.py
4 changes: 2 additions & 2 deletions .github/workflows/ruby-suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
ruby-version: "3.4"
- name: Run SMTP Tests
run: |
ruby ports-rb/smtp.rb
ruby rosetta-test-rb/smtp.rb
- name: Run JSON RFC Tests
run: |
ruby ports-rb/json-rfc.rb
ruby rosetta-test-rb/json-rfc.rb
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__pycache__/
*.vscode
_notes/
ports-j/**/target/
rosetta-test-j/**/target/
.idea/
.python-version
ports.code-workspace
rosetta-test.code-workspace
.devenv
.direnv
6 changes: 3 additions & 3 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'PortsS',
#directory : 'ports-s',
#baseline : 'RosettaTestS',
#directory : 'rosetta-test-s',
#platforms : [ #squeak ]
}
],
#testing : {
#categories : [ 'PortsS-Suites' ]
#categories : [ 'RosettaTestS-Suites' ]
}
}
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
# PorTS [![Python Suites](https://github.com/codeZeilen/ports-prototype/actions/workflows/python-suites.yml/badge.svg)](https://github.com/codeZeilen/ports-prototype/actions/workflows/python-suites.yml)
# RosettaTest [![Python Suites](https://github.com/codeZeilen/rosetta-test/actions/workflows/python-suites.yml/badge.svg)](https://github.com/codeZeilen/rosetta-test/actions/workflows/python-suites.yml)

With the PorTS project, you only have to write a test suite once for multiple implementations.
With the RosettaTest project, you only have to write a test suite once for multiple implementations.

(This is still a prototype project. Expect major architectural or API changes, as well as major bugs and inconsistencies.)

## Trying it out

Currently, the best-supported language is Python. To get an idea of how to create and port PorTS test suites, try the Python version of the SMTP test suite, which runs against the SMTP implementation in the Python standard library.
Currently, the best-supported language is Python. To get an idea of how to create and port RosettaTest suites, try the Python version of the SMTP test suite, which runs against the SMTP implementation in the Python standard library.

You can run the SMTP test suite in Python by executing
You can run the SMTP test suite in Python by executing:

```Python
python3 ports-py/smtp.py
python3 rosetta-test-py/smtp.py
```

This will run the test suite from `/suites/smtp.ports` using the mappings in `/ports-py/smtp.py`.
This will run the test suite from `/rosetta-test-suites/smtp.rosetta` using the mappings in `/rosetta-test-py/smtp.py`.


## Structure of the Repository

- The core PorTS language (`/ports`)
- PorTS interpreters for
- Python (`/ports-py`)
- Ruby (`/ports-rb`)
- JavaScript (`/ports-js`)
- Smalltalk (`/ports-s`)
- A full test suite for
- SMTP (`/suites/smtp.ports`)
- RFC JSON parsing (`suites/json-rfc.ports`)
- Prototype test suites for
- sending MIME documents (`/suites/sendmail.ports`)
- RFC URI parsing (`suites/url-parsing-rfc.ports`)
- The core RosettaTest language (`/rosetta-test`)
- RosettaTest language interpreters for
- Python (`/rosetta-test-py`)
- Ruby (`/rosetta-test-rb`)
- JavaScript (`/rosetta-test-js`)
- Smalltalk (`/rosetta-test-s`)
- A full test suite (`/rosetta-test-suites`) for
- SMTP (`smtp.rosetta`)
- RFC JSON parsing (`json-rfc.rosetta`)
- Prototype test suites (`/rosetta-test-suites`) for
- sending MIME documents (`sendmail.rosetta`)
- RFC URI parsing (`url-parsing-rfc.rosetta`)


## How it Works (Overview)

The test suites are written in the PorTS language. The parts that are implementation-specific are designated as _placeholders_. For every implementation that you want to test, you need to fill in these placeholders.
The test suites are written in the RosettaTest language. The parts that are implementation-specific are designated as _placeholders_. For every implementation that you want to test, you need to fill in these placeholders.

Thus, if you want to execute a PorTS suite for your project, you need:
Thus, if you want to execute a RosettaTest suite for your project, you need:

1. A _PorTS interpreter_ for your language
1. A _RosettaTest language interpreter_ for your language
2. A _mapping_ that fills each placeholder with a function from the implementation. Often the mapping will not be 1:1, so you might need to write additional code to map the behavior to the expected behavior of the placeholder.


## Acknowledgements
- Syntax tests based on the corpus from [tree-sitter-scheme](https://github.com/6cdh/tree-sitter-scheme)
- JSON-RFC Suite tests are based on the [JSONTestSuite](https://github.com/nst/JSONTestSuite)
- JSON-RFC Suite tests are based on the [JSONTestSuite](https://github.com/nst/JSONTestSuite)
19 changes: 0 additions & 19 deletions ports-s/BaselineOfPortsS/BaselineOfPortsS.class.st

This file was deleted.

1 change: 0 additions & 1 deletion ports-s/BaselineOfPortsS/package.st

This file was deleted.

1 change: 0 additions & 1 deletion ports-s/PortsS-Core/package.st

This file was deleted.

7 changes: 0 additions & 7 deletions ports-s/PortsS-Interpreter/Collection.extension.st

This file was deleted.

7 changes: 0 additions & 7 deletions ports-s/PortsS-Interpreter/False.extension.st

This file was deleted.

31 changes: 0 additions & 31 deletions ports-s/PortsS-Interpreter/Object.extension.st

This file was deleted.

5 changes: 0 additions & 5 deletions ports-s/PortsS-Interpreter/PortsSyntaxError.class.st

This file was deleted.

5 changes: 0 additions & 5 deletions ports-s/PortsS-Interpreter/PortsTypeError.class.st

This file was deleted.

1 change: 0 additions & 1 deletion ports-s/PortsS-Interpreter/package.st

This file was deleted.

101 changes: 0 additions & 101 deletions ports-s/PortsS-Suites/PortsFSSuite.class.st

This file was deleted.

Loading