Skip to content

Commit 3373672

Browse files
committed
bare-metal test fix
1 parent a5682cb commit 3373672

File tree

1 file changed

+6
-93
lines changed

1 file changed

+6
-93
lines changed

.github/workflows/baremetal.yml

Lines changed: 6 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
config: [
23-
'--enable-baremetal',
2423
'--enable-baremetal --enable-cryptonly'
2524
]
2625
steps:
@@ -33,61 +32,19 @@ jobs:
3332
run: ./autogen.sh
3433

3534
- name: configure
36-
run: CPPFLAGS="-DWOLFSSL_USER_IO" ./configure ${{ matrix.config }} --disable-examples --enable-cryptocb
35+
run: CPPFLAGS="-DWOLFSSL_USER_IO" ./configure ${{ matrix.config }} --disable-examples --disable-rng
3736

3837
- name: build
3938
run: make -j$(nproc)
4039

41-
- name: Verify macro definitions
42-
run: |
43-
cat > test_baremetal_defines.c <<'EOF'
44-
#include <wolfssl/options.h>
45-
#include <wolfssl/wolfcrypt/settings.h>
46-
#include <stdio.h>
47-
48-
int main() {
49-
int errors = 0;
50-
51-
#ifdef WOLFSSL_BAREMETAL
52-
printf("✓ WOLFSSL_BAREMETAL is defined\n");
53-
#else
54-
printf("✗ ERROR: WOLFSSL_BAREMETAL should be defined\n");
55-
errors++;
56-
#endif
57-
58-
#ifdef WOLFCRYPT_ONLY
59-
printf("✓ WOLFCRYPT_ONLY is defined\n");
60-
#ifdef NO_ASN_TIME
61-
printf("✓ NO_ASN_TIME is defined (expected with WOLFCRYPT_ONLY)\n");
62-
#else
63-
printf("✗ ERROR: NO_ASN_TIME should be defined when WOLFCRYPT_ONLY is set\n");
64-
errors++;
65-
#endif
66-
#else
67-
printf("✓ WOLFCRYPT_ONLY is NOT defined\n");
68-
#ifdef NO_ASN_TIME
69-
printf("✗ ERROR: NO_ASN_TIME should NOT be defined without WOLFCRYPT_ONLY\n");
70-
errors++;
71-
#else
72-
printf("✓ NO_ASN_TIME is NOT defined (expected without WOLFCRYPT_ONLY)\n");
73-
#endif
74-
#endif
75-
76-
return errors;
77-
}
78-
EOF
79-
gcc -I. test_baremetal_defines.c -o test_baremetal_defines
80-
./test_baremetal_defines
40+
- name: Run tests
41+
run: ./wolfcrypt/test/testwolfcrypt
8142

8243
baremetal_cmake:
8344
name: Bare-metal build (CMake)
8445
if: github.repository_owner == 'wolfssl'
8546
runs-on: ubuntu-latest
8647
timeout-minutes: 10
87-
strategy:
88-
fail-fast: false
89-
matrix:
90-
cryptonly: [false, true]
9148
steps:
9249
- uses: actions/checkout@v4
9350

@@ -97,55 +54,11 @@ jobs:
9754
- name: Configure CMake
9855
run: |
9956
mkdir build && cd build
100-
if [ "${{ matrix.cryptonly }}" = "true" ]; then
101-
cmake -DWOLFSSL_BAREMETAL=yes -DWOLFSSL_CRYPTONLY=yes -DWOLFSSL_EXAMPLES=no -DWOLFSSL_CRYPTOCB=yes -DCMAKE_C_FLAGS="-DWOLFSSL_USER_IO -DWOLFCRYPT_ONLY" ..
102-
else
103-
cmake -DWOLFSSL_BAREMETAL=yes -DWOLFSSL_EXAMPLES=no -DWOLFSSL_CRYPTOCB=yes -DCMAKE_C_FLAGS="-DWOLFSSL_USER_IO" ..
104-
fi
57+
cmake -DWOLFSSL_BAREMETAL=yes -DWOLFSSL_EXAMPLES=no -DWOLFSSL_RNG=no -DCMAKE_C_FLAGS="-DWOLFSSL_USER_IO -DWOLFCRYPT_ONLY" ..
10558
10659
- name: Build
10760
run: cd build && cmake --build . -j$(nproc)
10861

109-
- name: Verify macro definitions
110-
run: |
111-
cd build
112-
cat > test_baremetal_defines.c <<'EOF'
113-
#include <wolfssl/options.h>
114-
#include <wolfssl/wolfcrypt/settings.h>
115-
#include <stdio.h>
116-
117-
int main() {
118-
int errors = 0;
119-
120-
#ifdef WOLFSSL_BAREMETAL
121-
printf("✓ WOLFSSL_BAREMETAL is defined\n");
122-
#else
123-
printf("✗ ERROR: WOLFSSL_BAREMETAL should be defined\n");
124-
errors++;
125-
#endif
126-
127-
#ifdef WOLFCRYPT_ONLY
128-
printf("✓ WOLFCRYPT_ONLY is defined\n");
129-
#ifdef NO_ASN_TIME
130-
printf("✓ NO_ASN_TIME is defined (expected with WOLFCRYPT_ONLY)\n");
131-
#else
132-
printf("✗ ERROR: NO_ASN_TIME should be defined when WOLFCRYPT_ONLY is set\n");
133-
errors++;
134-
#endif
135-
#else
136-
printf("✓ WOLFCRYPT_ONLY is NOT defined\n");
137-
#ifdef NO_ASN_TIME
138-
printf("✗ ERROR: NO_ASN_TIME should NOT be defined without WOLFCRYPT_ONLY\n");
139-
errors++;
140-
#else
141-
printf("✓ NO_ASN_TIME is NOT defined (expected without WOLFCRYPT_ONLY)\n");
142-
#endif
143-
#endif
144-
145-
return errors;
146-
}
147-
EOF
148-
# Key: -I. comes BEFORE -I.. so build/wolfssl/options.h is found first
149-
gcc -I. -I.. test_baremetal_defines.c -o test_baremetal_defines
150-
./test_baremetal_defines
62+
- name: Run tests
63+
run: cd build && ./wolfcrypt/test/testwolfcrypt
15164

0 commit comments

Comments
 (0)