#!/bin/bash
#
# Copyright (C) 2012-2015 SUSE Linux GmbH
#
# Author:
# Frank Sundermeyer <fsundermeyer at opensuse dot org>
#
# Testing DAPS: source-validation
#
# * Are the XML sources of the test document well formed ?
#

source lib/common_functions

header "Document Source Validation"

function oneTimeTearDown() {
    stats
}

#---------------------------------------------------------------
# TESTS
#---------------------------------------------------------------

test_validSources () {
    local _MAIN_FILE
    for _MAIN_FILE in "$_MAINPATH" "$_MAINPATH_NOPROF"; do
	xmllint --nonet --noout --nowarning --xinclude --loaddtd $_MAIN_FILE 2>&1
	assertTrue \
            " └─ XML sources for MAIN=$(basename $_MAIN_FILE) do not validate" \
            "$?"
    done
}


# source shUnit2 test
source $_SHUNIT2SRC
