Project

General

Profile

Actions

action #67894

closed

coordination #67456: [functional][u][epic] Add package test for scons

[functional[u] Create basic package test for scons in devel project build.opensuse.org

Added by SLindoMansilla almost 4 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
Normal
Category:
New test
Target version:
SUSE QA - Milestone 30
Start date:
2020-06-09
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Tasks

  • Add_multibuild to include qa-tests flavor for package testing to https://build.opensuse.org/package/show/devel:tools:building/scons
  • Add tests as scons-tests.tar.gz with content
    • hello-world.c
    • Makefile
    • simple-test/SConstruct
    • simple-test/hello-world.c -> ../hello-world.c
    • target-output/SConstruct
    • target-output/hello-world.c -> ../hello-world.c

File contents

hello-world.c

#include <stdio.h>

int main(int argc, char *argv[]) {
  printf("Hello world \n");
}

Makefile

.DEFAULT_GOAL := help

SHELL   = /bin/sh
COMPILE = scons

software_name = scons-tests
prefix        = /usr/local
srcdir        = $(prefix)/src
software_srcdir = $(srcdir)/$(software_name)

.PHONY: clean_all
clean_all:
        rm --force simple-test/hello-world
        rm --force simple-test/hello-world.o
        rm --force target-output/hello-world.o
        rm --force target-output/hello-world-target-output

.PHONY: help
help:
        @echo "Use make tests to execute tests"

.PHONY: last_test
last_test: target_output

.PHONY: simple_test
simple_test:
        cd simple-test && $(COMPILE)
        [ -f simple-test/hello-world ]
        simple-test/hello-world |grep "Hello world"

.PHONY: target_output
target_output: simple_test
        cd target-output && $(COMPILE)
        [ -f target-output/hello-world-target-output ]
        target-output/hello-world-target-output |grep "Hello world"

.PHONY: tests
tests: last_test

simple-test/SConstruct

print("Minimal compilation")                                                                                                                                  Program('hello-world.c')

target-output/SConstruct

print("Specify target output")
Program('hello-world-target-output', 'hello-world.c')

_multibuild

<multibuild>
  <flavor>tests</flavor>
  <flavor>qa-tests</flavor>
</multibuild>

Examples

Actions

Also available in: Atom PDF