From 7e6dea628a188bf58216fed824bab47afa10b23a Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Mon, 24 Mar 2025 12:07:25 +0100 Subject: [PATCH] fix: remove style checks from all profiles (#1919) * Assertions test and related changes * Disable style checks in all profiles * Fix style-related tests * Update PR number in user changes --- BREAKING.md | 1 + doc/catalog-format-spec.md | 12 ++++-- doc/user-changes.md | 22 +++++++++++ src/alire/alire-templates-builtins.ads | 12 +++--- src/alire/alire-utils-switches.ads | 4 +- ...crate_test_tests_common_name_tests_ads.ads | 19 +++++++--- ..._src_name_testsxassertions_enabled_adb.ads | 36 ++++++++++++++++++ ..._tests_src_name_testsxexample_test_adb.ads | 30 --------------- src/templates/r.adb | 37 ++++++++++--------- support/embedder/templates.hash | 2 +- .../crate_test/tests/common/name_tests.ads | 5 +++ .../src/name_tests-assertions_enabled.adb | 10 +++++ .../tests/src/name_tests-example_test.adb | 7 ---- .../tests/build/hashes/hashing-inputs/test.py | 15 ++------ .../build_profile/custom_profiles/test.py | 4 +- testsuite/tests/build_profile/default/test.py | 2 +- testsuite/tests/test/crate-init/test.py | 2 +- testsuite/tests/test/default-failure/test.py | 16 ++++---- testsuite/tests/test/filtering/test.py | 2 +- testsuite/tests/test/nested-filtering/test.py | 2 +- testsuite/tests/test/nested-tests/test.py | 2 +- .../tests/workflows/init-options/test.py | 6 +-- 22 files changed, 146 insertions(+), 102 deletions(-) create mode 100644 src/templates/r-crate_test_tests_src_name_testsxassertions_enabled_adb.ads delete mode 100644 src/templates/r-crate_test_tests_src_name_testsxexample_test_adb.ads create mode 100644 templates/crate_test/tests/src/name_tests-assertions_enabled.adb delete mode 100644 templates/crate_test/tests/src/name_tests-example_test.adb diff --git a/BREAKING.md b/BREAKING.md index fee6ae08..f3af3249 100644 --- a/BREAKING.md +++ b/BREAKING.md @@ -10,6 +10,7 @@ may change. - manifest: added `[test]` section. - manifest: array of licenses is no longer supported (SPDX expressions allow multiple licenses). - alr: setting a builtin without `--builtin` will emit a new warning. +- alr: style checks are now disabled by default in all build profiles. ### We are here diff --git a/doc/catalog-format-spec.md b/doc/catalog-format-spec.md index 96731a01..2ac18020 100644 --- a/doc/catalog-format-spec.md +++ b/doc/catalog-format-spec.md @@ -439,7 +439,7 @@ static, i.e. they cannot depend on the context. ``` - `test`: optional section that configures the behavior of `alr test`. - The test section accepts dynamic expressions, making it possible to use + The test section accepts dynamic expressions, making it possible to use different test runners on different platforms. The general syntax for this section is: @@ -718,10 +718,16 @@ static, i.e. they cannot depend on the context. [build-switches] release.runtime_checks = "Everything" ``` - To disable style checks for all profiles: + Note that style checks are disabled by default in all profiles. To enable style checks for all profiles: ```toml [build-switches] - "*".style_checks = "No" + "*".style_checks = "Yes" + ``` + + Or, to enable style checks only in, e.g., the validation profile: + ```toml + [build-switches] + validation.style_checks = "Yes" ``` All switch categories also accept a custom list of switches, for instance: diff --git a/doc/user-changes.md b/doc/user-changes.md index 44a7b8ce..6544d995 100644 --- a/doc/user-changes.md +++ b/doc/user-changes.md @@ -6,6 +6,28 @@ stay on top of `alr` new features. ## Release `3.0` +### Style checks disabled by default in all build profiles + +PR [#1919](https://github.com/alire-project/alire/pull/1919) + +Style checks are now disabled by default in all build profiles (release, validation, and development). Previously, style checks were enabled by default in the validation and development profiles. This change intends to avoid unwanted compiler errors related to style issues. + +To enable former style checks, you can use the `build-switches` table in your manifest: + +```toml +[build-switches] +"*".style_checks = "Yes" # Enable for all profiles +``` + +Or for a specific profile: + +```toml +[build-switches] +validation.style_checks = "Yes" # Enable only for validation profile +``` + +Alternatively, `gnatformat` is available in the community index to easily apply the default GNAT style. + ### New `--builtin` switch for `alr settings` PR [#1912](https://github.com/alire-project/alire/pull/1912) diff --git a/src/alire/alire-templates-builtins.ads b/src/alire/alire-templates-builtins.ads index 870b35f5..87d92087 100644 --- a/src/alire/alire-templates-builtins.ads +++ b/src/alire/alire-templates-builtins.ads @@ -14,7 +14,7 @@ with R.Crate_Lib_Src_Name_Ads; with R.Crate_Test_Tests_Alire_Toml; with R.Crate_Test_Tests_Common_Name_Tests_Ads; with R.Crate_Test_Tests_Crate_Test_Tests_Gpr; -with R.Crate_Test_Tests_Src_Name_Testsxexample_Test_Adb; +with R.Crate_Test_Tests_Src_Name_Testsxassertions_Enabled_Adb; private with Alire.TOML_Adapters; @@ -73,11 +73,11 @@ package Alire.Templates.Builtins is -- Files to initialize a test crate within a regular crate Crate_Test : constant Tree := New_Tree - .Append (".gitignore", +R.Crate_Common_Gitignore_Hidden.Content) - .Append ("alire.toml", +R.Crate_Test_Tests_Alire_Toml.Content) - .Append ("@_NAME_@_tests.gpr", +R.Crate_Test_Tests_Crate_Test_Tests_Gpr.Content) - .Append ("common/@_NAME_@_tests.ads", +R.Crate_Test_Tests_Common_Name_Tests_Ads.Content) - .Append ("src/@_NAME_@_tests-example_test.adb", +R.Crate_Test_Tests_Src_Name_Testsxexample_Test_Adb.Content) + .Append (".gitignore", +R.Crate_Common_Gitignore_Hidden.Content) + .Append ("alire.toml", +R.Crate_Test_Tests_Alire_Toml.Content) + .Append ("@_NAME_@_tests.gpr", +R.Crate_Test_Tests_Crate_Test_Tests_Gpr.Content) + .Append ("common/@_NAME_@_tests.ads", +R.Crate_Test_Tests_Common_Name_Tests_Ads.Content) + .Append ("src/@_NAME_@_tests-assertions_enabled.adb", +R.Crate_Test_Tests_Src_Name_Testsxassertions_Enabled_Adb.Content) ; private diff --git a/src/alire/alire-utils-switches.ads b/src/alire/alire-utils-switches.ads index 72d5775e..994b96c6 100644 --- a/src/alire/alire-utils-switches.ads +++ b/src/alire/alire-utils-switches.ads @@ -160,7 +160,7 @@ is Runtime_Checks => (Custom => False, Value => Everything), Compile_Checks => (Custom => False, Value => Errors), Contracts => (Custom => False, Value => Yes), - Style_Checks => (Custom => False, Value => Yes), + Style_Checks => (Custom => False, Value => No), Ada_Version => (Custom => False, Value => Compiler_Default), Source_Encoding => (Custom => False, Value => UTF_8)); @@ -170,7 +170,7 @@ is Runtime_Checks => (Custom => False, Value => Default), Compile_Checks => (Custom => False, Value => Warnings), Contracts => (Custom => False, Value => No), - Style_Checks => (Custom => False, Value => Yes), + Style_Checks => (Custom => False, Value => No), Ada_Version => (Custom => False, Value => Compiler_Default), Source_Encoding => (Custom => False, Value => UTF_8)); diff --git a/src/templates/r-crate_test_tests_common_name_tests_ads.ads b/src/templates/r-crate_test_tests_common_name_tests_ads.ads index c30f2d23..2215ff85 100644 --- a/src/templates/r-crate_test_tests_common_name_tests_ads.ads +++ b/src/templates/r-crate_test_tests_common_name_tests_ads.ads @@ -10,10 +10,19 @@ package r.crate_test_tests_common_name_tests_ads is use Ada.Streams; Content : aliased constant Stream_Element_Array := - (112, 97, 99, 107, 97, 103, 101, 32, 64, 95, 67, 65, 80, 73, - 84, 65, 76, 73, 90, 69, 58, 78, 65, 77, 69, 95, 64, 95, - 84, 101, 115, 116, 115, 32, 105, 115, 10, 10, 101, 110, 100, 32, - 64, 95, 67, 65, 80, 73, 84, 65, 76, 73, 90, 69, 58, 78, - 65, 77, 69, 95, 64, 95, 84, 101, 115, 116, 115, 59, 10); + (112, 114, 97, 103, 109, 97, 32, 87, 97, 114, 110, 105, 110, 103, + 115, 32, 40, 79, 102, 102, 41, 59, 10, 119, 105, 116, 104, 32, + 65, 100, 97, 46, 65, 115, 115, 101, 114, 116, 105, 111, 110, 115, + 59, 32, 117, 115, 101, 32, 65, 100, 97, 46, 65, 115, 115, 101, + 114, 116, 105, 111, 110, 115, 59, 10, 45, 45, 32, 32, 77, 97, + 107, 101, 32, 65, 115, 115, 101, 114, 116, 32, 118, 105, 115, 105, + 98, 108, 101, 32, 116, 111, 32, 99, 104, 105, 108, 100, 114, 101, + 110, 10, 112, 114, 97, 103, 109, 97, 32, 87, 97, 114, 110, 105, + 110, 103, 115, 32, 40, 79, 110, 41, 59, 10, 10, 112, 97, 99, + 107, 97, 103, 101, 32, 64, 95, 67, 65, 80, 73, 84, 65, 76, + 73, 90, 69, 58, 78, 65, 77, 69, 95, 64, 95, 84, 101, 115, + 116, 115, 32, 105, 115, 10, 10, 101, 110, 100, 32, 64, 95, 67, + 65, 80, 73, 84, 65, 76, 73, 90, 69, 58, 78, 65, 77, 69, + 95, 64, 95, 84, 101, 115, 116, 115, 59, 10); end r.crate_test_tests_common_name_tests_ads; diff --git a/src/templates/r-crate_test_tests_src_name_testsxassertions_enabled_adb.ads b/src/templates/r-crate_test_tests_src_name_testsxassertions_enabled_adb.ads new file mode 100644 index 00000000..ec6e1723 --- /dev/null +++ b/src/templates/r-crate_test_tests_src_name_testsxassertions_enabled_adb.ads @@ -0,0 +1,36 @@ + +-- Generated by awsres from /support/embedder/embedder.sh + +pragma Style_Checks (Off); + +with Ada.Streams; + +package r.crate_test_tests_src_name_testsxassertions_enabled_adb is + + use Ada.Streams; + + Content : aliased constant Stream_Element_Array := + (112, 114, 111, 99, 101, 100, 117, 114, 101, 32, 64, 95, 67, 65, + 80, 73, 84, 65, 76, 73, 90, 69, 58, 78, 65, 77, 69, 95, + 64, 95, 84, 101, 115, 116, 115, 46, 65, 115, 115, 101, 114, 116, + 105, 111, 110, 115, 95, 69, 110, 97, 98, 108, 101, 100, 32, 105, + 115, 10, 98, 101, 103, 105, 110, 10, 32, 32, 32, 98, 101, 103, + 105, 110, 10, 32, 32, 32, 32, 32, 32, 112, 114, 97, 103, 109, + 97, 32, 65, 115, 115, 101, 114, 116, 32, 40, 70, 97, 108, 115, + 101, 44, 32, 34, 83, 104, 111, 117, 108, 100, 32, 114, 97, 105, + 115, 101, 34, 41, 59, 10, 32, 32, 32, 101, 120, 99, 101, 112, + 116, 105, 111, 110, 10, 32, 32, 32, 32, 32, 32, 119, 104, 101, + 110, 32, 111, 116, 104, 101, 114, 115, 32, 61, 62, 10, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 114, 101, 116, 117, 114, 110, 59, + 32, 45, 45, 32, 112, 114, 111, 112, 101, 114, 108, 121, 32, 114, + 97, 105, 115, 101, 100, 10, 32, 32, 32, 101, 110, 100, 59, 10, + 32, 32, 32, 114, 97, 105, 115, 101, 32, 80, 114, 111, 103, 114, + 97, 109, 95, 69, 114, 114, 111, 114, 32, 119, 105, 116, 104, 32, + 34, 65, 115, 115, 101, 114, 116, 105, 111, 110, 32, 100, 105, 100, + 32, 110, 111, 116, 32, 114, 97, 105, 115, 101, 34, 59, 10, 101, + 110, 100, 32, 64, 95, 67, 65, 80, 73, 84, 65, 76, 73, 90, + 69, 58, 78, 65, 77, 69, 95, 64, 95, 84, 101, 115, 116, 115, + 46, 65, 115, 115, 101, 114, 116, 105, 111, 110, 115, 95, 69, 110, + 97, 98, 108, 101, 100, 59, 10); + +end r.crate_test_tests_src_name_testsxassertions_enabled_adb; diff --git a/src/templates/r-crate_test_tests_src_name_testsxexample_test_adb.ads b/src/templates/r-crate_test_tests_src_name_testsxexample_test_adb.ads deleted file mode 100644 index 24c9d347..00000000 --- a/src/templates/r-crate_test_tests_src_name_testsxexample_test_adb.ads +++ /dev/null @@ -1,30 +0,0 @@ - --- Generated by awsres from /support/embedder/embedder.sh - -pragma Style_Checks (Off); - -with Ada.Streams; - -package r.crate_test_tests_src_name_testsxexample_test_adb is - - use Ada.Streams; - - Content : aliased constant Stream_Element_Array := - (119, 105, 116, 104, 32, 65, 100, 97, 46, 65, 115, 115, 101, 114, - 116, 105, 111, 110, 115, 59, 10, 10, 112, 114, 111, 99, 101, 100, - 117, 114, 101, 32, 64, 95, 67, 65, 80, 73, 84, 65, 76, 73, - 90, 69, 58, 78, 65, 77, 69, 95, 64, 95, 84, 101, 115, 116, - 115, 46, 69, 120, 97, 109, 112, 108, 101, 95, 84, 101, 115, 116, - 32, 105, 115, 10, 98, 101, 103, 105, 110, 10, 32, 32, 32, 65, - 100, 97, 46, 65, 115, 115, 101, 114, 116, 105, 111, 110, 115, 46, - 65, 115, 115, 101, 114, 116, 32, 40, 84, 114, 117, 101, 41, 59, - 10, 32, 32, 32, 45, 45, 32, 32, 69, 120, 105, 116, 32, 119, - 105, 116, 104, 32, 99, 111, 100, 101, 32, 47, 61, 32, 48, 32, - 111, 114, 32, 114, 97, 105, 115, 101, 32, 101, 120, 99, 101, 112, - 116, 105, 111, 110, 32, 116, 111, 32, 102, 97, 105, 108, 32, 97, - 32, 116, 101, 115, 116, 10, 101, 110, 100, 32, 64, 95, 67, 65, - 80, 73, 84, 65, 76, 73, 90, 69, 58, 78, 65, 77, 69, 95, - 64, 95, 84, 101, 115, 116, 115, 46, 69, 120, 97, 109, 112, 108, - 101, 95, 84, 101, 115, 116, 59, 10); - -end r.crate_test_tests_src_name_testsxexample_test_adb; diff --git a/src/templates/r.adb b/src/templates/r.adb index e76e725d..b712eb8f 100644 --- a/src/templates/r.adb +++ b/src/templates/r.adb @@ -11,10 +11,10 @@ with r.crate_common_gitignore_hidden; with r.crate_lib_alire_toml; with r.crate_lib_name_gpr; with r.crate_lib_src_name_ads; -with r.crate_test_tests_common_name_tests_ads; with r.crate_test_tests_alire_toml; +with r.crate_test_tests_common_name_tests_ads; with r.crate_test_tests_crate_test_tests_gpr; -with r.crate_test_tests_src_name_testsxexample_test_adb; +with r.crate_test_tests_src_name_testsxassertions_enabled_adb; with Alire.Templates; with GNAT.Calendar; @@ -31,47 +31,48 @@ package body r is Register ("crate_bin/alire.toml", r.crate_bin_alire_toml.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_bin/name.gpr", r.crate_bin_name_gpr.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_bin/src/name.adb", r.crate_bin_src_name_adb.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_common/gitignore.hidden", r.crate_common_gitignore_hidden.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_lib/alire.toml", r.crate_lib_alire_toml.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_lib/name.gpr", r.crate_lib_name_gpr.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_lib/src/name.ads", r.crate_lib_src_name_ads.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 19, 0.0)); - Register - ("crate_test/tests/common/name_tests.ads", - r.crate_test_tests_common_name_tests_ads.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 36, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register ("crate_test/tests/alire.toml", r.crate_test_tests_alire_toml.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 53, 26, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); + Register + ("crate_test/tests/common/name_tests.ads", + r.crate_test_tests_common_name_tests_ads.Content'Access, + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 47, 17, 0.0)); Register ("crate_test/tests/crate_test_tests.gpr", r.crate_test_tests_crate_test_tests_gpr.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 36, 0.0)); + GNAT.Calendar.Time_Of (2025, 03, 23, 13, 44, 33, 0.0)); Register - ("crate_test/tests/src/name_tests-example_test.adb", - r.crate_test_tests_src_name_testsxexample_test_adb.Content'Access, - GNAT.Calendar.Time_Of (2025, 03, 23, 12, 22, 36, 0.0)); + ("crate_test/tests/src/name_tests-assertions_enabled." + & "adb", + r.crate_test_tests_src_name_testsxassertions_enabled_adb.Content'Access, + GNAT.Calendar.Time_Of (2025, 03, 23, 14, 58, 35, 0.0)); end if; end Init; diff --git a/support/embedder/templates.hash b/support/embedder/templates.hash index 93037fcd..4553fdb0 100644 --- a/support/embedder/templates.hash +++ b/support/embedder/templates.hash @@ -1 +1 @@ -bd09b5bb86786de540ea1abb442a642c0f9b363321c3c40b40a4b86a6d94cd27 +c75b12dca0d586a0869a7ab3689acc750a461e2760517ff00efda577e9f2a068 diff --git a/templates/crate_test/tests/common/name_tests.ads b/templates/crate_test/tests/common/name_tests.ads index 32042840..37e39c39 100644 --- a/templates/crate_test/tests/common/name_tests.ads +++ b/templates/crate_test/tests/common/name_tests.ads @@ -1,3 +1,8 @@ +pragma Warnings (Off); +with Ada.Assertions; use Ada.Assertions; +-- Make Assert visible to children +pragma Warnings (On); + package @_CAPITALIZE:NAME_@_Tests is end @_CAPITALIZE:NAME_@_Tests; diff --git a/templates/crate_test/tests/src/name_tests-assertions_enabled.adb b/templates/crate_test/tests/src/name_tests-assertions_enabled.adb new file mode 100644 index 00000000..e92bb7d6 --- /dev/null +++ b/templates/crate_test/tests/src/name_tests-assertions_enabled.adb @@ -0,0 +1,10 @@ +procedure @_CAPITALIZE:NAME_@_Tests.Assertions_Enabled is +begin + begin + pragma Assert (False, "Should raise"); + exception + when others => + return; -- properly raised + end; + raise Program_Error with "Assertion did not raise"; +end @_CAPITALIZE:NAME_@_Tests.Assertions_Enabled; diff --git a/templates/crate_test/tests/src/name_tests-example_test.adb b/templates/crate_test/tests/src/name_tests-example_test.adb deleted file mode 100644 index 78ac5f4b..00000000 --- a/templates/crate_test/tests/src/name_tests-example_test.adb +++ /dev/null @@ -1,7 +0,0 @@ -with Ada.Assertions; - -procedure @_CAPITALIZE:NAME_@_Tests.Example_Test is -begin - Ada.Assertions.Assert (True); - -- Exit with code /= 0 or raise exception to fail a test -end @_CAPITALIZE:NAME_@_Tests.Example_Test; diff --git a/testsuite/tests/build/hashes/hashing-inputs/test.py b/testsuite/tests/build/hashes/hashing-inputs/test.py index 22006a6d..1757404e 100644 --- a/testsuite/tests/build/hashes/hashing-inputs/test.py +++ b/testsuite/tests/build/hashes/hashing-inputs/test.py @@ -45,10 +45,7 @@ assert_eq( 'external:TEST_UNDECLARED=used_by_another_crate\n' # modified GPR external 'profile:libhello=VALIDATION\n' # build profile 'switches:libhello=-O3,-fdata-sections,-ffunction-sections,-g,-gnatVa,' - '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe,-gnaty-d,-gnaty3,' - '-gnatyA,-gnatyB,-gnatyI,-gnatyO,-gnatyS,-gnatya,-gnatyb,-gnatyc,-gnatye,' - '-gnatyf,-gnatyh,-gnatyi,-gnatyk,-gnatyl,-gnatym,-gnatyn,-gnatyp,-gnatyr,' - '-gnatyt,-gnatyu,-gnatyx\n' + '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe\n' f'version:gnat_external={external_compiler_version()}\n', # compiler version hash_input("libhello")) @@ -68,10 +65,7 @@ assert_eq( 'external:LIBRARY_TYPE=default\n' 'profile:hello=VALIDATION\n' 'switches:hello=-O3,-fdata-sections,-ffunction-sections,-g,-gnatVa,' - '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe,-gnaty-d,-gnaty3,' - '-gnatyA,-gnatyB,-gnatyI,-gnatyO,-gnatyS,-gnatya,-gnatyb,-gnatyc,-gnatye,' - '-gnatyf,-gnatyh,-gnatyi,-gnatyk,-gnatyl,-gnatym,-gnatyn,-gnatyp,-gnatyr,' - '-gnatyt,-gnatyu,-gnatyx\n' + '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe\n' f'version:gnat_external={external_compiler_version()}\n', hash_input("hello")) @@ -84,10 +78,7 @@ assert_eq( 'external:XXX_LIBRARY_TYPE=default\n' 'profile:xxx=VALIDATION\n' 'switches:xxx=-O3,-fdata-sections,-ffunction-sections,-g,-gnatVa,' - '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe,-gnaty-d,-gnaty3,' - '-gnatyA,-gnatyB,-gnatyI,-gnatyO,-gnatyS,-gnatya,-gnatyb,-gnatyc,-gnatye,' - '-gnatyf,-gnatyh,-gnatyi,-gnatyk,-gnatyl,-gnatym,-gnatyn,-gnatyp,-gnatyr,' - '-gnatyt,-gnatyu,-gnatyx\n', + '-gnatW8,-gnata,-gnatn,-gnato,-gnatw.X,-gnatwa,-gnatwe\n', content_of(os.path.join("alire", "build_hash_inputs")) ) diff --git a/testsuite/tests/build_profile/custom_profiles/test.py b/testsuite/tests/build_profile/custom_profiles/test.py index d46efff7..362ab2ca 100644 --- a/testsuite/tests/build_profile/custom_profiles/test.py +++ b/testsuite/tests/build_profile/custom_profiles/test.py @@ -30,7 +30,7 @@ bin_config = 'config/bin_1_config.gpr' # Check default profiles for root and dependency check_config(lib1_config, 'release', ['-O3', '-gnatn']) check_config(lib2_config, 'release', ['-O3', '-gnatn']) -check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa', '-gnaty3']) +check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa']) # Create custom Release profile for lib_1 with open('../lib_1/alire.toml', "a") as manifest: @@ -56,7 +56,7 @@ with open(alr_manifest(), "a") as manifest: run_alr('update') check_config(lib1_config, 'release', ['-Os', '-gnata', '-gnat12']) check_config(lib2_config, 'validation', ['-Og', '-gnatX']) -check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa', '-gnaty3']) +check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa']) # Check that the project builds run_alr('build') diff --git a/testsuite/tests/build_profile/default/test.py b/testsuite/tests/build_profile/default/test.py index 24696d03..335423ae 100644 --- a/testsuite/tests/build_profile/default/test.py +++ b/testsuite/tests/build_profile/default/test.py @@ -30,7 +30,7 @@ bin_config = "config/bin_1_config.gpr" # Check default profiles for root and dependency check_config(lib1_config, 'release', ['-O3', '-gnatn', '-gnatW8']) check_config(lib2_config, 'release', ['-O3', '-gnatn', '-gnatW8']) -check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa', '-gnaty3', '-gnatW8']) +check_config(bin_config, 'development', ['-Og', '-g', '-gnatwa', '-gnatW8']) # Check if we can change the profile of a dependency with open(alr_manifest(), "a") as manifest: diff --git a/testsuite/tests/test/crate-init/test.py b/testsuite/tests/test/crate-init/test.py index a17c612f..a316d2df 100644 --- a/testsuite/tests/test/crate-init/test.py +++ b/testsuite/tests/test/crate-init/test.py @@ -9,7 +9,7 @@ from drivers.asserts import assert_match init_local_crate(with_test=True) p = run_alr("test") -assert_match(".*\[ PASS \] example_test.*", p.out) +assert_match(".*\[ PASS \] assertions_enabled.*", p.out) # default test after init always fails print('SUCCESS') diff --git a/testsuite/tests/test/default-failure/test.py b/testsuite/tests/test/default-failure/test.py index e9f400d0..20e8b8da 100644 --- a/testsuite/tests/test/default-failure/test.py +++ b/testsuite/tests/test/default-failure/test.py @@ -11,26 +11,26 @@ init_local_crate("xxx", with_test=True) # Check with explicit exception -with open("./tests/src/xxx_tests-example_test.adb", "w") as f: - f.write("""procedure Xxx_Tests.Example_Test is +with open("./tests/src/xxx_tests-assertions_enabled.adb", "w") as f: + f.write("""procedure Xxx_Tests.Assertions_Enabled is begin raise Program_Error; -end Xxx_Tests.Example_Test; +end Xxx_Tests.Assertions_Enabled; """) p = run_alr("test", complain_on_error=False) -assert_match(".*\[ FAIL \] example_test.*", p.out) +assert_match(".*\[ FAIL \] assertions_enabled.*", p.out) # Check with plain assertion (verify that assertions are evaluated) -with open("./tests/src/xxx_tests-example_test.adb", "w") as f: - f.write("""procedure Xxx_Tests.Example_Test is +with open("./tests/src/xxx_tests-assertions_enabled.adb", "w") as f: + f.write("""procedure Xxx_Tests.Assertions_Enabled is begin pragma Assert (False); -end Xxx_Tests.Example_Test; +end Xxx_Tests.Assertions_Enabled; """) p = run_alr("test", complain_on_error=False) -assert_match(".*\[ FAIL \] example_test.*", p.out) +assert_match(".*\[ FAIL \] assertions_enabled.*", p.out) print('SUCCESS') diff --git a/testsuite/tests/test/filtering/test.py b/testsuite/tests/test/filtering/test.py index 3de6b7ef..add7834e 100644 --- a/testsuite/tests/test/filtering/test.py +++ b/testsuite/tests/test/filtering/test.py @@ -17,7 +17,7 @@ end Xxx_Tests.{cap}; """) init_local_crate("xxx", with_test=True) -os.remove("./tests/src/xxx_tests-example_test.adb") +os.remove("./tests/src/xxx_tests-assertions_enabled.adb") for test in ["yes1", "yes2", "yes3", "no1", "no2"]: make_test(test) diff --git a/testsuite/tests/test/nested-filtering/test.py b/testsuite/tests/test/nested-filtering/test.py index 93821888..abe8d8e9 100644 --- a/testsuite/tests/test/nested-filtering/test.py +++ b/testsuite/tests/test/nested-filtering/test.py @@ -18,7 +18,7 @@ end Xxx_Tests.{cap}; """) init_local_crate("xxx", with_test=True) -os.remove("./tests/src/xxx_tests-example_test.adb") +os.remove("./tests/src/xxx_tests-assertions_enabled.adb") for parent, test in zip(["pos", "pos", "neg", "neg", "neg"], ["yes1", "yes2", "yes3", "no1", "no2"]): diff --git a/testsuite/tests/test/nested-tests/test.py b/testsuite/tests/test/nested-tests/test.py index 1e8de172..f7944f56 100644 --- a/testsuite/tests/test/nested-tests/test.py +++ b/testsuite/tests/test/nested-tests/test.py @@ -27,7 +27,7 @@ end Xxx_Tests.Nested_Test; # Run `alr test` and check that two PASS lines exist with the proper test names p = run_alr("test") -assert_substring("[ PASS ] example_test", p.out) +assert_substring("[ PASS ] assertions_enabled", p.out) assert_substring("[ PASS ] nested/nested_test", p.out) # Create a third failing test to check its failure and output are reported diff --git a/testsuite/tests/workflows/init-options/test.py b/testsuite/tests/workflows/init-options/test.py index 312dd962..30370929 100644 --- a/testsuite/tests/workflows/init-options/test.py +++ b/testsuite/tests/workflows/init-options/test.py @@ -41,7 +41,7 @@ compare(contents('xxx'), ['xxx/.gitignore', 'xxx/tests/common', 'xxx/tests/common/xxx_tests.ads', 'xxx/tests/src', - 'xxx/tests/src/xxx_tests-example_test.adb', + 'xxx/tests/src/xxx_tests-assertions_enabled.adb', 'xxx/tests/xxx_tests.gpr', 'xxx/xxx.gpr']) @@ -70,7 +70,7 @@ compare(contents('aaa'), ['aaa/.gitignore', 'aaa/tests/common', 'aaa/tests/common/aaa_tests.ads', 'aaa/tests/src', - 'aaa/tests/src/aaa_tests-example_test.adb']) + 'aaa/tests/src/aaa_tests-assertions_enabled.adb']) # Init without skeleton run_alr('init', '--bin', '--no-skel', 'yyy') @@ -138,7 +138,7 @@ compare(contents('.'), ['./.gitignore', './tests/common', './tests/common/zzz_tests.ads', './tests/src', - './tests/src/zzz_tests-example_test.adb', + './tests/src/zzz_tests-assertions_enabled.adb', './tests/zzz_tests.gpr', './zzz.gpr']) -- 2.39.5