Bläddra i källkod

[test] Allow self-tests to be run individually

Separate out the list of self-tests from the self-test infrastructure.
This allows tests to be run individually.  For example:

  make bin/sha1_test.iso

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 år sedan
förälder
incheckning
c0340d9762
2 ändrade filer med 31 tillägg och 6 borttagningar
  1. 0
    6
      src/tests/test.c
  2. 31
    0
      src/tests/tests.c

+ 0
- 6
src/tests/test.c Visa fil

@@ -137,9 +137,3 @@ static void test_init ( void ) {
137 137
 struct init_fn test_init_fn __init_fn ( INIT_NORMAL ) = {
138 138
 	.initialise = test_init,
139 139
 };
140
-
141
-/* Drag in all applicable self-tests */
142
-REQUIRE_OBJECT ( list_test );
143
-REQUIRE_OBJECT ( sha1_test );
144
-REQUIRE_OBJECT ( hmac_drbg_test );
145
-REQUIRE_OBJECT ( hash_df_test );

+ 31
- 0
src/tests/tests.c Visa fil

@@ -0,0 +1,31 @@
1
+/*
2
+ * Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ */
18
+
19
+FILE_LICENCE ( GPL2_OR_LATER );
20
+
21
+/** @file
22
+ *
23
+ * Self-test collection
24
+ *
25
+ */
26
+
27
+/* Drag in all applicable self-tests */
28
+REQUIRE_OBJECT ( list_test );
29
+REQUIRE_OBJECT ( sha1_test );
30
+REQUIRE_OBJECT ( hmac_drbg_test );
31
+REQUIRE_OBJECT ( hash_df_test );

Laddar…
Avbryt
Spara