Skip to content

Commit

Permalink
roc-streaminggh-511: Add "scons selftest"
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Jul 13, 2024
1 parent 195e207 commit 118a090
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ jobs:
fail-fast: false
matrix:
include:
- script: linux-checks/conditional-build
- script: linux-checks/static-shared
image: rocstreaming/env-ubuntu:nolibs

- script: linux-checks/static-shared
- script: linux-checks/conditional-build
image: rocstreaming/env-ubuntu:nolibs

- script: linux-checks/debug-build
Expand All @@ -180,6 +180,9 @@ jobs:
- script: linux-checks/check-formatting
image: rocstreaming/env-ubuntu

- script: linux-checks/check-scons
image: rocstreaming/env-ubuntu

- script: linux-checks/pulseaudio-versions
image: rocstreaming/env-ubuntu

Expand Down
7 changes: 6 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,13 @@ doc_env = env.DeepClone()
doc_env.SConscript('docs/SConscript',
duplicate=0, exports='doc_env')

# run scons self-test
env.AlwaysBuild(env.Alias('selftest', [], [
env.SelfTest(),
]))

# exit early if there is nothing to build
non_build_targets = ['fmt', 'docs', 'sphinx', 'doxygen']
non_build_targets = ['fmt', 'docs', 'sphinx', 'doxygen', 'selftest']
if set(COMMAND_LINE_TARGETS) \
and set(COMMAND_LINE_TARGETS).intersection(non_build_targets) == set(COMMAND_LINE_TARGETS):
Return()
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci_checks/linux-checks/check-scons.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

scons -Q selftest
7 changes: 7 additions & 0 deletions scripts/scons_plugin/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def HeaderFormat(env, src_dir):
src_dir=quote(env.Dir(src_dir).path)),
env.PrettyCommand('FMT', env.Dir(src_dir).path, 'yellow'))

def SelfTest(env):
return env.Action(
'{python} scripts/scons_helpers/build-3rdparty.py --self-test'.format(
python=quote(env.GetPythonExecutable())),
env.PrettyCommand('TEST', 'build-3rdparty.py', 'green'))

def Doxygen(env, build_dir='', html_dir=None, config='', sources=[], werror=False):
target = os.path.join(build_dir, 'commit')

Expand Down Expand Up @@ -291,6 +297,7 @@ def noop(target, source, env):
def init(env):
env.AddMethod(ClangFormat, 'ClangFormat')
env.AddMethod(HeaderFormat, 'HeaderFormat')
env.AddMethod(SelfTest, 'SelfTest')
env.AddMethod(Doxygen, 'Doxygen')
env.AddMethod(Sphinx, 'Sphinx')
env.AddMethod(Ragel, 'Ragel')
Expand Down

0 comments on commit 118a090

Please sign in to comment.