From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nHYTT-0004Je-4U for mharc-grub-devel@gnu.org; Tue, 08 Feb 2022 16:56:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHYTR-0004Gp-BF for grub-devel@gnu.org; Tue, 08 Feb 2022 16:56:33 -0500 Received: from [2607:f8b0:4864:20::f33] (port=35429 helo=mail-qv1-xf33.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHYTO-0006wZ-AV for grub-devel@gnu.org; Tue, 08 Feb 2022 16:56:32 -0500 Received: by mail-qv1-xf33.google.com with SMTP id d7so357194qvk.2 for ; Tue, 08 Feb 2022 13:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qGK9HujqzYbcB46R3X34SL4gKYpktpL155my27Antj0=; b=3+rDgtuSxp7qtibgaQkI2pNAcCQcfLgjLFKIOdsTFp+kxKwO4pO/UL4mFBji0meFN4 gRqLzGc8Mk7eW7mJlB8QtTEaE7kX0BUezYIqj61VNYo7+tUf/LmctSGtemJueek0Yx5A N3Bn2NH4oAy6XKmOOhlLfJVFGUs5A87f/S8kR+rLa+Ja5r8UwKgxpu3T5bcAvvUzMkNo i449sasWyKUm+NScYoTNsJJyY9Ptu7qzfWFLcUyTF0EIDWrm/jJes17fyaOKpB/IL8iC 1vV5frIRFCsxuCVHz0oShCfUm/O0hk8OgyLqxw6u/1ugRV+ON5L9SdKaHX4sqE/5edMb EjuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qGK9HujqzYbcB46R3X34SL4gKYpktpL155my27Antj0=; b=Jr9MRBOoylXSdFcNN1njYwM8sr8kg0ReYMvoshlq/e+SAG0RIJevKGEDfb8J07dftX htXoXiQVStDP/npX3jQSAFdI2EXIkXw7LQ8UbOddWzo4iIRcwhJqqQFkCQ3MW2bUog1k D9V8oDxU08q0e6hPSw6Ioti87AIoVcdMz8wV14/1QWGR9noLm7nANGaUhusG/rfpfMwY uINS2joVMDbIwMTK7/RIrNbVnse1pP9+evn9oUUOL8wC4dAK+zGxj1tLzPbBTNhMEw/d lIH8kJwTe+RxG870Za366Lfd2Y9VEndeYod7gxSw9xiPgI2ZrbO1S5Xi4bYiYaBdYmv4 wRgg== X-Gm-Message-State: AOAM531B7sdcRIPxWxCUhB4xNxW9KaeLwoVVkudvdUXbAgKYl7S5MvKV Hf92teH7/rvSakRkJZEJsxziyTQO2ftVKQ== X-Google-Smtp-Source: ABdhPJwW2kxnj1zaHW5Ybrc0Ajaey6oo/LGwSWRHdiTvQoaJydmmNwlTOXhlCo7ZV5n6RtqljCZ7uw== X-Received: by 2002:a0c:be8d:: with SMTP id n13mr361340qvi.82.1644357388823; Tue, 08 Feb 2022 13:56:28 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id j196sm7336971qke.134.2022.02.08.13.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 13:56:28 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v2] tests: Add check-native and check-nonnative make targets Date: Tue, 8 Feb 2022 15:55:57 -0600 Message-Id: <20220208215557.824941-1-development@efficientek.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f33 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f33; envelope-from=development@efficientek.com; helo=mail-qv1-xf33.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FILL_THIS_FORM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2022 21:56:33 -0000 This allows for testing only tests that run directly on the build machine or only tests that run in a virtualized environment. When testing multiple targets on the same build machine the native tests only need to be run once for all targets. Whereas, the nonnative tests must be run for each target because the test is potentially compiled differently for each target. Signed-off-by: Glenn Washburn --- v2: Fix new warnings in bootstrap pointed out by Daniel K Glenn --- Range-diff against v1: 1: 0fa3194bd ! 1: 60195f95e tests: Add check-native and check-nonnative make targets @@ Makefile.util.def: program = { ## conf/Makefile.common ## @@ conf/Makefile.common: KERNEL_HEADER_FILES = + bin_SCRIPTS = bin_PROGRAMS = - check_SCRIPTS = +-check_SCRIPTS = +-check_PROGRAMS = +check_SCRIPTS_native = +check_SCRIPTS_nonnative = - check_PROGRAMS = +check_PROGRAMS_native = +check_PROGRAMS_nonnative = dist_grubconf_DATA = dist_noinst_DATA = grubconf_SCRIPTS = +@@ conf/Makefile.common: platform_PROGRAMS = + sbin_SCRIPTS = + sbin_PROGRAMS = + +-TESTS = + EXTRA_DIST = + CLEANFILES = + BUILT_SOURCES = ## gentpl.py ## @@ gentpl.py: def program(defn, platform, test=False): Makefile.am | 9 +++ Makefile.util.def | 164 +++++++++++++++++++++---------------------- conf/Makefile.common | 7 +- gentpl.py | 6 +- 4 files changed, 97 insertions(+), 89 deletions(-) diff --git a/Makefile.am b/Makefile.am index bf9c1ba64..10faf670b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,6 +24,15 @@ CCASFLAGS_PROGRAM += $(CCASFLAGS_GNULIB) include $(srcdir)/Makefile.util.am +check_SCRIPTS = $(check_SCRIPTS_native) $(check_SCRIPTS_nonnative) +check_PROGRAMS = $(check_PROGRAMS_native) $(check_PROGRAMS_nonnative) +TESTS = $(check_SCRIPTS) $(check_PROGRAMS) + +check-native: + $(MAKE) TESTS="$(check_PROGRAMS_native) $(check_SCRIPTS_native)" check +check-nonnative: + $(MAKE) TESTS="$(check_PROGRAMS_nonnative) $(check_SCRIPTS_nonnative)" check + # XXX Use Automake's LEX & YACC support grub_script.tab.h: $(top_srcdir)/grub-core/script/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(top_srcdir)/grub-core/script/parser.y diff --git a/Makefile.util.def b/Makefile.util.def index f8b356cc1..b098d5bba 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -749,470 +749,470 @@ script = { }; script = { - testcase; + testcase = native; name = ext234_test; common = tests/ext234_test.in; }; script = { - testcase; + testcase = native; name = squashfs_test; common = tests/squashfs_test.in; }; script = { - testcase; + testcase = native; name = iso9660_test; common = tests/iso9660_test.in; }; script = { - testcase; + testcase = native; name = hfsplus_test; common = tests/hfsplus_test.in; }; script = { - testcase; + testcase = native; name = ntfs_test; common = tests/ntfs_test.in; }; script = { - testcase; + testcase = native; name = reiserfs_test; common = tests/reiserfs_test.in; }; script = { - testcase; + testcase = native; name = fat_test; common = tests/fat_test.in; }; script = { - testcase; + testcase = native; name = minixfs_test; common = tests/minixfs_test.in; }; script = { - testcase; + testcase = native; name = xfs_test; common = tests/xfs_test.in; }; script = { - testcase; + testcase = native; name = f2fs_test; common = tests/f2fs_test.in; }; script = { - testcase; + testcase = native; name = nilfs2_test; common = tests/nilfs2_test.in; }; script = { - testcase; + testcase = native; name = romfs_test; common = tests/romfs_test.in; }; script = { - testcase; + testcase = native; name = exfat_test; common = tests/exfat_test.in; }; script = { - testcase; + testcase = native; name = tar_test; common = tests/tar_test.in; }; script = { - testcase; + testcase = native; name = udf_test; common = tests/udf_test.in; }; script = { - testcase; + testcase = native; name = hfs_test; common = tests/hfs_test.in; }; script = { - testcase; + testcase = native; name = jfs_test; common = tests/jfs_test.in; }; script = { - testcase; + testcase = native; name = btrfs_test; common = tests/btrfs_test.in; }; script = { - testcase; + testcase = native; name = zfs_test; common = tests/zfs_test.in; }; script = { - testcase; + testcase = native; name = cpio_test; common = tests/cpio_test.in; }; script = { - testcase; + testcase = native; name = example_scripted_test; common = tests/example_scripted_test.in; }; script = { - testcase; + testcase = native; name = gettext_strings_test; common = tests/gettext_strings_test.in; extra_dist = po/exclude.pot; }; script = { - testcase; + testcase = nonnative; name = pata_test; common = tests/pata_test.in; }; script = { - testcase; + testcase = nonnative; name = ahci_test; common = tests/ahci_test.in; }; script = { - testcase; + testcase = nonnative; name = uhci_test; common = tests/uhci_test.in; }; script = { - testcase; + testcase = nonnative; name = ohci_test; common = tests/ohci_test.in; }; script = { - testcase; + testcase = nonnative; name = ehci_test; common = tests/ehci_test.in; }; script = { - testcase; + testcase = nonnative; name = example_grub_script_test; common = tests/example_grub_script_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_eval; common = tests/grub_script_eval.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_test; common = tests/grub_script_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_echo1; common = tests/grub_script_echo1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_leading_whitespace; common = tests/grub_script_leading_whitespace.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_echo_keywords; common = tests/grub_script_echo_keywords.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_vars1; common = tests/grub_script_vars1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_for1; common = tests/grub_script_for1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_while1; common = tests/grub_script_while1.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_if; common = tests/grub_script_if.in; }; script = { - testcase; + testcase = native; name = grub_script_blanklines; common = tests/grub_script_blanklines.in; }; script = { - testcase; + testcase = native; name = grub_script_final_semicolon; common = tests/grub_script_final_semicolon.in; }; script = { - testcase; + testcase = native; name = grub_script_dollar; common = tests/grub_script_dollar.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_comments; common = tests/grub_script_comments.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_functions; common = tests/grub_script_functions.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_break; common = tests/grub_script_break.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_continue; common = tests/grub_script_continue.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_shift; common = tests/grub_script_shift.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_blockarg; common = tests/grub_script_blockarg.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_setparams; common = tests/grub_script_setparams.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_return; common = tests/grub_script_return.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_regexp; common = tests/grub_cmd_regexp.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_date; common = tests/grub_cmd_date.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_set_date; common = tests/grub_cmd_set_date.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_sleep; common = tests/grub_cmd_sleep.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_expansion; common = tests/grub_script_expansion.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_not; common = tests/grub_script_not.in; }; script = { - testcase; + testcase = native; name = grub_script_no_commands; common = tests/grub_script_no_commands.in; }; script = { - testcase; + testcase = nonnative; name = partmap_test; common = tests/partmap_test.in; }; script = { - testcase; + testcase = nonnative; name = hddboot_test; common = tests/hddboot_test.in; }; script = { - testcase; + testcase = nonnative; name = fddboot_test; common = tests/fddboot_test.in; }; script = { - testcase; + testcase = nonnative; name = cdboot_test; common = tests/cdboot_test.in; }; script = { - testcase; + testcase = nonnative; name = netboot_test; common = tests/netboot_test.in; }; script = { - testcase; + testcase = nonnative; name = pseries_test; common = tests/pseries_test.in; }; script = { - testcase; + testcase = nonnative; name = core_compress_test; common = tests/core_compress_test.in; }; script = { - testcase; + testcase = nonnative; name = xzcompress_test; common = tests/xzcompress_test.in; }; script = { - testcase; + testcase = nonnative; name = gzcompress_test; common = tests/gzcompress_test.in; }; script = { - testcase; + testcase = nonnative; name = lzocompress_test; common = tests/lzocompress_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_echo; common = tests/grub_cmd_echo.in; }; script = { - testcase; + testcase = nonnative; name = help_test; common = tests/help_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_gettext; common = tests/grub_script_gettext.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_escape_comma; common = tests/grub_script_escape_comma.in; }; script = { - testcase; + testcase = nonnative; name = grub_script_strcmp; common = tests/grub_script_strcmp.in; }; script = { - testcase; + testcase = nonnative; name = test_sha512sum; common = tests/test_sha512sum.in; }; script = { - testcase; + testcase = nonnative; name = test_unset; common = tests/test_unset.in; }; script = { - testcase; + testcase = nonnative; name = grub_func_test; common = tests/grub_func_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_tr; common = tests/grub_cmd_tr.in; }; script = { - testcase; + testcase = nonnative; name = file_filter_test; common = tests/file_filter_test.in; }; script = { - testcase; + testcase = nonnative; name = grub_cmd_test; common = tests/grub_cmd_test.in; }; script = { - testcase; + testcase = native; name = syslinux_test; common = tests/syslinux_test.in; }; program = { - testcase; + testcase = native; name = example_unit_test; common = tests/example_unit_test.c; common = tests/lib/unit_test.c; @@ -1227,7 +1227,7 @@ program = { }; program = { - testcase; + testcase = native; name = printf_test; common = tests/printf_unit_test.c; common = tests/lib/unit_test.c; @@ -1242,7 +1242,7 @@ program = { }; program = { - testcase; + testcase = native; name = date_test; common = tests/date_unit_test.c; common = tests/lib/unit_test.c; @@ -1257,7 +1257,7 @@ program = { }; program = { - testcase; + testcase = native; name = priority_queue_unit_test; common = tests/priority_queue_unit_test.cc; common = tests/lib/unit_test.c; @@ -1274,7 +1274,7 @@ program = { }; program = { - testcase; + testcase = native; name = cmp_test; common = tests/cmp_unit_test.c; common = tests/lib/unit_test.c; diff --git a/conf/Makefile.common b/conf/Makefile.common index 68a032ce0..fb0c57a4d 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -105,8 +105,10 @@ KERNEL_HEADER_FILES = bin_SCRIPTS = bin_PROGRAMS = -check_SCRIPTS = -check_PROGRAMS = +check_SCRIPTS_native = +check_SCRIPTS_nonnative = +check_PROGRAMS_native = +check_PROGRAMS_nonnative = dist_grubconf_DATA = dist_noinst_DATA = grubconf_SCRIPTS = @@ -122,7 +124,6 @@ platform_PROGRAMS = sbin_SCRIPTS = sbin_PROGRAMS = -TESTS = EXTRA_DIST = CLEANFILES = BUILT_SOURCES = diff --git a/gentpl.py b/gentpl.py index c86550d4f..28ec24209 100644 --- a/gentpl.py +++ b/gentpl.py @@ -817,8 +817,7 @@ def program(defn, platform, test=False): set_canonical_name_suffix("") if 'testcase' in defn: - gvar_add("check_PROGRAMS", name) - gvar_add("TESTS", name) + gvar_add("check_PROGRAMS_" + defn['testcase'], name) else: var_add(installdir(defn) + "_PROGRAMS", name) if 'mansection' in defn: @@ -859,8 +858,7 @@ def script(defn, platform): name = defn['name'] if 'testcase' in defn: - gvar_add("check_SCRIPTS", name) - gvar_add ("TESTS", name) + gvar_add("check_SCRIPTS_" + defn['testcase'], name) else: var_add(installdir(defn) + "_SCRIPTS", name) if 'mansection' in defn: -- 2.27.0