History log of /netbsd-current/usr.bin/make/unit-tests/varmod-order-numeric.mk
Revision Date Author Comments
# 1.8 27-Sep-2022 rillig

tests/make: add tests for legacy local variables and sorting


# 1.7 09-Feb-2022 rillig

make: fix mistakes, spelling and typos in comments and manual page

No binary change for -DNDEBUG.


# 1.6 04-Feb-2022 rillig

make: use fixed type for comparing numbers using the modifier ':On'

When the modifier ':On' was added on 2021-07-30, there were concerns
that pre-C99 environments would not have the type 'long long', therefore
the type was made configurable, but parsing such numbers was hard-coded
to using strtoll.

To improve compatibility with C90 environments, use 'long' and 'strtol'
in these environments. In C99 environments, use 'long long' and
'strtoll', to account for larger file sizes.

If the flexibility of choosing yet another type for these numbers should
ever arise, it can still be implemented. Until then, reduce the number
of possible build configurations.


# 1.5 03-Aug-2021 rillig

tests/make: fix test for the variable modifier ':On'

The variable modifier ':On' sorts words numerically. If these words are
not numeric at all, they get assigned the numeric value 0. Internally,
':On' uses qsort for sorting the words. Since qsort is not specified to
use a stable sorting algorithm, the test data must only use words that
either are written in the same way or that are numerically different.

The test varmod-order failed this requirement by trying to numerically
sort a list of non-numeric words. This led to different results on BSD
and Ubuntu, as could be expected.

To fix the tests, distinguish between words and numbers in the tests.
While here, clean up the tests for all variants of the variable modifier
':O'.

Found by sjg on Ubuntu.


# 1.4 31-Jul-2021 rillig

tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


# 1.3 30-Jul-2021 rillig

make: handle parse errors in ':O' uniformly

Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.


# 1.2 30-Jul-2021 rillig

make: fix typo in manual page, add more tests for the new ':On'


# 1.1 30-Jul-2021 sjg

Add :On for numeric sort

Reviewed by: christos rillig


# 1.7 09-Feb-2022 rillig

make: fix mistakes, spelling and typos in comments and manual page

No binary change for -DNDEBUG.


# 1.6 04-Feb-2022 rillig

make: use fixed type for comparing numbers using the modifier ':On'

When the modifier ':On' was added on 2021-07-30, there were concerns
that pre-C99 environments would not have the type 'long long', therefore
the type was made configurable, but parsing such numbers was hard-coded
to using strtoll.

To improve compatibility with C90 environments, use 'long' and 'strtol'
in these environments. In C99 environments, use 'long long' and
'strtoll', to account for larger file sizes.

If the flexibility of choosing yet another type for these numbers should
ever arise, it can still be implemented. Until then, reduce the number
of possible build configurations.


# 1.5 03-Aug-2021 rillig

tests/make: fix test for the variable modifier ':On'

The variable modifier ':On' sorts words numerically. If these words are
not numeric at all, they get assigned the numeric value 0. Internally,
':On' uses qsort for sorting the words. Since qsort is not specified to
use a stable sorting algorithm, the test data must only use words that
either are written in the same way or that are numerically different.

The test varmod-order failed this requirement by trying to numerically
sort a list of non-numeric words. This led to different results on BSD
and Ubuntu, as could be expected.

To fix the tests, distinguish between words and numbers in the tests.
While here, clean up the tests for all variants of the variable modifier
':O'.

Found by sjg on Ubuntu.


# 1.4 31-Jul-2021 rillig

tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


# 1.3 30-Jul-2021 rillig

make: handle parse errors in ':O' uniformly

Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.


# 1.2 30-Jul-2021 rillig

make: fix typo in manual page, add more tests for the new ':On'


# 1.1 30-Jul-2021 sjg

Add :On for numeric sort

Reviewed by: christos rillig


# 1.6 04-Feb-2022 rillig

make: use fixed type for comparing numbers using the modifier ':On'

When the modifier ':On' was added on 2021-07-30, there were concerns
that pre-C99 environments would not have the type 'long long', therefore
the type was made configurable, but parsing such numbers was hard-coded
to using strtoll.

To improve compatibility with C90 environments, use 'long' and 'strtol'
in these environments. In C99 environments, use 'long long' and
'strtoll', to account for larger file sizes.

If the flexibility of choosing yet another type for these numbers should
ever arise, it can still be implemented. Until then, reduce the number
of possible build configurations.


# 1.5 03-Aug-2021 rillig

tests/make: fix test for the variable modifier ':On'

The variable modifier ':On' sorts words numerically. If these words are
not numeric at all, they get assigned the numeric value 0. Internally,
':On' uses qsort for sorting the words. Since qsort is not specified to
use a stable sorting algorithm, the test data must only use words that
either are written in the same way or that are numerically different.

The test varmod-order failed this requirement by trying to numerically
sort a list of non-numeric words. This led to different results on BSD
and Ubuntu, as could be expected.

To fix the tests, distinguish between words and numbers in the tests.
While here, clean up the tests for all variants of the variable modifier
':O'.

Found by sjg on Ubuntu.


# 1.4 31-Jul-2021 rillig

tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


# 1.3 30-Jul-2021 rillig

make: handle parse errors in ':O' uniformly

Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.


# 1.2 30-Jul-2021 rillig

make: fix typo in manual page, add more tests for the new ':On'


# 1.1 30-Jul-2021 sjg

Add :On for numeric sort

Reviewed by: christos rillig


# 1.5 03-Aug-2021 rillig

tests/make: fix test for the variable modifier ':On'

The variable modifier ':On' sorts words numerically. If these words are
not numeric at all, they get assigned the numeric value 0. Internally,
':On' uses qsort for sorting the words. Since qsort is not specified to
use a stable sorting algorithm, the test data must only use words that
either are written in the same way or that are numerically different.

The test varmod-order failed this requirement by trying to numerically
sort a list of non-numeric words. This led to different results on BSD
and Ubuntu, as could be expected.

To fix the tests, distinguish between words and numbers in the tests.
While here, clean up the tests for all variants of the variable modifier
':O'.

Found by sjg on Ubuntu.


# 1.4 31-Jul-2021 rillig

tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


# 1.3 30-Jul-2021 rillig

make: handle parse errors in ':O' uniformly

Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.


# 1.2 30-Jul-2021 rillig

make: fix typo in manual page, add more tests for the new ':On'


# 1.1 30-Jul-2021 sjg

Add :On for numeric sort

Reviewed by: christos rillig


# 1.4 31-Jul-2021 rillig

tests/make: split tests for the variable modifier ':O'

The tests for parse errors are now in varmod-order, which lets the other
tests focus on the desired behavior of the modifiers.


# 1.3 30-Jul-2021 rillig

make: handle parse errors in ':O' uniformly

Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.


# 1.2 30-Jul-2021 rillig

make: fix typo in manual page, add more tests for the new ':On'


# 1.1 30-Jul-2021 sjg

Add :On for numeric sort

Reviewed by: christos rillig