keithbowes / iso10206-tests

A test suite for ISO 10206
GNU General Public License v2.0
4 stars 3 forks source link

Is there a list of what ISO 10206 constructs GPC does not support? #4

Open samiam95124 opened 1 year ago

samiam95124 commented 1 year ago

Hi, your repo needs a discussion group.

  1. Is there a list of ISO 10206 constructs that GPC does not support (since GPC is the only avaiable compiler that supports ISO 10206 at all).
  2. What are you doing about negative testing?

I'm the maintainer of the ISO 7185 (standard Pascal) tests:

https://github.com/samiam95124/Pascal-P6/tree/master/standard_tests

I believe BSI had a series of ISO 10206 tests, but I don't know the availability of those tests. When asked about the ISO 7185 tests the BSI representative stated "I don't know the status of those tests but I think they are lost". Nice.

The ISO 7185 tests above were checked against the BSI tests, meaning there is nothing the BSI tests check for that are not present in the ISO 7185 tests listed above (and they actually go far beyond the BSI tests). You might ask around if someone has a copy of the ISO 10206 tests they could let you use to do the same for your tests.

kai-burghardt commented 1 year ago

[…] your repo needs a discussion group.

I disagree. The project scope is very well defined, thus there is no necessity for discussions.

Is there a list of ISO 10206 constructs that GPC does not support […]

There is a statement in the manual’s intro:

The Extended Pascal features still missing from GPC are qualified module import, protected module export variables, set types with variable bounds, structured value initializers and expressions as subrange lower bounds.

What are you doing about negative testing?

A processor accepting a superset of requirements the ISO standard 10206 dictates may declare them an extension, clause 3.3, hence testing that something fails is pointless.

samiam95124 commented 1 year ago
  1. Thanks for the information.
  2. That's not what negative testing is. An example of negative testing would be:

var a: array [1..10] of integer;

begin

a[11] := 0;

For ISO 10206 these cases are listed in "Annex D Errors and dynamic-violations". The BSI tests give both positive and negative testing, as does the Pascal-P testing suite.

kai-burghardt commented 1 year ago
var a: array [1..10] of integer;
begin
a[11] := 0;

I’m sorry for not being too familiar with the term negative testing. I can’t speak for Keith, but since this project was originally created for testing FPC – a mature compiler – testing for bugs/errors such as the one you mentioned is not really in (the original) scope. (→ Undoubtedly the FPC would reject that code with a compile-time error, ergo there is no need to test that.)

keithbowes commented 1 year ago

Yeah, this was back when I was trying to add support of ISO 10206 to Free Pascal, but all my patches were rejected. Hopefully, FPC will get some more features from the standards down the road (they've already added the ** operator, the Get, Put, WriteStr, and ReadStr procedures, and maybe other things; I'd love to see schemata, conformant arrays, access control on exported symbols, reexporting symbols, default values for compound data types, etc), but obviously it won't be from me.

GNU Pascal pretty much supports all of the standards I think. It even supports thing from the Object Pascal WD like abstract classes and class views. I know one thing it doesn't support is binding non-file types. I'm not sure what the logic behind allowing to bind to non-file types is, but I suspect it's intended to be the standard way to write binary files (e.g. bind a record that represents the structure of a binary file).

samiam95124 commented 1 year ago

What was the reason given for rejecting the patches?

I am not a 10206 expert, but I think the binding to non-files is just an external linkage thing. For example in Pascal-P6, it supports:

program test(mynumber);

var mynumber: integer;

begin

    write('The number was: ', mynumber)

end.

Executed as:

> test 42
The number was: 42

This is allowed for in the ISO 7185 standard/original Pascal. It just indicates that the variable is linked to the outside environment of the program, but does not specify how it gets resolved.

samiam95124 commented 1 year ago

In ISO 10206 "technical development"

Bindable variables may be bound to external entities (file storage, real-time clock, command lines, etc.).