diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000000000000000000000000000000000..0a891db7812ea7b036de504a8f5f957fe14d12b4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,27 @@ +version: 2 +jobs: + build: + docker: + - image: trzeci/emscripten + + working_directory: ~/repo + + steps: + - checkout + - run: + name: Native Compile + command: make + - run: + name: Native Tests + command: make test + - run: + name: JS Compile + command: make js + - run: + name: Install JS Deps + working_directory: ~/repo/javascript + command: npm install + - run: + name: JS Tests + working_directory: ~/repo/javascript + command: npm run test diff --git a/Makefile b/Makefile index 888717277893dd95b43623060de73aec1241b69f..91436ede1602bb32efd6a11ea9779c3d9a7d514f 100644 --- a/Makefile +++ b/Makefile @@ -219,7 +219,7 @@ fuzzers: $(FUZZER_BINARIES) $(FUZZER_DEBUG_BINARIES) .PHONY: fuzzers $(JS_EXPORTED_FUNCTIONS): $(PUBLIC_HEADERS) - perl -MJSON -ne '$$f{"_$$1"}=1 if /(olm_[^( ]*)\(/; END { @f=sort keys %f; print encode_json \@f }' $^ > $@.tmp + ./exports.py $^ > $@.tmp mv $@.tmp $@ all: test js lib debug doc diff --git a/exports.py b/exports.py new file mode 100755 index 0000000000000000000000000000000000000000..b37cbbb8bf2afffa3f5f3046d32347e13b0bc669 --- /dev/null +++ b/exports.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +import sys +import re +import json + +expr = re.compile(r"(olm_[^( ]*)\(") + +exports = set() + +for f in sys.argv[1:]: + with open(f) as fp: + for line in fp: + matches = expr.search(line) + if matches is not None: + exports.add('_%s' % (matches.group(1),)) + +json.dump(sorted(exports), sys.stdout)