4343 make -C lib/cbmc/src minisat2-download
4444 - name : Build with make
4545 run : make -C src -j4 CXX="ccache g++"
46+ - name : Run unit tests
47+ run : make -C unit -j4 CXX="ccache g++"
4648 - name : Run the ebmc tests with SAT
4749 run : make -C regression/ebmc test
4850 - name : Run the ebmc tests with Z3
@@ -101,6 +103,8 @@ jobs:
101103 make -C lib/cbmc/src minisat2-download
102104 - name : Build with make
103105 run : make CXX="ccache clang++" -C src -j4
106+ - name : Run unit tests
107+ run : make -C unit -j4 CXX="ccache clang++"
104108 - name : Run the ebmc tests with SAT
105109 run : make -C regression/ebmc test
106110 - name : Run the ebmc tests with Z3
@@ -203,6 +207,8 @@ jobs:
203207 run : make -C lib/cbmc/src minisat2-download
204208 - name : Build with make
205209 run : make CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs" -C src -j4
210+ - name : Run unit tests
211+ run : make -C unit -j4 CXX="ccache g++ -Wno-class-memaccess" LIBS="-lstdc++fs"
206212 - name : Run the ebmc tests with SAT
207213 run : |
208214 rm regression/ebmc/neural-liveness/counter1.desc
@@ -246,6 +252,8 @@ jobs:
246252 run : make -C lib/cbmc/src minisat2-download
247253 - name : Build with make
248254 run : make YACC="/opt/homebrew/opt/bison/bin/bison" CXX="ccache clang++" -C src -j3
255+ - name : Run unit tests
256+ run : make -C unit -j3 CXX="ccache g++"
249257 - name : Run the ebmc tests with SAT
250258 run : make -C regression/ebmc test
251259 - name : Run the ebmc tests with Z3
@@ -279,6 +287,20 @@ jobs:
279287 run : |
280288 sudo apt-get update
281289 sudo apt-get install --no-install-recommends -yq emscripten flex bison libxml2-utils cpanminus ccache
290+ - name : Install node.js 23
291+ uses : actions/setup-node@v4
292+ with :
293+ node-version : 23
294+ - name : Install emscripten
295+ run : |
296+ # The emscripten package in Ubuntu is too far behind.
297+ git clone https://github.com/emscripten-core/emsdk.git
298+ cd emsdk
299+ git checkout 3.1.31
300+ ./emsdk install latest
301+ ./emsdk activate latest
302+ source ./emsdk_env.sh
303+ emcc --version
282304 - name : Prepare ccache
283305 uses : actions/cache@v4
284306 with :
@@ -297,9 +319,33 @@ jobs:
297319 - name : Get minisat
298320 run : make -C lib/cbmc/src minisat2-download
299321 - name : Build with make
300- run : make -C src -j4 CXX="ccache emcc" HOSTCXX="ccache g++" BUILD_ENV=Unix LINKLIB="emar rc \$@ \$^" AR="emar" EXEEXT=".html"
322+ run : |
323+ source emsdk/emsdk_env.sh
324+ make -C src -j4 \
325+ BUILD_ENV=Unix \
326+ CXX="ccache emcc -fwasm-exceptions" \
327+ LINKFLAGS="-sEXPORTED_RUNTIME_METHODS=callMain" \
328+ LINKLIB="emar rc \$@ \$^" \
329+ AR="emar" \
330+ EXEEXT=".html" \
331+ HOSTCXX="ccache g++" \
332+ HOSTLINKFLAGS=""
301333 - name : print version number via node.js
302- run : node --no-experimental-fetch src/ebmc/ebmc.js --version
334+ run : node --experimental-wasm-exnref src/ebmc/ebmc.js --version
335+ - name : Compile unit tests
336+ run : |
337+ source emsdk/emsdk_env.sh
338+ make -C unit unit_tests.html -j4 \
339+ BUILD_ENV=Unix \
340+ CXX="ccache emcc -fwasm-exceptions" \
341+ LINKFLAGS="-sEXPORTED_RUNTIME_METHODS=callMain" \
342+ LINKLIB="emar rc \$@ \$^" \
343+ AR="emar" \
344+ EXEEXT=".html" \
345+ HOSTCXX="ccache g++" \
346+ HOSTLINKFLAGS=""
347+ - name : Run unit tests
348+ run : node --experimental-wasm-exnref unit/unit_tests.js
303349 - name : Print ccache stats
304350 run : ccache -s
305351
@@ -358,5 +404,10 @@ jobs:
358404 # disable MSYS file-name mangling
359405 MSYS2_ARG_CONV_EXCL : " *"
360406 run : make CXX=clcache BUILD_ENV=MSVC -j4 -C src
407+ - name : Run unit tests
408+ env :
409+ # disable MSYS file-name mangling
410+ MSYS2_ARG_CONV_EXCL : " *"
411+ run : make CXX=clcache BUILD_ENV=MSVC -j4 -C unit
361412 - name : Print ccache stats
362413 run : clcache -s
0 commit comments